getProjectsAllocationsTime
Retrieve time entries for a specific allocation with filters such as date range, sorting, and pagination. Access only the entries you have permission to view in Teamwork projects.
Instructions
Get time entries for a specific allocation. Return logged time entries for a specific allocation. Only the time entries that the logged-in user can access will be returned.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| allocationId | Yes | filter by allocation id | |
| endDate | No | filter by an ending date | |
| includePermissions | No | include permissions | |
| includeTotals | No | include totals | |
| orderBy | No | sort order | |
| orderMode | No | order mode | |
| page | No | page number | |
| pageSize | No | number of items in a page | |
| startDate | No | filter by a starting date | |
| updatedAfter | No | filter by updated after date |
Implementation Reference
- The handler function for the 'getProjectsAllocationsTime' tool. It calls the underlying service with the input parameters and returns the JSON-formatted response or an error message.export async function handleGetProjectsAllocationsTime(input: any) { try { const response = await getAllocationTimeService(input); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } }
- The tool definition including name, description, input schema, and annotations.export const getProjectsAllocationsTimeDefinition = { name: "getProjectsAllocationsTime", description: "Get time entries for a specific allocation. Return logged time entries for a specific allocation. Only the time entries that the logged-in user can access will be returned.", inputSchema: { type: 'object', properties: { allocationId: { type: 'integer', description: 'filter by allocation id' }, updatedAfter: { type: 'string', description: 'filter by updated after date' }, startDate: { type: 'string', description: 'filter by a starting date' }, endDate: { type: 'string', description: 'filter by an ending date' }, orderBy: { type: 'string', description: 'sort order', enum: [ 'company', 'date', 'dateupdated', 'project', 'task', 'tasklist', 'user', 'description', 'billed', 'billable', 'timespent' ] }, orderMode: { type: 'string', description: 'order mode', enum: [ 'asc', 'desc' ] }, page: { type: 'integer', description: 'page number' }, pageSize: { type: 'integer', description: 'number of items in a page' }, includeTotals: { type: 'boolean', description: 'include totals' }, includePermissions: { type: 'boolean', description: 'include permissions' } }, required: ['allocationId'] }, annotations: { title: "Get Time Entries for a Specific Allocation", readOnlyHint: false, destructiveHint: false, openWorldHint: false } };
- src/tools/index.ts:96-96 (registration)Registration of the tool in the central toolPairs array, associating the definition and handler for use in toolDefinitions and toolHandlersMap.{ definition: getAllocationTime, handler: handleGetProjectsAllocationsTime },
- src/tools/index.ts:53-53 (registration)Import of the tool definition and handler from the specific implementation file.import { getProjectsAllocationsTimeDefinition as getAllocationTime, handleGetProjectsAllocationsTime } from './time/getAllocationTime.js';