Skip to main content
Glama

delete_task_tool

Remove tasks from the task management system by specifying their unique ID to clear completed or unnecessary items.

Instructions

Delete a task by ID. Args: task_id (int): The ID of the task to delete.

Returns: None

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYes

Implementation Reference

  • The async handler function for the 'delete_task_tool' that retrieves the database from context, calls delete_task on it, and returns a success message.
    @mcp.tool() async def delete_task_tool( ctx: Context[ServerSession, AppContext], task_id: int ) -> str: """Delete a task by ID. Args: task_id (int): The ID of the task to delete. Returns: None """ database: DatabaseABC = ctx.request_context.lifespan_context.db database.delete_task(task_id=task_id) return f"Task {task_id} deleted successfully."
  • The call to create_tasks_tools(mcp) which registers the delete_task_tool among other tasks tools on the FastMCP server instance.
    create_tasks_tools(mcp)

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/chipocrudos/tasks-mcp'

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