Skip to main content
Glama

getTasksByTaskListId

Retrieve all tasks from a specific task list in Teamwork projects, with options for pagination and including completed items.

Instructions

Get all tasks from a specific task list in Teamwork

Input Schema

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

Implementation Reference

  • The handler function that executes the tool: fetches tasks from the specified tasklist ID via API, supports pagination and filters, returns JSON 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) { return createErrorResponse(error, 'Retrieving tasks by task list'); } }
  • Tool definition object containing the name, description, input schema (with tasklistId required, optional pagination and filters), 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 } };
  • Registers the tool in the toolPairs array, mapping definition to handler for inclusion in toolDefinitions and toolHandlersMap.
    { 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