hello-world
Greet users by generating personalized messages with the 'hello-world' tool on the MCP Server Boilerplate. Requires user's name as input to create a welcome response.
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 handler function for the 'hello-world' tool. It takes a 'name' parameter and returns a text response greeting the user.async ({ name }) => { const response = `Hello ${name}`; return { content: [ { type: "text", text: response, }, ], }; }
- src/index.ts:16-18 (schema)Input schema for the 'hello-world' tool, defining a required string 'name' parameter.{ name: z.string().describe("The name of the user"), },
- src/index.ts:13-31 (registration)Registration of 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, }, ], }; } );