Skip to main content
Glama

task_get

Read-onlyIdempotent

Retrieve a complete task record with all subtasks, notes, comments, and dependencies for detailed project tracking in structured databases.

Instructions

Get a single task with full details including all subtasks, related notes, comments, and dependencies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTask ID

Implementation Reference

  • The handler function that executes the logic for fetching a task and its related data (subtasks, notes, comments, dependencies).
    function handleTaskGet(args: Record<string, unknown>) {
      const db = getDb();
      const id = args.id as number;
    
      const task = db
        .prepare(
          `SELECT t.*, e.name as epic_name
           FROM tasks t
           JOIN epics e ON e.id = t.epic_id
           WHERE t.id = ?`
        )
        .get(id);
    
      if (!task) throw new Error(`Task ${id} not found`);
    
      const subtasks = db
        .prepare('SELECT * FROM subtasks WHERE task_id = ? ORDER BY sort_order, created_at')
        .all(id);
    
      const notes = db
        .prepare(
          `SELECT * FROM notes
           WHERE related_entity_type = 'task' AND related_entity_id = ?
           ORDER BY created_at DESC`
        )
        .all(id);
    
      const comments = db
        .prepare('SELECT * FROM comments WHERE task_id = ? ORDER BY created_at ASC')
        .all(id);
    
      // Dependencies: what this task depends on
      const dependsOn = db
        .prepare(
          `SELECT t.id, t.title, t.status FROM task_dependencies d
           JOIN tasks t ON t.id = d.depends_on_task_id
           WHERE d.task_id = ?`
        )
        .all(id);
    
      // Dependents: what tasks depend on this task
      const dependents = db
        .prepare(
          `SELECT t.id, t.title, t.status FROM task_dependencies d
           JOIN tasks t ON t.id = d.task_id
           WHERE d.depends_on_task_id = ?`
        )
        .all(id);
    
      return { ...(task as object), subtasks, notes, comments, depends_on: dependsOn, dependents };
    }
    
    function handleTaskUpdate(args: Record<string, unknown>) {
      const db = getDb();
      const id = args.id as number;
    
      const oldRow = db.prepare('SELECT * FROM tasks WHERE id = ?').get(id) as Record<string, unknown> | undefined;
      if (!oldRow) throw new Error(`Task ${id} not found`);
  • The input schema definition for the task_get tool.
    inputSchema: {
      type: 'object',
      properties: {
        id: { type: 'integer', description: 'Task ID' },
      },
      required: ['id'],
    },
  • The registration of the task_get tool handler within the tool mapping.
    task_get: handleTaskGet,
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false. The description adds valuable context by specifying what 'full details' includes (subtasks, notes, comments, dependencies), which goes beyond the annotations and helps the agent understand the richness of the returned data.

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 that immediately states the core purpose and scope. Every word earns its place with no redundant information or unnecessary elaboration.

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 read-only single-resource retrieval tool with comprehensive annotations and 100% schema coverage, the description provides adequate context about what data is returned. The main gap is the lack of output schema, but the description compensates somewhat by listing included data types. It could be more complete by mentioning response format or limitations.

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' clearly documented as 'Task ID'. The description doesn't add any additional parameter semantics beyond what the schema provides, so the baseline score of 3 is appropriate.

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 verb ('Get') and resource ('a single task') with specific scope ('full details including all subtasks, related notes, comments, and dependencies'). It distinguishes from sibling 'task_list' which returns multiple tasks, but doesn't explicitly mention this distinction in the description itself.

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

Usage Guidelines3/5

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

The description implies usage when detailed information about a specific task is needed, but doesn't explicitly state when to use this versus alternatives like 'task_list' for multiple tasks or 'tracker_search' for broader queries. No exclusions or prerequisites are mentioned.

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/spranab/saga-mcp'

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