Skip to main content
Glama

getTaskListsByProjectId

Retrieve all task lists associated with a specific project ID to organize and manage project tasks.

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

  • Tool handler that validates projectId input, calls the teamwork service to fetch task lists, and returns the result formatted as MCP content.
    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');
      }
    } 
  • Tool definition/schema with name, description, input schema requiring a 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
      }
    };
  • Service/helper function that makes the actual HTTP GET request to Teamwork API endpoint /projects/{projectId}/tasklists.json using the configured API client.
    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}`);
      }
    };
    
    export default getTaskListsByProjectId; 
  • Registration of the tool: imported and paired in the toolPairs array, added to toolHandlersMap, and re-exported.
    import { getTaskListsByProjectIdDefinition as getTaskListsByProjectId, handleGetTaskListsByProjectId } from './tasks/getTaskListsByProjectId.js';
    import { getTaskByIdDefinition as getTaskById, handleGetTaskById } from './tasks/getTaskById.js';
    import { createTaskDefinition as createTask, handleCreateTask } from './tasks/createTask.js';
    import { createSubTaskDefinition as createSubTask, handleCreateSubTask } from './tasks/createSubTask.js';
    import { updateTaskDefinition as updateTask, handleUpdateTask } from './tasks/updateTask.js';
    import { deleteTaskDefinition as deleteTask, handleDeleteTask } from './tasks/deleteTask.js';
    import { getTasksMetricsCompleteDefinition as getTasksMetricsComplete, handleGetTasksMetricsComplete } from './tasks/getTasksMetricsComplete.js';
    import { getTasksMetricsLateDefinition as getTasksMetricsLate, handleGetTasksMetricsLate } from './tasks/getTasksMetricsLate.js';
    import { getTaskSubtasksDefinition as getTaskSubtasks, handleGetTaskSubtasks } from './tasks/getTaskSubtasks.js';
    import { getTaskCommentsDefinition as getTaskComments, handleGetTaskComments } from './tasks/getTaskComments.js';
    
    // Comments
    import { createCommentDefinition as createComment, handleCreateComment } from './comments/createComment.js';
    
    // People
    import { getPeopleDefinition as getPeople, handleGetPeople } from './people/getPeople.js';
    import { getPersonByIdDefinition as getPersonById, handleGetPersonById } from './people/getPersonById.js';
    import { getProjectPeopleDefinition as getProjectPeople, handleGetProjectPeople } from './people/getProjectPeople.js';
    import { addPeopleToProjectDefinition as addPeopleToProject, handleAddPeopleToProject } from './people/addPeopleToProject.js';
    import { deletePersonDefinition as deletePerson, handleDeletePerson } from './people/deletePerson.js';
    import { updatePersonDefinition as updatePerson, handleUpdatePerson } from './people/updatePerson.js';
    
    // Companies
    import { createCompanyDefinition as createCompany, handleCreateCompany } from './companies/createCompany.js';
    import { updateCompanyDefinition as updateCompany, handleUpdateCompany } from './companies/updateCompany.js';
    import { deleteCompanyDefinition as deleteCompany, handleDeleteCompany } from './companies/deleteCompany.js';
    import { getCompaniesDefinition as getCompanies, handleGetCompanies } from './companies/getCompanies.js';
    import { getCompanyByIdDefinition as getCompanyById, handleGetCompanyById } from './companies/getCompanyById.js';
    
    // Reporting
    import { getProjectsPeopleMetricsPerformanceDefinition as getProjectsPeopleMetricsPerformance, handleGetProjectsPeopleMetricsPerformance } from './people/getPeopleMetricsPerformance.js';
    import { getProjectsPeopleUtilizationDefinition as getProjectsPeopleUtilization, handleGetProjectsPeopleUtilization } from './people/getPeopleUtilization.js';
    import { getProjectPersonDefinition as getProjectPerson, handleGetProjectPerson } from './people/getProjectPerson.js';
    import { getProjectsReportingUserTaskCompletionDefinition as getProjectsReportingUserTaskCompletion, handleGetProjectsReportingUserTaskCompletion } from './reporting/getUserTaskCompletion.js';
    import { getProjectsReportingUtilizationDefinition as getProjectsReportingUtilization, handleGetProjectsReportingUtilization } from './people/getUtilization.js';
    
    // Time-related imports
    import { getTimeDefinition as getTime, handleGetTime } from './time/getTime.js';
    import { getProjectsAllocationsTimeDefinition as getAllocationTime, handleGetProjectsAllocationsTime } from './time/getAllocationTime.js';
    
    // Core
    import { getTimezonesDefinition as getTimezones, handleGetTimezones } from './core/getTimezones.js';
    
    // Define a structure that pairs tool definitions with their handlers
    interface ToolPair {
      definition: any;
      handler: Function;
    }
    
    // Create an array of tool pairs
    const toolPairs: ToolPair[] = [
      { definition: getProjects, handler: handleGetProjects },
      { definition: getCurrentProject, handler: handleGetCurrentProject },
      { definition: createProject, handler: handleCreateProject },
      { definition: getTasks, handler: handleGetTasks },
      { definition: getTasksByProjectId, handler: handleGetTasksByProjectId },
      { definition: getTaskListsByProjectId, handler: handleGetTaskListsByProjectId },
  • Tool group registration: 'getTaskListsByProjectId' is listed under the 'Tasks' group in the toolGroups configuration map.
      'Tasks': ['getTasks', 'getTasksByProjectId', 'getTaskListsByProjectId', 'getTaskById', 'createTask', 'createSubTask', 'updateTask', 'deleteTask', 'getTasksMetricsComplete', 'getTasksMetricsLate', 'getTaskSubtasks', 'getTaskComments'],
      'People': ['getPeople', 'getPersonById', 'getProjectPeople', 'addPeopleToProject', 'deletePerson', 'getProjectsPeopleMetricsPerformance', 'getProjectsPeopleUtilization', 'getProjectPerson'],
      'Reporting': ['getProjectsReportingUserTaskCompletion', 'getProjectsReportingUtilization'],
      'Time': ['getTime', 'getProjectsAllocationsTime', 'getTimezones'],
      'Comments': ['createComment'],
      'Companies': ['createCompany', 'updateCompany', 'deleteCompany', 'getCompanies', 'getCompanyById']
    };
Behavior2/5

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

Annotations provide no safety hints (readOnlyHint=false, destructiveHint=false). Description simply restates the function without adding behavioral details like authentication, rate limits, or side effects.

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 with no fluff. Efficiently conveys the core purpose.

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

Completeness2/5

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

No output schema, yet description does not explain return values or any additional context. Simple tool but missing completeness for expected results.

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%, so the description adds no extra meaning. Baseline score of 3 is appropriate as the parameter is well-documented in the schema.

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 (task lists), and scope (by project ID). Distinguishes from sibling tool 'getTasksByProjectId' which returns tasks.

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?

No guidance on when to use this tool versus alternatives. Lacks context about prerequisites or when not to use it.

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