Skip to main content
Glama

MCP Template

by pidanmeng
add.ts585 B
import type { Tool } from 'fastmcp'; import { z } from 'zod'; import { useLogger } from '../utils/logger'; const name = 'add'; const description = 'add two numbers'; const parameters = z.object({ a: z.number(), b: z.number(), }); const add: Tool<any, z.ZodType<typeof parameters._type>> = { name, description, parameters, execute: async (args, context) => { const { a, b } = args; const { log } = context; const logger = useLogger(log); logger.info(`Adding ${a} and ${b}`); return (a + b).toString(); }, }; export { add };

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/pidanmeng/mcp-template'

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