get_hours
Retrieve timesheet hours data from Simplicate business management system to track and analyze work time records for projects and tasks.
Instructions
Retrieve timesheet hours
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_hours"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No |
Implementation Reference
- src/mcp/server.ts:289-302 (handler)Handler logic for the 'get_hours' tool call. It invokes the SimplicateService.getHours method with optional limit and offset parameters, then returns the hours data as a JSON-formatted text response.
case 'get_hours': { const hours = await this.simplicateService.getHours({ limit: (toolArgs.limit as number) || 10, offset: (toolArgs.offset as number) || 0, }); return { content: [ { type: 'text', text: JSON.stringify(hours, null, 2), }, ], }; } - src/mcp/server.ts:130-146 (registration)Tool registration entry for 'get_hours' in the ListToolsRequestSchema handler, including name, description, and input schema definition.
{ name: 'get_hours', description: 'Retrieve timesheet hours from Simplicate', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of hour entries to return (default: 10)', }, offset: { type: 'number', description: 'Number of hour entries to skip (for pagination)', }, }, }, }, - src/simplicate/services.ts:44-57 (schema)TypeScript interface defining the structure of SimplicateHours objects returned by the getHours service method.
export interface SimplicateHours { id: string; employee?: { id: string; name: string; }; project?: { id: string; name: string; }; hours: number; start_date: string; note?: string; } - src/simplicate/services.ts:113-116 (helper)Core service method that performs the HTTP GET request to the Simplicate '/hours/hours' API endpoint to retrieve hours data, applying optional pagination parameters.
async getHours(params?: { limit?: number; offset?: number }): Promise<SimplicateHours[]> { const response = await this.client.get('/hours/hours', params); return response.data || []; }