Skip to main content
Glama
soriat

MCP Elicitations Demo Server

by soriat
tool-add.ts641 B
import { z } from "zod"; import { zodToJsonSchema } from "zod-to-json-schema"; const AddSchema = z.object({ a: z.number().describe("First number"), b: z.number().describe("Second number"), }); export const addTool = { name: "add", description: "Adds two numbers", inputSchema: zodToJsonSchema(AddSchema), handler: async (args: any) => { const validatedArgs = AddSchema.parse(args); const sum = validatedArgs.a + validatedArgs.b; return { content: [ { type: "text" as const, text: `The sum of ${validatedArgs.a} and ${validatedArgs.b} is ${sum}.`, }, ], }; }, };

Implementation Reference

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/soriat/soria-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server