Skip to main content
Glama

getTasksByProjectId

Retrieve all tasks from a specific Teamwork project by providing the project ID to manage and track project work items.

Instructions

Get all tasks from a specific project in Teamwork

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe ID of the project to get tasks from

Implementation Reference

  • The main handler function for the 'getTasksByProjectId' MCP tool. It processes the input, calls the teamwork service to fetch tasks, formats the response as JSON text, and handles errors.
    export async function handleGetTasksByProjectId(input: any) {
      logger.info('Calling teamworkService.getTasksByProjectId()');
      logger.info(`Project ID: ${input?.projectId}`);
      
      try {
        const projectId = String(input?.projectId);
        if (!projectId) {
          throw new Error("Project ID is required");
        }
        
        const tasks = await teamworkService.getTasksByProjectId(projectId);
        logger.info(`Tasks response received for project ID: ${projectId}`);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify(tasks, null, 2)
          }]
        };
      } catch (error: any) {
        return createErrorResponse(error, 'Retrieving tasks for project');
      }
    } 
  • The tool definition including name, description, input schema (requiring projectId as integer), and annotations for the 'getTasksByProjectId' tool.
    export const getTasksByProjectIdDefinition = {
      name: "getTasksByProjectId",
      description: "Get all tasks from a specific project in Teamwork",
      inputSchema: {
        type: "object",
        properties: {
          projectId: {
            type: "integer",
            description: "The ID of the project to get tasks from"
          }
        },
        required: ["projectId"]
      },
      annotations: {
        title: "Get Tasks by Project ID",
        readOnlyHint: false,
        destructiveHint: false,
        openWorldHint: false
      }
    };
  • Registration of the 'getTasksByProjectId' tool in the central toolPairs array, pairing its definition and handler for use in the MCP tools registry. (See also import at line 13 and export at line 118.)
    { definition: getTasksByProjectId, handler: handleGetTasksByProjectId },
  • Supporting service function that performs the actual API call to retrieve tasks for a given project ID from Teamwork, used by the tool handler.
    export const getTasksByProjectId = async (projectId: string) => {
      try {
        const api = ensureApiClient();
        const response = await api.get(`/projects/${projectId}/tasks.json`);
        return response.data;
      } catch (error: any) {
        logger.error(`Error fetching tasks for project ${projectId}: ${error.message}`);
        throw new Error(`Failed to fetch tasks for project ${projectId}`);
      }
    };
Behavior3/5

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

Annotations indicate readOnlyHint=false, destructiveHint=false, and openWorldHint=false, covering safety and scope. The description adds no behavioral context beyond the basic operation, such as pagination, rate limits, or authentication needs. It doesn't contradict annotations, but offers minimal additional value.

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 directly states the tool's function without unnecessary words. It is front-loaded and wastes no space, making it highly concise and well-structured.

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?

Given the tool's low complexity (one parameter, no output schema) and annotations covering key behavioral aspects, the description is minimally adequate. However, it lacks details on output format, error handling, or integration with sibling tools, which could enhance completeness for agent use.

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% for the single parameter 'projectId', which is fully documented in the schema. The description adds no extra meaning, syntax, or format details beyond what the schema provides, meeting the baseline for high coverage.

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 ('all tasks from a specific project'), making the purpose evident. It distinguishes from general 'getTasks' but doesn't explicitly differentiate from similar siblings like 'getTaskListsByProjectId' or 'getTasksByTaskListId', which would require more specific scope clarification.

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 when to choose this over 'getTasks', 'getTaskById', or 'getTasksByTaskListId', nor does it specify prerequisites or exclusions, leaving usage context unclear.

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