Skip to main content
Glama

task_get

Read-onlyIdempotent

Retrieve a single task's complete details including subtasks, notes, comments, and dependencies to stay informed on project progress.

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 task_get tool logic. Fetches a single task by ID from the database, including its subtasks, notes, comments, dependencies, and dependents.
    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 };
    }
  • The tool definition/schema for task_get, declaring the tool name, description, and input validation schema (requires an integer 'id').
    {
      name: 'task_get',
      description: 'Get a single task with full details including all subtasks, related notes, comments, and dependencies.',
      annotations: { title: 'Get Task', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'integer', description: 'Task ID' },
        },
        required: ['id'],
      },
    },
  • The handlers map that registers handleTaskGet under the key 'task_get'. This is exported and merged into the global ALL_HANDLERS in index.ts.
    export const handlers: Record<string, ToolHandler> = {
      task_create: handleTaskCreate,
      task_list: handleTaskList,
      task_get: handleTaskGet,
      task_update: handleTaskUpdate,
    };
  • src/index.ts:37-49 (registration)
    The central handler registry (ALL_HANDLERS) that merges all tool handlers including taskHandlers (which contains task_get). The CallToolRequestSchema handler dispatches to the correct function by name.
    const ALL_HANDLERS: Record<string, (args: Record<string, unknown>) => unknown> = {
      ...projectHandlers,
      ...epicHandlers,
      ...taskHandlers,
      ...subtaskHandlers,
      ...noteHandlers,
      ...commentHandlers,
      ...templateHandlers,
      ...dashboardHandlers,
      ...searchHandlers,
      ...activityHandlers,
      ...exportImportHandlers,
    };
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint, and idempotentHint. The description adds value by specifying the full scope of returned data (subtasks, notes, comments, dependencies), providing behavioral context beyond the safety profile.

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?

Single sentence that fronts the purpose and efficiently lists included details. No superfluous content.

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 simple get tool with one parameter and no output schema, the description adequately explains the return scope. Could optionally mention error conditions or permissions, but annotations cover safety and idempotency.

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 coverage is 100% for the single parameter 'id', which is described as 'Task ID'. The description does not add further meaning or constraints beyond the schema, so a baseline of 3 is appropriate.

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 uses a specific verb ('Get') and resource ('a single task'), and clearly outlines the included details (subtasks, notes, comments, dependencies). This effectively distinguishes it from sibling tools like task_list or task_create.

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 for retrieving a single task by ID, but does not explicitly state when to use it over alternatives like task_list. No exclusions or when-not scenarios are mentioned, relying on the user or agent to infer context from the sibling list.

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