Skip to main content
Glama
create-todo.ts748 B
import { z } from "zod"; import { todoSchema } from "../../schema/todo.js"; import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; export const createTodo = async ( args: z.infer<typeof todoSchema>, extra: RequestHandlerExtra ): Promise<CallToolResult> => { // Here you would typically save the todo to a database or file system const todoDetails = [ args.text, args.dueDate ? `Due: ${args.dueDate}` : null, args.priority ? `Priority: ${args.priority}` : null, ] .filter(Boolean) .join(" | "); return { content: [ { type: "text", text: `Todo added: ${todoDetails}`, }, ], }; };

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/RahulRana0707/mcp-server'

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