harvest_list_projects
Retrieve and filter projects from Harvest time tracking system to manage project visibility and access client-specific data.
Instructions
List all projects with filtering options. Use about {"tool": "harvest_list_projects"} for detailed parameters and examples.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| is_active | No | Filter by active status | |
| client_id | No | Filter by client ID | |
| page | No | Page number | |
| per_page | No | Results per page (max 100) |
Implementation Reference
- src/index.ts:176-185 (handler)MCP server handler dispatches to HarvestClient.getProjects with tool arguments and formats response as JSON text content.case 'harvest_list_projects': const projects = await harvestClient.getProjects(typedArgs); return { content: [ { type: 'text', text: JSON.stringify(projects, null, 2), }, ], };
- src/tools.ts:105-116 (schema)Tool definition with name, description, and input schema for MCP registration and validation.name: 'harvest_list_projects', description: 'List all projects with filtering options. Use about {"tool": "harvest_list_projects"} for detailed parameters and examples.', inputSchema: { type: 'object', properties: { is_active: { type: 'boolean', description: 'Filter by active status' }, client_id: { type: 'string', description: 'Filter by client ID' }, page: { type: 'number', description: 'Page number' }, per_page: { type: 'number', description: 'Results per page (max 100)' } } } },
- src/harvest-client.ts:117-120 (helper)Core implementation fetches projects from Harvest API endpoint /projects with built query parameters.async getProjects(options?: any) { const queryString = this.buildQueryString(options); return this.makeRequest(`/projects${queryString}`); }
- src/index.ts:69-73 (registration)Registers all tools (including harvest_list_projects) for MCP listTools request handling.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: tools, }; });
- src/harvest-client.ts:59-72 (helper)Utility method builds query string from filter parameters used by getProjects.private buildQueryString(params?: Record<string, any>): string { if (!params) return ''; const queryParams = new URLSearchParams(); Object.entries(params).forEach(([key, value]) => { if (value !== undefined && value !== null) { queryParams.append(key, String(value)); } }); const queryString = queryParams.toString(); return queryString ? `?${queryString}` : ''; }