get_task
Retrieve a specific task by its ID to access complete details including billing settings and activity status.
Instructions
Retrieve a specific task by its ID. Returns complete task details including default billing settings and activity status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The ID of the task to retrieve |
Implementation Reference
- src/tools/tasks.ts:38-56 (handler)The handler implementation for the 'get_task' tool.
class GetTaskHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const inputSchema = z.object({ task_id: z.number().int().positive() }); const { task_id } = validateInput(inputSchema, args, 'get task'); logger.info('Fetching task from Harvest API', { taskId: task_id }); const task = await this.config.harvestClient.getTask(task_id); return { content: [{ type: 'text', text: JSON.stringify(task, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'get_task'); } } } - src/tools/tasks.ts:133-147 (registration)Registration of the 'get_task' tool.
{ tool: { name: 'get_task', description: 'Retrieve a specific task by its ID. Returns complete task details including default billing settings and activity status.', inputSchema: { type: 'object', properties: { task_id: { type: 'number', description: 'The ID of the task to retrieve' }, }, required: ['task_id'], additionalProperties: false, }, }, handler: new GetTaskHandler(config), },