hello-world
Generate personalized greetings by providing a user name. This tool demonstrates basic functionality for MCP server development templates.
Instructions
Say hello to the user
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "hello-world"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the user |
Implementation Reference
- src/index.ts:19-30 (handler)The async 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)Zod input schema defining the 'name' parameter for the "hello-world" tool.
{ name: z.string().describe("The name of the user"), }, - src/index.ts:14-31 (registration)Registration of the "hello-world" tool using server.tool(), including name, description, schema, and handler.
"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, }, ], }; } );