hello
Generate personalized greetings by inputting a name to receive a customized hello message from the HelloWorld MCP Server.
Instructions
Say hello to someone
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | The name of the person to greet | World |
Implementation Reference
- src/index.ts:69-79 (handler)Handler logic for the 'hello' tool, extracting the name parameter and returning a greeting text response.case 'hello': { const targetName = (args as { name?: string }).name || 'World'; return { content: [ { type: 'text', text: `Hello, ${targetName}! 👋 Welcome to the HelloWorld MCP server!`, }, ], }; }
- src/index.ts:28-41 (schema)Input schema and metadata for the 'hello' tool, defined in the ListTools response.{ name: 'hello', description: 'Say hello to someone', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'The name of the person to greet', default: 'World', }, }, }, },
- src/index.ts:25-62 (registration)Registration of tools including 'hello' via the ListToolsRequestHandler.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: 'hello', description: 'Say hello to someone', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'The name of the person to greet', default: 'World', }, }, }, }, { name: 'add', description: 'Add two numbers together', inputSchema: { type: 'object', properties: { a: { type: 'number', description: 'First number', }, b: { type: 'number', description: 'Second number', }, }, required: ['a', 'b'], }, }, ], }; });