Skip to content

Commit ec0b74a

Browse files
committed
bug #171 [MCPSDK] Make content an array to match the MCP spec (tom-hart-sky-uk)
This PR was merged into the main branch. Discussion ---------- [MCPSDK] Make content an array to match the MCP spec | Q | A | ------------- | --- | Bug fix? | yes | New feature? |no <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix #123 | License | MIT Force `content` in `\Symfony\AI\McpSdk\Server\RequestHandler\ToolCallHandler` to be an array to match the [spec](https://modelcontextprotocol.io/specification/2025-06-18/schema#calltoolresult-content) <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- 15320d2 Make content an array to match the MCP spec
2 parents 7559456 + 15320d2 commit ec0b74a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mcp-sdk/src/Server/RequestHandler/ToolCallHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function createResponse(Request $message): Response|Error
6060
};
6161

6262
return new Response($message->id, [
63-
'content' => $content,
63+
'content' => [$content], // TODO: allow multiple `ToolCallResult`s in the future
6464
'isError' => $result->isError,
6565
]);
6666
}

0 commit comments

Comments
 (0)