Skip to main content
Glama

get_task

Retrieve detailed information for a specific task using its unique task number (e.g., 'CRD-1') to access task details and requirements.

Instructions

Retrieves detailed information for a specific task using its unique task number (e.g., 'CRD-1').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYes

Implementation Reference

  • The `execute` method in `GetTaskTool` class implements the core logic of the `get_task` tool. It validates input, calls the SecureApiClient to fetch task details by number from `/task/number/{number}`, handles empty responses gracefully, and returns structured task data or error response.
    async execute(input: GetTaskInput): Promise<unknown> {
      logger.info('Executing get-task tool', input);
    
      try {
        // Use the injected API client to get task by number
        if (!this.apiClient) {
          throw new Error('API client not available - tool not properly initialized');
        }
    
        const url = `/task/number/${input.number.toUpperCase()}`;
        logger.debug(`Making GET request to: ${url}`);
        
        const responseData = await this.apiClient.get<TaskApiResponse>(url) as unknown as TaskApiResponse;
    
        // If responseData is null, undefined, or an empty object,
        // optional chaining and fallbacks will produce an "empty task" structure.
        // This ensures that if the API call itself doesn't throw (e.g. 404, 500),
        // but returns no meaningful data, we provide a default empty structure.
        
        // Return only the specific properties requested, ensuring compact JSON
        return {
          number: responseData?.number || input.number || '', // Echo input number if API response is empty
          title: responseData?.title || '',
          description: responseData?.description || '',
          status: responseData?.status || '',
          priority: responseData?.priority || '',
          agent: responseData?.agent || '',
          agent_prompt: responseData?.agent_prompt || '',
          context: responseData?.context || '',
          instructions: responseData?.instructions || ''
        };
      } catch (error) {
        const errorMessage = (error instanceof Error) ? error.message : 'An unknown error occurred';
        logger.error(`Error in get-task tool: ${errorMessage}`, error instanceof Error ? error : undefined);
        
        return {
          isError: true,
          content: [{ type: "text", text: errorMessage }]
        };
      }
    }
  • Zod schema `GetTaskSchema` defines the input validation for `get_task` tool, requiring a `number` field matching the pattern `^[A-Za-z]{3}-\d+$` (e.g., 'CRD-1').
    const GetTaskSchema = z.object({
      // Task number (required)
      number: z.string()
        .regex(/^[A-Za-z]{3}-\d+$/, { message: "Task number must be in the format ABC-123 (e.g., CRD-1 or crd-1). Case insensitive." })
        .describe("Task number identifier (e.g., 'CRD-1')"),
    }).strict();
  • src/index.ts:315-330 (registration)
    In `createProductionServer`, `GetTaskTool` is instantiated with `secureApiClient` dependency (line 318) and added to the `tools` array. The array is then iterated to call `tool.register(server)` on the MCP `Server` instance, registering the `get_task` tool.
    const tools: any[] = [
      new StartProjectTool(secureApiClient),
      new GetPromptTool(secureApiClient),
      new GetTaskTool(secureApiClient),
      new GetProjectTool(secureApiClient),
      new UpdateTaskTool(secureApiClient),
      new UpdateProjectTool(secureApiClient),
      new ListProjectsTool(secureApiClient),
      new ListTasksTool(secureApiClient),
      new NextTaskTool(secureApiClient),
    ];
    
    // Register each tool with the server
    tools.forEach(tool => {
      tool.register(server);
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a retrieval operation but doesn't disclose whether it requires authentication, has rate limits, what format the detailed information returns, or whether it's a read-only operation. The description adds minimal behavioral context beyond the basic action.

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 tool's purpose and includes the parameter example. Every word earns its place with zero waste or redundancy.

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 single-parameter retrieval tool with no annotations and no output schema, the description provides adequate basic context but lacks important details about authentication requirements, return format, error conditions, or how it differs from sibling tools like list_tasks. It's minimally viable but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for the single parameter, the description compensates well by explaining the 'number' parameter's purpose ('unique task number') and providing a concrete example format ('CRD-1'). This adds meaningful semantic context beyond what the schema's pattern constraint alone provides.

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 ('retrieves detailed information') and resource ('for a specific task'), with a specific example of the identifier format ('CRD-1'). It distinguishes from list_tasks (which retrieves multiple tasks) but doesn't explicitly differentiate from get_project or get_prompt which retrieve different resource types.

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 you need detailed information about a specific task identified by its number, but doesn't explicitly state when to use this versus list_tasks (for multiple tasks) or next_task (for workflow sequencing). No explicit alternatives or exclusions are provided.

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/PixdataOrg/coderide-mcp'

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