parent
10a2dd0192
commit
95a616325e
1 changed files with 6 additions and 1 deletions
|
|
@ -73,7 +73,12 @@ Here's an example of implementing a basic tool in an MCP server:
|
||||||
if (request.params.name === "calculate_sum") {
|
if (request.params.name === "calculate_sum") {
|
||||||
const { a, b } = request.params.arguments;
|
const { a, b } = request.params.arguments;
|
||||||
return {
|
return {
|
||||||
toolResult: a + b
|
content: [
|
||||||
|
{
|
||||||
|
type: "text",
|
||||||
|
text: String(a + b)
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
throw new Error("Tool not found");
|
throw new Error("Tool not found");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue