import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
// Schema for hello world tool input
const HelloWorldSchema = z
.object({
name: z.string().optional().describe("Name to greet (optional)"),
})
.strict();
export const registerHelloWorldTools = (server: McpServer) => {
server.tool(
"hello_world",
"Say hello to someone or the world",
{
name: {
type: "string",
description: "Name to greet (optional)",
},
},
async (args) => {
const validatedArgs = HelloWorldSchema.parse(args);
const name = validatedArgs.name || "World";
return {
content: [
{
type: "text",
text: `Hello, ${name}! This is the Radius MCP Server.`,
},
],
};
}
);
};