You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When teaching other folks about MCP, the Python SDK makes it pretty easy to define a tool in which the returned text is the response. However, in the TS SDK, you have to wrap the response in a content object, revealing more details about the protocol and raising questions (what's it mean to have more than one content object, etc.).
It would be great if we could allow a tool callback to simply return text and the invoking function can do the necessary wrapping for the protocol.
Example:
Current
server.tool("add-two-numbers","Add two numbers",{a: z.number().describe("The first number to add"),b: z.number().describe("The second number to add")},({ a, b })=>{return{content: [{type: "text",text: a+b,}]}})
Proposal
server.tool("add-two-numbers","Add two numbers",{a: z.number().describe("The first number to add"),b: z.number().describe("The second number to add")},({ a, b })=>a+b,);
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When teaching other folks about MCP, the Python SDK makes it pretty easy to define a tool in which the returned text is the response. However, in the TS SDK, you have to wrap the response in a content object, revealing more details about the protocol and raising questions (what's it mean to have more than one content object, etc.).
It would be great if we could allow a tool callback to simply return text and the invoking function can do the necessary wrapping for the protocol.
Example:
Current
Proposal
The text was updated successfully, but these errors were encountered: