Skip to main content
Glama

todo_add

Add new tasks to a checklist with titles, priorities, due dates, and tags for organized task management on the MCP TODO Checklist Server.

Instructions

Adiciona uma nova tarefa à lista

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dueDateNoData de vencimento (YYYY-MM-DD)
listTitleYesTítulo da lista
priorityNoPrioridade da tarefa
tagsNoTags da tarefa
taskTitleYesTítulo da tarefa

Implementation Reference

  • Executes the todo_add tool: validates input with Zod schema, retrieves user's checklists, finds the target list by title, adds a new item using ChecklistService.addItem, and returns a success message.
    case "todo_add": { console.error('DEBUG - Processing todo_add'); const params = addSchema.parse(args); const lists = await checklistService.getUserChecklists('current-user'); const list = lists.find(l => l.title === params.listTitle); if (!list) { throw new Error(`Lista não encontrada: ${params.listTitle}`); } const newItem = await checklistService.addItem(list.id, { title: params.taskTitle, priority: params.priority, dueDate: params.dueDate ? new Date(params.dueDate) : undefined, tags: params.tags, completed: false }); return { content: [{ type: "text", text: `Tarefa "${params.taskTitle}" adicionada à lista "${params.listTitle}"!` }] }; }
  • Zod schema for validating input parameters of the todo_add tool.
    const addSchema = z.object({ listTitle: z.string(), taskTitle: z.string(), priority: z.enum(['low', 'medium', 'high']).optional().default('medium'), dueDate: z.string().optional(), tags: z.array(z.string()).optional().default([]) });
  • src/index.ts:111-125 (registration)
    Registers the todo_add tool in the ListTools response, including its description and input schema.
    { name: "todo_add", description: "Adiciona uma nova tarefa à lista", inputSchema: { type: "object", properties: { listTitle: { type: "string", description: "Título da lista" }, taskTitle: { type: "string", description: "Título da tarefa" }, priority: { type: "string", enum: ["low", "medium", "high"], description: "Prioridade da tarefa" }, dueDate: { type: "string", description: "Data de vencimento (YYYY-MM-DD)" }, tags: { type: "array", items: { type: "string" }, description: "Tags da tarefa" }, }, required: ["listTitle", "taskTitle"], }, },
  • Helper method in ChecklistService that implements the core logic for adding a new item to a checklist: generates ID and timestamps, appends to items array, persists to storage.
    async addItem(checklistId: string, data: Omit<ChecklistItem, 'id' | 'createdAt' | 'updatedAt'>): Promise<ChecklistItem> { const checklist = await this.getChecklist(checklistId); const now = new Date(); const item: ChecklistItem = { ...data, id: crypto.randomUUID(), createdAt: now, updatedAt: now }; checklist.items.push(item); checklist.updatedAt = now; await this.storage.save(`checklist:${checklistId}`, checklist); return item; }

Other Tools

Related Tools

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/hevener10/mcp-todo-checklist'

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