Skip to main content
Glama

getTaskById

Retrieve a specific task from Teamwork using its unique identifier. Get task details directly to integrate project data into your workflow.

Instructions

Get a specific task by ID from Teamwork

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesThe ID of the task to retrieve

Implementation Reference

  • Tool handler that receives the input, extracts taskId, calls the service, and returns the task data as JSON string content.
    export async function handleGetTaskById(input: any) {
      logger.info('Calling teamworkService.getTaskById()');
      logger.info(`Task ID: ${input?.taskId}`);
      
      try {
        const taskId = String(input?.taskId);
        if (!taskId) {
          throw new Error("Task ID is required");
        }
        
        const task = await teamworkService.getTaskById(taskId);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify(task, null, 2)
          }]
        };
      } catch (error: any) {
        return createErrorResponse(error, 'Retrieving task');
      }
    } 
  • Tool definition including name 'getTaskById', description, inputSchema (requiring taskId as integer), and annotations.
    export const getTaskByIdDefinition = {
      name: "getTaskById",
      description: "Get a specific task by ID from Teamwork",
      inputSchema: {
        type: "object",
        properties: {
          taskId: {
            type: "integer",
            description: "The ID of the task to retrieve"
          }
        },
        required: ["taskId"]
      },
      annotations: {
        title: "Get a Task by its ID",
        readOnlyHint: false,
        destructiveHint: false,
        openWorldHint: false
      }
    };
  • Registration of getTaskById tool in the toolPairs array, pairing its definition with the handler.
    { definition: getTaskById, handler: handleGetTaskById },
  • Service layer function that makes the actual API call to GET /tasks/{taskId}.json via the API client.
    export const getTaskById = async (taskId: string) => {
      try {
        const api = ensureApiClient();
        const response = await api.get(`/tasks/${taskId}.json`);
        return response.data;
      } catch (error: any) {
        logger.error(`Error fetching task ${taskId}: ${error.message}`);
        throw new Error(`Failed to fetch task ${taskId}`);
      }
    };
  • Tool group mapping in config that includes 'getTaskById' under the 'Tasks' group for allow/deny list filtering.
    'Tasks': ['getTasks', 'getTasksByProjectId', 'getTaskListsByProjectId', 'getTaskById', 'createTask', 'createSubTask', 'updateTask', 'deleteTask', 'getTasksMetricsComplete', 'getTasksMetricsLate', 'getTaskSubtasks', 'getTaskComments'],
Behavior1/5

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

Description says 'Get' implying a read-only operation, but annotations set readOnlyHint=false, contradicting the operation. No additional behavioral context is provided.

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 of 9 words, perfectly concise and front-loaded with the essential purpose.

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?

Fully adequate for a simple get-by-ID tool with one parameter, but the annotation contradiction undermines completeness.

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% with clear description for taskId. Description adds no extra meaning beyond the schema, achieving baseline for high coverage.

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?

Description clearly states verb 'Get', resource 'a specific task by ID', and source 'from Teamwork', distinguishing it from sibling tools that list tasks or operate on other resources.

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?

No explicit when-to-use or alternatives provided, but context from siblings implies this is for retrieving a single task by ID, distinct from listing tools like getTasks.

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/Vizioz/Teamwork-MCP'

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