Skip to main content
Glama
todos.ts1.22 kB
// src/tools/todos.ts import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { bcRequest } from "../lib/basecamp.js"; export function registerTodoTools(server: McpServer) { server.registerTool( "create_todo", { title: "Create a to-do", description: "Create a new to-do in the given list.", inputSchema: { project_id: z.number().int(), todolist_id: z.number().int(), content: z.string(), description: z.string().optional(), due_on: z .string() .regex(/^\d{4}-\d{2}-\d{2}$/) .optional(), // YYYY-MM-DD }, }, async ({ project_id, todolist_id, content, description, due_on }) => { const payload: any = { content }; if (description) payload.description = description; if (due_on) payload.due_on = due_on; const todo = await bcRequest<any>( "POST", `/buckets/${project_id}/todolists/${todolist_id}/todos.json`, payload ); return { content: [ { type: "text", text: `Created to-do ${todo.id} in list ${todolist_id}.`, }, ], }; } ); }

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/craigashields/basecamp-mcp'

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