basecamp_get_todoset
Retrieve todo lists and groups from a Basecamp project to organize and track tasks within your team workflow.
Instructions
Get todo set container for a project. Returns todo lists and groups.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucket_id | Yes | Basecamp resource identifier | |
| todoset_id | Yes |
Implementation Reference
- src/tools/todos.ts:37-90 (handler)The main handler function that initializes the Basecamp client, fetches the todo set by ID, lists all todo lists in the set using paged API, and returns a JSON summary of the todo set and its lists.async (params) => { try { const client = await initializeBasecampClient(); const responseTodoSet = await client.todoSets.get({ params: { bucketId: params.bucket_id, todosetId: params.todoset_id }, }); if (responseTodoSet.status !== 200 || !responseTodoSet.body) { throw new Error("Failed to fetch todo set"); } const todoLists = await asyncPagedToArray({ fetchPage: client.todoLists.list, request: { params: { bucketId: params.bucket_id, todosetId: params.todoset_id, }, query: {}, }, }); const todoSet = responseTodoSet.body; return { content: [ { type: "text", text: JSON.stringify( { id: todoSet.id, name: todoSet.name, url: todoSet.app_url, completed: todoSet.completed, todoLists: todoLists.map((list) => ({ id: list.id, url: list.app_url, title: list.title, completed: list.completed, position: list.position, })), }, null, 2, ), }, ], }; } catch (error) { return { content: [{ type: "text", text: handleBasecampError(error) }], }; } },
- src/tools/todos.ts:20-91 (registration)Registers the 'basecamp_get_todoset' tool with the MCP server inside the registerTodoTools function.server.registerTool( "basecamp_get_todoset", { title: "Get Basecamp Todo Set", description: "Get todo set container for a project. Returns todo lists and groups.", inputSchema: { bucket_id: BasecampIdSchema, todoset_id: BasecampIdSchema, }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async (params) => { try { const client = await initializeBasecampClient(); const responseTodoSet = await client.todoSets.get({ params: { bucketId: params.bucket_id, todosetId: params.todoset_id }, }); if (responseTodoSet.status !== 200 || !responseTodoSet.body) { throw new Error("Failed to fetch todo set"); } const todoLists = await asyncPagedToArray({ fetchPage: client.todoLists.list, request: { params: { bucketId: params.bucket_id, todosetId: params.todoset_id, }, query: {}, }, }); const todoSet = responseTodoSet.body; return { content: [ { type: "text", text: JSON.stringify( { id: todoSet.id, name: todoSet.name, url: todoSet.app_url, completed: todoSet.completed, todoLists: todoLists.map((list) => ({ id: list.id, url: list.app_url, title: list.title, completed: list.completed, position: list.position, })), }, null, 2, ), }, ], }; } catch (error) { return { content: [{ type: "text", text: handleBasecampError(error) }], }; } }, );
- src/tools/todos.ts:22-36 (schema)Input schema and metadata for the tool: requires bucket_id and todoset_id using BasecampIdSchema, read-only idempotent tool.{ title: "Get Basecamp Todo Set", description: "Get todo set container for a project. Returns todo lists and groups.", inputSchema: { bucket_id: BasecampIdSchema, todoset_id: BasecampIdSchema, }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, },
- src/schemas/common.ts:10-12 (schema)Common Zod schema for Basecamp IDs (z.number()), used in the tool's inputSchema for bucket_id and todoset_id.export const BasecampIdSchema = z .number() .describe("Basecamp resource identifier");
- src/index.ts:63-63 (registration)Top-level call to registerTodoTools(server), which includes registration of basecamp_get_todoset.registerTodoTools(server);