Skip to main content
Glama

Teamwork MCP

getTasksByProjectId.ts1.55 kB
/** * getTasksByProjectId tool * Retrieves tasks from a specific project in Teamwork */ import logger from "../../utils/logger.js"; import teamworkService from "../../services/index.js"; // Tool definition 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 } }; // Tool handler 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) { logger.error(`Error in getTasksByProjectId handler: ${error.message}`); return { content: [{ type: "text", text: `Error retrieving tasks for project: ${error.message}` }] }; } }

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