Skip to main content
Glama

getProjectsAllocationsTime

Retrieve logged time entries for a specific project allocation in Teamwork. Filter by date ranges, sort options, and access permissions to track work 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 main handler function for the getProjectsAllocationsTime MCP tool. It calls the underlying service and formats the response as text content or handles errors.
    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 tool definition including name, description, input schema, and annotations for the getProjectsAllocationsTime tool.
    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 registration of the getProjectsAllocationsTime tool in the central toolPairs array, linking its definition and handler.
    { definition: getAllocationTime, handler: handleGetProjectsAllocationsTime },
  • Import of the tool definition and handler from the implementation file.
    import { getProjectsAllocationsTimeDefinition as getAllocationTime, handleGetProjectsAllocationsTime } from './time/getAllocationTime.js';
  • Re-export of the handler for use elsewhere.
    export { handleGetProjectsAllocationsTime } from './time/getAllocationTime.js';

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