Skip to main content
Glama
108yen

task-orchestrator-mcp

by 108yen

getTask

Retrieve a specific task by its ID from the task orchestration server to view details or manage workflow.

Instructions

Get a task by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTask ID

Implementation Reference

  • src/tools.ts:117-159 (registration)
    Registration of the MCP 'getTask' tool using server.registerTool. Defines the tool name, description, input schema requiring a task ID string, and a handler function that calls the underlying getTask implementation, formats the response as JSON, and handles errors.
    // Register getTask tool
    server.registerTool(
      "getTask",
      {
        description: "Get a task by its ID",
        inputSchema: {
          id: z.string().describe("Task ID"),
        },
      },
      (args) => {
        try {
          const task = getTask(args.id)
          return {
            content: [
              {
                text: JSON.stringify({ task }, null, 2),
                type: "text",
              },
            ],
          }
        } catch (error) {
          return {
            content: [
              {
                text: JSON.stringify(
                  {
                    error: {
                      code: "TASK_NOT_FOUND",
                      message:
                        error instanceof Error ? error.message : "Unknown error",
                    },
                  },
                  null,
                  2,
                ),
                type: "text",
              },
            ],
            isError: true,
          }
        }
      },
    )
  • Core handler function for retrieving a task by ID. Validates input, loads all tasks from storage, searches recursively using findTaskById, throws appropriate errors if invalid ID or not found, returns the Task object.
    export function getTask(id: string): Task {
      if (!id || typeof id !== "string") {
        throw new Error(ERROR_MESSAGES.INVALID_TASK_ID)
      }
    
      const tasks = readTasks()
      const task = findTaskById(tasks, id)
    
      if (!task) {
        throw new Error(ERROR_MESSAGES.TASK_NOT_FOUND(id))
      }
    
      return task
    }
  • Input schema definition for the getTask tool using Zod: requires 'id' as a string with description.
    {
      description: "Get a task by its ID",
      inputSchema: {
        id: z.string().describe("Task ID"),
      },
    },
  • Recursive helper function to find a task by ID in the nested task hierarchy.
    export function findTaskById(tasks: Task[], id: string): Task | undefined {
      for (const task of tasks) {
        if (task.id === id) {
          return task
        }
        const found = findTaskById(task.tasks, id)
        if (found) {
          return found
        }
      }
      return undefined
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Get' implies a read operation, it doesn't explicitly state whether this requires authentication, what happens if the ID doesn't exist (error behavior), or any rate limits. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 perfectly concise at just 5 words ('Get a task by its ID'). It's front-loaded with the core purpose and contains zero wasted words. Every element of the description earns its place by communicating essential information efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation with 1 parameter and 100% schema coverage, the description is minimally adequate. However, with no annotations and no output schema, it doesn't describe what the tool returns (task object structure) or error conditions. The description meets basic requirements but leaves gaps that could hinder effective tool selection and invocation.

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' in the schema. The description adds no additional parameter information beyond what the schema already provides. According to guidelines, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 action ('Get') and resource ('a task by its ID'), making the purpose immediately understandable. It distinguishes this from siblings like listTasks (which retrieves multiple tasks) and createTask/updateTask (which modify tasks). However, it doesn't explicitly mention that this retrieves a single task, which would make it fully specific.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention that this is for retrieving a specific known task ID, while listTasks is for browsing/searching tasks, or that it should be used instead of siblings like updateTask when only read access is needed. No exclusions or prerequisites are stated.

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/108yen/task-orchestrator-mcp'

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