get_timeslip
Retrieve a specific timeslip from FreeAgent using its unique ID to access time tracking details for billing or reporting purposes.
Instructions
Get a single timeslip by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Timeslip ID |
Implementation Reference
- src/index.ts:198-204 (handler)Handler for the get_timeslip tool that extracts the ID from arguments and delegates to FreeAgentClient.getTimeslip, returning JSON response.case 'get_timeslip': { const { id } = request.params.arguments as { id: string }; const timeslip = await this.client.getTimeslip(id); return { content: [{ type: 'text', text: JSON.stringify(timeslip, null, 2) }] }; }
- src/index.ts:106-116 (registration)Tool registration in ListTools handler, defining name, description, and input schema requiring 'id'.{ name: 'get_timeslip', description: 'Get a single timeslip by ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Timeslip ID' } }, required: ['id'] } },
- src/freeagent-client.ts:73-82 (helper)Implementation of getTimeslip in FreeAgentClient, performs API GET request to retrieve timeslip by ID.async getTimeslip(id: string): Promise<Timeslip> { try { console.error('[API] Fetching timeslip:', id); const response = await this.axiosInstance.get<TimeslipResponse>(`/timeslips/${id}`); return response.data.timeslip; } catch (error) { console.error('[API] Failed to fetch timeslip:', error); throw error; } }
- src/types.ts:38-40 (schema)Type schemas for API response (TimeslipResponse) and Timeslip object used in getTimeslip.export interface TimeslipResponse { timeslip: Timeslip; }