Skip to main content
Glama

list_tasks

Retrieve tasks for time tracking with filtering options. Manage task lists by status, update date, or pagination to organize project assignments.

Instructions

Retrieve a list of tasks with optional filtering. Tasks are the building blocks for time tracking and can be assigned to projects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
is_activeNoFilter by active status
updated_sinceNoFilter by tasks updated since this timestamp
pageNoPage number for pagination
per_pageNoNumber of tasks per page (max 2000)

Implementation Reference

  • The ListTasksHandler class handles the execution of the list_tasks tool by validating input and calling the Harvest API.
    class ListTasksHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(TaskQuerySchema, args, 'tasks query');
          logger.info('Listing tasks from Harvest API');
          const tasks = await this.config.harvestClient.getTasks(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(tasks, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'list_tasks');
        }
      }
    }
  • The list_tasks tool is defined and registered with its schema and handler within registerTaskTools.
    {
      tool: {
        name: 'list_tasks',
        description: 'Retrieve a list of tasks with optional filtering. Tasks are the building blocks for time tracking and can be assigned to projects.',
        inputSchema: {
          type: 'object',
          properties: {
            is_active: { type: 'boolean', description: 'Filter by active status' },
            updated_since: { type: 'string', format: 'date-time', description: 'Filter by tasks updated since this timestamp' },
            page: { type: 'number', minimum: 1, description: 'Page number for pagination' },
            per_page: { type: 'number', minimum: 1, maximum: 2000, description: 'Number of tasks per page (max 2000)' },
          },
          additionalProperties: false,
        },
      },
      handler: new ListTasksHandler(config),
    },

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/ianaleck/harvest-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server