Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
allocationIdYesfilter by allocation id
updatedAfterNofilter by updated after date
startDateNofilter by a starting date
endDateNofilter by an ending date
orderByNosort order
orderModeNoorder mode
pageNopage number
pageSizeNonumber of items in a page
includeTotalsNoinclude totals
includePermissionsNoinclude 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
      }
    };
  • The tool is registered in the toolPairs array in src/tools/index.ts.
    { definition: getAllocationTime, handler: handleGetProjectsAllocationsTime },
  • 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; 
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description states 'Get time entries', which indicates a read-only operation, but the annotation readOnlyHint is false, suggesting the tool may modify state. This is a direct contradiction. The description also adds access control context but fails to resolve the inconsistency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short (two sentences) but contains redundancy: the first two sentences essentially repeat the same information. It could be more concise by merging them.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description mentions that only accessible time entries are returned, which is useful. However, it lacks details about the structure of the response, pagination behavior, or how parameters like page and pageSize work, especially since there is no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description does not add additional meaning beyond what the schema provides for each parameter, e.g., it does not explain the format of date strings or the effect of orderBy options.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool retrieves time entries for a specific allocation, using the verb 'Get' and specifying the resource 'time entries for a specific allocation'. This distinguishes it from sibling tools like 'getTime' which likely retrieves all time entries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving time entries related to a specific allocation, but it does not explicitly state when to use this tool versus alternatives (e.g., getTime) or provide any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vizioz/Teamwork-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server