getProjectsAllocationsTime
Get time entries for a specific allocation. Filter by date, order, and pagination to return accessible logged hours.
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
| Name | Required | Description | Default |
|---|---|---|---|
| allocationId | Yes | filter by allocation id | |
| updatedAfter | No | filter by updated after date | |
| startDate | No | filter by a starting date | |
| endDate | No | filter by an ending date | |
| orderBy | No | sort order | |
| orderMode | No | order mode | |
| page | No | page number | |
| pageSize | No | number of items in a page | |
| includeTotals | No | include totals | |
| includePermissions | No | include permissions |
Implementation Reference
- The handler function that executes the tool logic. Calls the service layer and formats the response.
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 createErrorResponse(error, 'Getting allocation time entries'); } } - The schema definition including tool name, description, inputSchema, 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)The tool is registered in the toolPairs array in src/tools/index.ts.
{ definition: getAllocationTime, handler: handleGetProjectsAllocationsTime }, - src/tools/index.ts:145-145 (registration)Re-export of the handler from the tools index file.
export { handleGetProjectsAllocationsTime } from './time/getAllocationTime.js'; - The service layer that makes the actual API call to GET /allocations/{allocationId}/time.json via the v3 API client.
interface GetAllocationTimeParams { allocationId: number; updatedAfter?: string; startDate?: string; reportFormat?: string; projectStatus?: 'active' | 'current' | 'late' | 'upcoming' | 'completed' | 'deleted'; orderMode?: 'asc' | 'desc'; orderBy?: 'company' | 'date' | 'dateupdated' | 'project' | 'task' | 'tasklist' | 'user' | 'description' | 'billed' | 'billable' | 'timespent'; invoicedType?: 'all' | 'invoiced' | 'noninvoiced'; endDate?: string; billableType?: 'all' | 'billable' | 'non-billable'; page?: number; pageSize?: number; includeTotals?: boolean; includePermissions?: boolean; } export async function getAllocationTime(params: GetAllocationTimeParams) { const { allocationId, ...queryParams } = params; const api = getApiClientForVersion('v3'); const response = await api.get(`/allocations/${allocationId}/time.json`, { params: queryParams }); return response.data; } export default getAllocationTime;