hello-world
Greet users by name using a simple API tool. Input a user's name to generate a personalized greeting, ideal for testing and integration in AI assistant workflows.
Instructions
Say hello to the user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the user |
Implementation Reference
- src/index.ts:19-30 (handler)The asynchronous handler function that receives the user's name and returns a structured text response with the greeting 'Hello ${name}'.async ({ name }) => { const response = `Hello ${name}`; return { content: [ { type: "text", text: response, }, ], }; }
- src/index.ts:16-18 (schema)Zod input schema defining the required 'name' parameter as a string with description.{ name: z.string().describe("The name of the user"), },
- src/index.ts:13-31 (registration)Registers the 'hello-world' tool on the MCP server, including name, description, input schema, and handler function.server.tool( "hello-world", "Say hello to the user", { name: z.string().describe("The name of the user"), }, async ({ name }) => { const response = `Hello ${name}`; return { content: [ { type: "text", text: response, }, ], }; } );