-
-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Labels
MCP BundleIssues & PRs about the MCP SDK integration bundleIssues & PRs about the MCP SDK integration bundleRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)
Description
Hi, currently tool calling supports returning dependents of Content, strings and arrays.
However, it is not possible to control the value of the is_error key.
I suggest implementing a way to control this value, maybe by either :
- Throwing a specific exception (like
ToolErrorExceptionwhich would be caught in special way - Forcing the tools to return an instance of
Contentor aToolResultclass that could contain an array of contents, and ais_errorboolean
I personally think the second option is best, since it would standardise the way tool calls are done.
That's what I had done in my own implementation of MCP here : https://github.com/EdouardCourty/mcp-server-bundle/blob/main/src/DependencyInjection/CompilerPass/ToolPass.php#L90, and it worked really well!
Metadata
Metadata
Assignees
Labels
MCP BundleIssues & PRs about the MCP SDK integration bundleIssues & PRs about the MCP SDK integration bundleRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)