get_todo
Retrieve a specific task by its unique ID to view details, update status, or manage priorities within your todo list.
Instructions
Get a specific todo by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | UUID of the todo to retrieve |
Implementation Reference
- src/handlers/toolHandlers.ts:202-238 (handler)Handler function that executes the 'get_todo' tool: sanitizes and validates input using GetTodoByIdSchema, retrieves todo via service, formats success/error response.async handleGetTodo(request: CallToolRequest): Promise<CallToolResult> { try { const sanitizedArgs = sanitizeInput(request.params.arguments); const validatedRequest = validateData(GetTodoByIdSchema, sanitizedArgs); const todo = this.todoService.getTodoById(validatedRequest.id); if (!todo) { return { content: [ { type: "text", text: `❌ Todo com ID ${validatedRequest.id} não encontrado`, }, ], }; } return { content: [ { type: "text", text: `📋 Todo encontrado:\n\n${JSON.stringify(todo, null, 2)}`, }, ], }; } catch (error) { const errorResponse = createErrorResponse(error, "buscar todo"); return { content: [ { type: "text", text: `❌ ${errorResponse.error}\n${errorResponse.details || ""}`, }, ], }; } }
- src/schemas/todo.schemas.ts:47-49 (schema)Zod input schema for validating the 'get_todo' tool request: requires a valid UUID id.export const GetTodoByIdSchema = z.object({ id: UuiSchema });
- src/config/toolDefinitions.ts:130-144 (registration)MCP tool registration definition for 'get_todo', including JSON input schema for UUID id.{ name: "get_todo", description: "Get a specific todo by ID", inputSchema: { type: "object", properties: { id: { type: "string", format: "uuid", description: "UUID of the todo to retrieve", }, }, required: ["id"], }, },
- Core service method that fetches a todo item by ID from the in-memory todos Map.getTodoById(id: string): Todo | null { const todo = this.todos.get(id); return todo || null; }