Skip to main content
Glama

get_task_tool

Retrieve a specific task by its ID to view details or check status within the Tasks MCP Server's management system.

Instructions

Get a task by ID. Args: task_id (int): The ID of the task to retrieve.

Returns: Task: The task object if found, otherwise None.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYes

Implementation Reference

  • The handler function that implements the logic for the 'get_task_tool' MCP tool. It retrieves a task from the database by ID and returns a Task object or None.
    @mcp.tool() async def get_task_tool( ctx: Context[ServerSession, AppContext], task_id: int ) -> Task | None: """Get a task by ID. Args: task_id (int): The ID of the task to retrieve. Returns: Task: The task object if found, otherwise None. """ database: DatabaseABC = ctx.request_context.lifespan_context.db task = database.get_task(task_id=task_id) return Task(**task.__dict__) if task else None
  • The call to create_tasks_tools(mcp) which invokes the decorators to register the get_task_tool (and other task tools) with the FastMCP server.
    create_tasks_tools(mcp)
  • Import of the create_tasks_tools function used to register the task tools including get_task_tool.
    from tools.tasks import create_tasks_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/chipocrudos/tasks-mcp'

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