harvest_list_project_assignments
Retrieve project assignments for the current user from Harvest time tracking system, with pagination support for managing large result sets.
Instructions
List project assignments for the current user. Use about {"tool": "harvest_list_project_assignments"} for detailed usage.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number | |
| per_page | No | Results per page (max 100) |
Implementation Reference
- src/index.ts:258-267 (handler)Handler case in the MCP callTool request handler that executes the 'harvest_list_project_assignments' tool by calling the HarvestClient method and returning a formatted text response with JSON data.case 'harvest_list_project_assignments': const projectAssignments = await harvestClient.getProjectAssignments(typedArgs); return { content: [ { type: 'text', text: JSON.stringify(projectAssignments, null, 2), }, ], };
- src/tools.ts:197-207 (schema)Tool schema and definition: specifies name, description, and input schema supporting pagination (page, per_page). This is used for both validation and tool listing.{ name: 'harvest_list_project_assignments', description: 'List project assignments for the current user. Use about {"tool": "harvest_list_project_assignments"} for detailed usage.', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number' }, per_page: { type: 'number', description: 'Results per page (max 100)' } } } },
- src/harvest-client.ts:167-170 (handler)Core implementation logic: the getProjectAssignments method that builds the query parameters and makes the HTTP request to Harvest API endpoint `/users/me/project_assignments` to list the current user's project assignments.async getProjectAssignments(options?: any) { const queryString = this.buildQueryString(options); return this.makeRequest(`/users/me/project_assignments${queryString}`); }
- src/index.ts:69-73 (registration)Registers all tools, including 'harvest_list_project_assignments', with the MCP server via the listTools request handler.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: tools, }; });