Skip to main content
Glama

get_todo

Retrieve a specific task by its unique ID using the tool on Todo List MCP Server. Input the task's UUID to access its details efficiently.

Instructions

Get a specific todo by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUUID of the todo to retrieve

Implementation Reference

  • The handleGetTodo function implements the get_todo tool logic: validates the input ID using GetTodoByIdSchema, fetches the todo using TodoService, and returns formatted text response or error.
    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 || ""}`, }, ], }; } }
  • The tool definition for 'get_todo' including name, description, and input schema for registration in the TOOL_DEFINITIONS array.
    { 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"], }, },
  • Zod schema for validating the input to get_todo tool, requiring a UUID id.
    export const GetTodoByIdSchema = z.object({ id: UuiSchema });
  • The TodoService method getTodoById that retrieves a todo from the in-memory store by ID, called by the handler.
    getTodoById(id: string): Todo | null { const todo = this.todos.get(id); return todo || null; }

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/glaucia86/todo-list-mcp-server'

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