Skip to main content
Glama

getTaskListsByProjectId

Retrieve all task lists for a specific project in Teamwork to organize and track project tasks effectively.

Instructions

Get all task lists by project ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe ID of the project to get task lists from

Implementation Reference

  • The main MCP tool handler function. Validates projectId from input, calls the teamwork service to fetch task lists, formats the response as text content, and handles errors.
    export async function handleGetTaskListsByProjectId(input: any) {
      logger.info('Calling teamworkService.getTaskListsByProjectId()');
      logger.info(`Project ID: ${input?.projectId}`);
      
      try {
        const projectId = input?.projectId;
        if (!projectId) {
          throw new Error("Project ID is required");
        }
        
        const taskLists = await teamworkService.getTaskListsByProjectId(projectId);
        logger.info(`Task lists response received for project ID: ${projectId}`);
        
        if (taskLists) {
          return {
            content: [{
              type: "text",
              text: JSON.stringify(taskLists, null, 2)
            }]
          };
        } else {
          return {
            content: [{
              type: "text",
              text: `Error getting task lists for project ID: ${projectId}`
            }]
          };
        }
      } catch (error: any) {
        return createErrorResponse(error, 'Retrieving task lists');
      }
    } 
  • The tool schema definition, including name, description, input schema requiring projectId (integer), and annotations.
    export const getTaskListsByProjectIdDefinition = {
      name: "getTaskListsByProjectId",
      description: "Get all task lists by project ID",
      inputSchema: {
        type: "object",
        properties: {
          projectId: {
            type: "integer",
            description: "The ID of the project to get task lists from"
          }
        },
        required: ["projectId"]
      },
      annotations: {
        title: "Get Task Lists by Project ID",
        readOnlyHint: false,
        destructiveHint: false,
        openWorldHint: false
      }
    };
  • Registration of the tool in the toolPairs array, pairing the definition with its handler function.
    { definition: getTaskListsByProjectId, handler: handleGetTaskListsByProjectId },
  • Import statement bringing in the tool definition (aliased) and handler from the specific tool file.
    import { getTaskListsByProjectIdDefinition as getTaskListsByProjectId, handleGetTaskListsByProjectId } from './tasks/getTaskListsByProjectId.js';
  • Supporting service function called by the handler. Performs the actual API request to Teamwork to retrieve task lists for the given project ID.
    export const getTaskListsByProjectId = async (projectId: number) => {
      try {
        const api = ensureApiClient();
        const response = await api.get(`/projects/${projectId}/tasklists.json`);
        return response.data;
      } catch (error: any) {
        logger.error(`Error fetching task lists for project ${projectId}: ${error.message}`);
        throw new Error(`Failed to fetch task lists 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, suggesting a safe, bounded read operation. The description adds no behavioral context beyond this, such as pagination, rate limits, or authentication needs. Since annotations cover the safety profile, the description meets the lower bar but doesn't enrich understanding with additional operational details.

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 front-loads the core purpose without unnecessary words. It avoids redundancy and wastes no space, making it easy to parse quickly. This optimal brevity supports effective tool selection in a concise manner.

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 tool with one parameter and annotations covering safety, the description is minimally adequate but lacks output details (no output schema provided) and usage context. It doesn't explain return values like list structure or error cases, leaving gaps that could hinder agent understanding. Completeness is borderline given the tool's low complexity.

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?

The input schema has 100% description coverage, with the 'projectId' parameter fully documented as 'The ID of the project to get task lists from'. The description adds no additional meaning beyond this, such as format examples or constraints. Given the high schema coverage, a baseline score of 3 is appropriate, as the description doesn't compensate but doesn't need to.

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 task lists by project ID'), making the purpose immediately understandable. It distinguishes from siblings like 'getTasksByProjectId' by specifying task lists rather than tasks, though it doesn't explicitly contrast them. The description avoids tautology by not just restating the tool name.

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 like 'getTasksByProjectId' or 'getTaskLists' (if it existed). It doesn't mention prerequisites, exclusions, or specific contexts, leaving the agent to infer usage from the name alone. This lack of explicit direction reduces its effectiveness in tool selection.

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