Skip to main content
Glama
glaucia86
by glaucia86

delete_todo

Remove a specific task from your todo list by providing its unique ID to manage your tasks effectively.

Instructions

Delete a todo item

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUUID of the todo to delete

Implementation Reference

  • Main handler method for delete_todo tool. Validates input using DeleteTodoSchema, calls todoService.deleteTodo, and returns success/error response.
    async handleDeleteTodo(request: CallToolRequest): Promise<CallToolResult> {
      try {
        const sanitizedArgs = sanitizeInput(request.params.arguments);
        const validatedRequest = validateData(DeleteTodoSchema, sanitizedArgs);
        const deleted = this.todoService.deleteTodo(validatedRequest.id);
    
        return {
          content: [
            {
              type: "text",
              text: deleted
                ? `✅ Todo com ID ${validatedRequest.id} deletado com sucesso`
                : `❌ Todo com ID ${validatedRequest.id} não encontrado`,
            },
          ],
        };
      } catch (error) {
        const errorResponse = createErrorResponse(error, "deletar todo");
        return {
          content: [
            {
              type: "text",
              text: `❌ ${errorResponse.error}\n${errorResponse.details || ""}`,
            },
          ],
        };
      }
  • Zod schema defining input for delete_todo: requires 'id' field validated as UUID.
    export const DeleteTodoSchema = z.object({
      id: UuiSchema
    });
  • Tool registration in TOOL_DEFINITIONS array, defining name, description, and input schema for MCP tool server.
    {
      name: "delete_todo",
      description: "Delete a todo item",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            format: "uuid",
            description: "UUID of the todo to delete",
          },
        },
        required: ["id"],
      },
    },
  • Core service method that performs the actual deletion from the in-memory todos Map after validating ID.
    deleteTodo(id: string): boolean {
      try {
        validateData(TodoSchema.shape.id, id);
        return this.todos.delete(id);
      } catch (error) {
        if (error instanceof ValidationError) {
          throw error;
        }
        return false;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Delete' implies a destructive mutation, it doesn't specify whether deletion is permanent or reversible, what permissions are required, whether it affects related data, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves critical behavioral traits undisclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable and appropriately sized for the tool's simple function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive mutation tool with no annotations and no output schema, the description is insufficiently complete. It lacks critical context about behavioral consequences, error handling, return values, and differentiation from sibling tools, leaving significant gaps for an agent to safely and correctly invoke this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with the single parameter 'id' documented as 'UUID of the todo to delete'. The description adds no additional parameter semantics beyond what the schema already provides, so it meets the baseline for adequate but unenriched parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and target resource ('a todo item'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'update_todo' which could also modify or remove todos, nor does it specify whether this is a soft or hard deletion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'update_todo' that might handle status changes to 'completed' instead of deletion, and 'get_todo'/'list_todos' for verification, there's no indication of appropriate contexts, prerequisites, or exclusions for this destructive operation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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