Skip to main content
Glama

list_projects

Retrieve and filter projects from Harvest time tracking with options for client, active status, and update date. Returns paginated results with detailed project information.

Instructions

Retrieve a list of projects with optional filtering by client, active status, and updated date. Returns paginated results with comprehensive project details.

Input Schema

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

Implementation Reference

  • The ListProjectsHandler class implements the logic to list projects by calling the Harvest API.
    class ListProjectsHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(ProjectQuerySchema, args, 'project query');
          logger.info('Listing projects from Harvest API');
          const projects = await this.config.harvestClient.getProjects(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(projects, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'list_projects');
        }
      }
    }
  • The list_projects tool is registered in the registerProjectTools function, including its input schema and handler mapping.
    {
      tool: {
        name: 'list_projects',
        description: 'Retrieve a list of projects with optional filtering by client, active status, and updated date. Returns paginated results with comprehensive project details.',
        inputSchema: {
          type: 'object',
          properties: {
            is_active: { type: 'boolean', description: 'Filter by active status' },
            client_id: { type: 'number', description: 'Filter by client ID' },
            updated_since: { type: 'string', format: 'date-time', description: 'Filter by projects 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 projects per page (max 2000)' },
          },
          additionalProperties: false,
        },
      },
      handler: new ListProjectsHandler(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