list_tasks
Retrieve available tasks for a specific Harvest project to facilitate accurate time tracking and reporting.
Instructions
List available tasks for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID |
Implementation Reference
- src/index.ts:399-412 (handler)Handler function for the 'list_tasks' tool. It takes a project_id, fetches task assignments from the Harvest API, and returns a JSON-formatted list of tasks with their IDs and names.case 'list_tasks': { const { project_id } = request.params.arguments as { project_id: number }; const response = await this.axiosInstance.get(`/projects/${project_id}/task_assignments`); return { content: [ { type: 'text', text: JSON.stringify(response.data.task_assignments.map((t: { task: { id: number; name: string } }) => ({ id: t.task.id, name: t.task.name, })), null, 2), }, ], };
- src/index.ts:288-301 (registration)Registration of the 'list_tasks' tool in the ListToolsRequestHandler, including its name, description, and input schema requiring a project_id.{ name: 'list_tasks', description: 'List available tasks for a project', inputSchema: { type: 'object', properties: { project_id: { type: 'number', description: 'Project ID', }, }, required: ['project_id'], }, },
- src/index.ts:291-301 (schema)Input schema definition for the 'list_tasks' tool, specifying an object with a required numeric project_id.inputSchema: { type: 'object', properties: { project_id: { type: 'number', description: 'Project ID', }, }, required: ['project_id'], }, },