Skip to main content
Glama

add_task

Add tasks to your todo list with titles, priorities, and estimated Pomodoro sessions to organize work and track productivity.

Instructions

Add a new task to the todo list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTask title
descriptionNoTask description
priorityYesTask priority
estimatedPomodorosYesEstimated number of pomodoros needed

Implementation Reference

  • Executes the add_task tool: creates a new Task from input arguments, appends it to the tasks list, persists data to file, and returns a success response with the new task.
    case "add_task": { const task: Task = { id: Date.now().toString(), title: args.title as string, description: args.description as string, status: "pending", priority: args.priority as "low" | "medium" | "high", estimatedPomodoros: args.estimatedPomodoros as number, completedPomodoros: 0, createdAt: new Date().toISOString(), }; data.tasks.push(task); saveData(data); return { content: [ { type: "text", text: JSON.stringify( { success: true, task, message: "Task added successfully" }, null, 2 ), }, ], }; }
  • Defines the tool metadata including name, description, and input schema for validating add_task parameters.
    { name: "add_task", description: "Add a new task to the todo list", inputSchema: { type: "object", properties: { title: { type: "string", description: "Task title" }, description: { type: "string", description: "Task description" }, priority: { type: "string", enum: ["low", "medium", "high"], description: "Task priority", }, estimatedPomodoros: { type: "number", description: "Estimated number of pomodoros needed", }, }, required: ["title", "priority", "estimatedPomodoros"], }, },
  • src/index.ts:245-247 (registration)
    Registers the list tools handler which exposes the add_task tool (among others) via the TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));
  • TypeScript interface defining the structure of a Task, used in the add_task handler.
    interface Task { id: string; title: string; description?: string; status: "pending" | "in-progress" | "completed"; priority: "low" | "medium" | "high"; estimatedPomodoros: number; completedPomodoros: number; createdAt: string; completedAt?: string; }

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/PratyayRajak/todopomo-mcp'

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