Skip to main content
Glama

getTasksByTaskListId

Retrieve all tasks from a specific task list ID in Teamwork, with options for pagination and including completed tasks, using the Teamwork MCP server.

Instructions

Get all tasks from a specific task list in Teamwork

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeCompletedTasksNoInclude completed tasks in the results
pageNoPage number for pagination
pageSizeNoNumber of items per page
tasklistIdYesThe ID of the task list to get tasks from

Implementation Reference

  • The main handler function that executes the tool logic: extracts input parameters, builds query params, calls the Teamwork API to get tasks from the specified tasklist, and returns the response or error.
    export async function handleGetTasksByTaskListId(input: any) { try { const { tasklistId, page, pageSize, includeCompletedTasks, ...otherParams } = input; logger.info(`Getting tasks for task list ID: ${tasklistId}`); // Build query parameters const queryParams: Record<string, any> = { page, pageSize, includeCompletedTasks, ...otherParams }; // Filter out undefined values Object.keys(queryParams).forEach(key => queryParams[key] === undefined && delete queryParams[key] ); // Make API call const apiClient = getApiClientForVersion(); const response = await apiClient.get( `/tasklists/${tasklistId}/tasks.json`, { params: queryParams } ); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] }; } catch (error: any) { logger.error(`Error in getTasksByTaskListId handler: ${error.message}`); return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } }
  • The tool's definition object, including name, description, input schema for parameters like tasklistId, page, etc., and annotations.
    export const getTasksByTaskListIdDefinition = { name: "getTasksByTaskListId", description: "Get all tasks from a specific task list in Teamwork", inputSchema: { type: "object", properties: { tasklistId: { type: "integer", description: "The ID of the task list to get tasks from" }, page: { type: "integer", description: "Page number for pagination" }, pageSize: { type: "integer", description: "Number of items per page" }, includeCompletedTasks: { type: "boolean", description: "Include completed tasks in the results" } }, required: ["tasklistId"] }, annotations: { title: "Get Tasks by Task List ID", readOnlyHint: false, destructiveHint: false, openWorldHint: false } };
  • The tool is registered in the central toolPairs array in index.ts, which is used to build toolDefinitions and toolHandlersMap for the MCP server.
    { definition: getTasksByTaskListId, handler: handleGetTasksByTaskListId },

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