hello-world
Generate a hello greeting for a specified name. Enter a name to receive a personalized hello message.
Instructions
A simple hello world tool
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name to say hello to |
Implementation Reference
- src/index.ts:28-28 (registration)Registration of the 'hello-world' tool name and schema in the ListToolsRequestSchema handler.
name: "hello-world", - src/index.ts:30-39 (schema)Input schema for 'hello-world' tool: requires a 'name' string property.
inputSchema: { type: "object", properties: { name: { type: "string", description: "The name to say hello to", }, }, required: ["name"], }, - src/index.ts:56-67 (handler)Handler logic for the 'hello-world' tool call: reads name argument and returns a greeting string.
server.setRequestHandler(CallToolRequestSchema, async (request) => { if (request.params.name === "hello-world") { const name = String(request.params.arguments?.name || "World"); return { content: [ { type: "text", text: `Hello, ${name}! This is the ctxtest MCP server.`, }, ], }; }