Skip to main content
Glama

delete_task

Remove a task from the Task MCP Server by specifying its ID to manage your task list effectively.

Instructions

Delete a task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesID of the task to delete

Implementation Reference

  • Handler logic for delete_task tool: extracts task_id from arguments, checks if task exists in the global tasks dictionary, deletes it using pop if found, and returns a success or error message via TextContent.
    elif name == "delete_task":
        task_id = int(arguments.get("task_id", 0))
        
        if task_id not in tasks:
            return [
                types.TextContent(
                    type="text",
                    text=f"❌ Task {task_id} not found"
                )
            ]
        
        deleted_task = tasks.pop(task_id)
        return [
            types.TextContent(
                type="text",
                text=f"🗑️ Task deleted: {deleted_task['title']}"
            )
        ]
  • Registers the delete_task tool in the list_tools handler, providing name, description, and input schema expecting a numeric task_id.
    types.Tool(
        name="delete_task",
        description="Delete a task",
        inputSchema={
            "type": "object",
            "properties": {
                "task_id": {
                    "type": "number",
                    "description": "ID of the task to delete"
                }
            },
            "required": ["task_id"]
        }
    )
  • Input schema for delete_task tool, defining an object with required numeric task_id property.
    inputSchema={
        "type": "object",
        "properties": {
            "task_id": {
                "type": "number",
                "description": "ID of the task to delete"
            }
        },
        "required": ["task_id"]
    }
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/gvbigdata/MCP-Github-Deployment'

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