Skip to main content
Glama

getTaskListsByProjectId

Retrieve all task lists associated with a specific project ID using the Teamwork MCP server to streamline project management workflows.

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 tool handler that processes the input, calls the teamworkService.getTaskListsByProjectId service, formats the response as JSON 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) { logger.error(`Error in getTaskListsByProjectId handler: ${error.message}`); return { content: [{ type: "text", text: `Error retrieving task lists: ${error.message}` }] }; } }
  • The tool definition including name, description, input schema requiring projectId as 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 and handler for inclusion in toolDefinitions and toolHandlersMap.
    { definition: getTaskListsByProjectId, handler: handleGetTaskListsByProjectId },
  • Helper service function that makes the API call to retrieve task lists for a given project ID from Teamwork API.
    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}`); } };
  • Import of the tool definition and handler from the specific tasks file.
    import { getTaskListsByProjectIdDefinition as getTaskListsByProjectId, handleGetTaskListsByProjectId } from './tasks/getTaskListsByProjectId.js';

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