Fix old toolResult format being used in TS exampel

Resolves #80
This commit is contained in:
Justin Spahr-Summers 2024-12-17 15:05:27 +00:00
commit 95a616325e
No known key found for this signature in database

View file

@ -73,7 +73,12 @@ Here's an example of implementing a basic tool in an MCP server:
if (request.params.name === "calculate_sum") {
const { a, b } = request.params.arguments;
return {
toolResult: a + b
content: [
{
type: "text",
text: String(a + b)
}
]
};
}
throw new Error("Tool not found");