Skip to main content
Glama

create_todo

Add a new task to a Basecamp project to-do list by specifying project, list, content, and optional due date.

Instructions

Create a new to-do in the given list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
todolist_idYes
contentYes
descriptionNo
due_onNo

Implementation Reference

  • The handler function for the 'create_todo' tool that constructs a payload and makes a POST request to the Basecamp API using bcRequest to create a new todo item.
    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}.`,
          },
        ],
      };
    }
  • Zod-based input schema defining parameters for the 'create_todo' tool: project_id, todolist_id, content, optional description and due_on (YYYY-MM-DD format).
    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
    },
  • Direct registration of the 'create_todo' tool using server.registerTool, including schema and handler.
    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}.`,
            },
          ],
        };
      }
    );
  • Invocation of registerTodoTools on the MCP server instance, which registers the 'create_todo' tool.
    registerTodoTools(server);
  • bcRequest utility function used in the create_todo handler to perform authenticated HTTP requests to the Basecamp API.
    export async function bcRequest<T = any>(
      method: string,
      path: string,
      body?: unknown,
      params?: Record<string, string | number | boolean>
    ): Promise<T> {
      const { data } = await bcRequestWithHeaders<T>(method, path, body, params);
      return data;
    }

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