Search
Now let's add a tool to your MCP server.
Every MCP tool has:
1server.registerTool( 2 'tool-name', // Unique identifier 3 { 4 title: 'Display Name', 5 description: 'What this tool does', 6 inputSchema: { /* parameters */ }, 7 outputSchema: { /* return type */ } 8 }, 9 async (inputs) => { 10 // Tool logic here 11 return { content: [...], structuredContent: {...} }; 12 } 13);
A simple greet tool that:
name
Example:
{ name: "Alice" }
"Hello, Alice! Welcome to MCP."