Skip to main content
Glama

Delete TODO

delete_todo

Permanently delete entire TODO lists and associated tasks from the Knowledge MCP Server. Use this tool to clean up completed, obsolete, or duplicate TODOs, ensuring project organization. Confirms permanent removal upon execution.

Instructions

Delete an entire TODO list and all its tasks permanently.

When to use this tool:

  • TODO is completely finished

  • TODO is obsolete or cancelled

  • Cleaning up old TODOs

  • Consolidating duplicate TODOs

  • User explicitly requests deletion

Key features:

  • Removes entire TODO list

  • Deletes all associated tasks

  • Permanent removal

  • Frees up TODO number

You should:

  1. Verify all tasks are complete or obsolete

  2. Confirm TODO number is correct

  3. Understand deletion is permanent

  4. Consider if TODO has value for history

  5. Check no active work depends on it

DO NOT use when:

  • TODO has incomplete relevant tasks

  • Might need TODO for reference

  • Unsure about deletion impact

Returns: {success: bool, message: str, error?: str}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe project identifier
todo_numberYesThe TODO list number to delete

Implementation Reference

  • The primary asynchronous handler function implementing the delete_todo tool. It validates parameters, checks for project and TODO existence, recursively deletes the TODO directory using fs.rm, performs a git auto-commit, and returns a success/error response.
    async deleteTodoAsync(params: {
      project_id: z.infer<typeof secureProjectIdSchema>;
      todo_number: z.infer<typeof secureTodoNumberSchema>;
    }): Promise<string> {
      const context = this.createContext('delete_todo', params);
    
      try {
        const { project_id, todo_number } = params;
        const projectInfo = await getProjectDirectoryAsync(this.storagePath, project_id);
    
        if (!projectInfo) {
          throw new MCPError(MCPErrorCode.PROJECT_NOT_FOUND, `Project ${project_id} not found`, {
            project_id,
            traceId: context.traceId,
          });
        }
    
        const [originalId, projectPath] = projectInfo;
        const todoDir = join(projectPath, 'TODO', todo_number.toString());
    
        // Check if TODO exists
        try {
          await access(todoDir);
        } catch {
          throw new MCPError(MCPErrorCode.TODO_NOT_FOUND, `TODO #${todo_number} not found`, {
            project_id,
            todo_number,
            traceId: context.traceId,
          });
        }
    
        // Delete the entire TODO directory
        await rm(todoDir, { recursive: true, force: true });
    
        // Auto-commit
        await autoCommitAsync(this.storagePath, `Delete TODO #${todo_number} from ${originalId}`);
    
        this.logSuccess('delete_todo', params, context);
        return this.formatSuccessResponse({
          message: `Deleted TODO #${todo_number}`,
        });
      } catch (error) {
        this.logError('delete_todo', params, error as MCPError, context);
        return this.formatErrorResponse(error, context);
      }
    }
  • Registers the 'delete_todo' tool with the MCP server, defining its title, description from toolDescriptions, input schema using Zod schemas, and handler delegation to todoHandler.deleteTodoAsync.
      'delete_todo',
      {
        title: 'Delete TODO',
        description: TOOL_DESCRIPTIONS.delete_todo,
        inputSchema: {
          project_id: secureProjectIdSchema.describe('The project identifier'),
          todo_number: secureTodoNumberSchema.describe('The TODO list number to delete'),
        },
      },
      async ({ project_id, todo_number }) => {
        const result = await todoHandler.deleteTodoAsync({ project_id, todo_number });
        return {
          content: [
            {
              type: 'text',
              text: result,
            },
          ],
        };
      }
    );
  • Detailed usage description and guidelines for the delete_todo tool, used in tool registration.
      delete_todo: `Delete an entire TODO list and all its tasks permanently.
    
    When to use this tool:
    - TODO is completely finished
    - TODO is obsolete or cancelled
    - Cleaning up old TODOs
    - Consolidating duplicate TODOs
    - User explicitly requests deletion
    
    Key features:
    - Removes entire TODO list
    - Deletes all associated tasks
    - Permanent removal
    - Frees up TODO number
    
    You should:
    1. Verify all tasks are complete or obsolete
    2. Confirm TODO number is correct
    3. Understand deletion is permanent
    4. Consider if TODO has value for history
    5. Check no active work depends on it
    
    DO NOT use when:
    - TODO has incomplete relevant tasks
    - Might need TODO for reference
    - Unsure about deletion impact
    
    Returns: {success: bool, message: str, error?: str}`,
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it's a destructive operation ('permanent removal'), removes all associated tasks, frees up TODO numbers, and requires verification steps. It doesn't mention rate limits, authentication needs, or error handling specifics, but covers the critical destructive nature adequately.

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

Conciseness4/5

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

The description is well-structured with clear sections (purpose, usage guidelines, features, steps, exclusions, returns) and front-loaded with the core action. Some redundancy exists (e.g., 'permanent removal' repeated), but overall it's efficient with every sentence adding value.

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

Completeness4/5

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

For a destructive tool with no annotations and no output schema, the description provides strong context: clear purpose, detailed usage guidelines, behavioral transparency about permanence, and return value documentation. It doesn't specify error conditions or response formats beyond the basic return structure, but covers most critical aspects given the complexity.

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%, so the schema already documents both parameters ('project_id' and 'todo_number'). The description doesn't add any parameter-specific semantics beyond what the schema provides (e.g., no clarification on TODO number uniqueness or project context). Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('Delete an entire TODO list and all its tasks permanently'), identifies the resource ('TODO list'), and distinguishes it from sibling tools like 'remove_todo_task' which only removes individual tasks. It goes beyond the tool name/title by specifying the scope of deletion.

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

Usage Guidelines5/5

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

The description provides explicit 'When to use this tool' with five specific scenarios, 'DO NOT use when' with three clear exclusions, and implicit alternatives (e.g., 'remove_todo_task' for partial deletion). This comprehensive guidance helps the agent choose appropriately among sibling tools.

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

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/sven-borkert/knowledge-mcp'

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