todo_create
Create a new task list with a title and optional description to organize and manage your to-do items.
Instructions
Cria uma nova lista de tarefas
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Título da lista | |
| description | No | Descrição da lista (opcional) |
Implementation Reference
- src/index.ts:173-183 (handler)Executes the todo_create tool: validates input using createSchema, calls checklistService.createChecklist to persist a new todo list, and returns a success response.case "todo_create": { console.error('DEBUG - Processing todo_create'); const params = createSchema.parse(args); const newList = await checklistService.createChecklist({ title: params.title, description: params.description, owner: 'current-user', items: [] }); return { content: [{ type: "text", text: `Lista "${params.title}" criada com sucesso!` }] }; }
- src/index.ts:33-36 (schema)Zod schema for validating input parameters of todo_create tool (title required, description optional).const createSchema = z.object({ title: z.string(), description: z.string().optional() });
- src/index.ts:99-110 (registration)Registers the todo_create tool in the listTools response, including name, description, and input schema.{ name: "todo_create", description: "Cria uma nova lista de tarefas", inputSchema: { type: "object", properties: { title: { type: "string", description: "Título da lista" }, description: { type: "string", description: "Descrição da lista (opcional)" }, }, required: ["title"], }, },
- src/service/ChecklistService.ts:7-19 (helper)Core helper method that creates and persists a new Checklist object with generated UUID, timestamps, and empty items array.async createChecklist(data: Omit<Checklist, 'id' | 'createdAt' | 'updatedAt'>): Promise<Checklist> { const now = new Date(); const checklist: Checklist = { ...data, id: crypto.randomUUID(), createdAt: now, updatedAt: now, items: [] }; await this.storage.save(`checklist:${checklist.id}`, checklist); return checklist; }