basecamp_create_todo
Create a new to-do item in Basecamp by specifying the project bucket, target list, and task content to organize project work and track assignments.
Instructions
Create a new todo item in a todo list.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucket_id | Yes | Basecamp resource identifier | |
| content | Yes | ||
| description | No | ||
| todolist_id | Yes |
Implementation Reference
- src/tools/todos.ts:176-208 (handler)The handler function that executes the tool: initializes Basecamp client, calls todos.create API, handles response or error.async (params) => { try { const client = await initializeBasecampClient(); const response = await client.todos.create({ params: { bucketId: params.bucket_id, todolistId: params.todolist_id, }, body: { content: params.title, description: params.content, assignee_ids: params.assignee_ids, }, }); if (response.status !== 201 || !response.body) { throw new Error("Failed to create todo"); } return { content: [ { type: "text", text: `Todo created!\n\nID: ${response.body.id}\nContent: ${response.body.content}`, }, ], }; } catch (error) { return { content: [{ type: "text", text: handleBasecampError(error) }], }; } },
- src/tools/todos.ts:159-168 (schema)Input schema validation using Zod for the tool parameters: bucket_id, todolist_id, title, content, assignee_ids.inputSchema: { bucket_id: BasecampIdSchema, todolist_id: BasecampIdSchema, title: z.string().min(1), content: z.string().optional(), assignee_ids: z .array(BasecampIdSchema) .optional() .describe("Array of person IDs to assign to this todo"), },
- src/tools/todos.ts:154-209 (registration)Registers the basecamp_create_todo tool on the MCP server with schema, annotations, and handler function.server.registerTool( "basecamp_create_todo", { title: "Create Basecamp Todo", description: `Create a new todo item in a todo list. ${htmlRules}`, inputSchema: { bucket_id: BasecampIdSchema, todolist_id: BasecampIdSchema, title: z.string().min(1), content: z.string().optional(), assignee_ids: z .array(BasecampIdSchema) .optional() .describe("Array of person IDs to assign to this todo"), }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, }, }, async (params) => { try { const client = await initializeBasecampClient(); const response = await client.todos.create({ params: { bucketId: params.bucket_id, todolistId: params.todolist_id, }, body: { content: params.title, description: params.content, assignee_ids: params.assignee_ids, }, }); if (response.status !== 201 || !response.body) { throw new Error("Failed to create todo"); } return { content: [ { type: "text", text: `Todo created!\n\nID: ${response.body.id}\nContent: ${response.body.content}`, }, ], }; } catch (error) { return { content: [{ type: "text", text: handleBasecampError(error) }], }; } }, );
- src/index.ts:63-63 (registration)Top-level registration call that invokes registerTodoTools, which includes the basecamp_create_todo tool.registerTodoTools(server);