Skip to main content
Glama

get-time-report

Generate time tracking reports with filters for date range, person, project, client, department, and billable status. Supports JSON and CSV output.

Instructions

Get time tracking report with various filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateYesStart date for report (YYYY-MM-DD)
end_dateYesEnd date for report (YYYY-MM-DD)
people_idNoFilter by person ID
project_idNoFilter by project ID
client_idNoFilter by client ID
department_idNoFilter by department ID
billableNoFilter by billable status (0=non-billable, 1=billable)
formatNoReport format (default: json)

Implementation Reference

  • The main handler for the 'get-time-report' tool. Calls floatApi.getPaginated('/reports/time', ...) to fetch time tracking report data with filters.
    export const getTimeReport = createTool(
      'get-time-report',
      'Get time tracking report with various filters',
      z.object({
        start_date: z.string().describe('Start date for report (YYYY-MM-DD)'),
        end_date: z.string().describe('End date for report (YYYY-MM-DD)'),
        people_id: z.number().optional().describe('Filter by person ID'),
        project_id: z.number().optional().describe('Filter by project ID'),
        client_id: z.number().optional().describe('Filter by client ID'),
        department_id: z.number().optional().describe('Filter by department ID'),
        billable: z
          .number()
          .optional()
          .describe('Filter by billable status (0=non-billable, 1=billable)'),
        format: z.enum(['json', 'csv']).optional().describe('Report format (default: json)'),
      }),
      async (params) => {
        const response = await floatApi.getPaginated(
          '/reports/time',
          params,
          z.array(
            z.object({
              people_id: z.number().optional(),
              project_id: z.number().optional(),
              task_id: z.number().optional(),
              date: z.string().optional(),
              hours: z.number().optional(),
              billable: z.number().optional(),
              notes: z.string().nullable().optional(),
            })
          )
        );
        return response;
      }
    );
  • Input schema for the get-time-report tool, defining all filter parameters (start_date, end_date, people_id, project_id, client_id, department_id, billable) and format option.
    z.object({
      start_date: z.string().describe('Start date for report (YYYY-MM-DD)'),
      end_date: z.string().describe('End date for report (YYYY-MM-DD)'),
      people_id: z.number().optional().describe('Filter by person ID'),
      project_id: z.number().optional().describe('Filter by project ID'),
      client_id: z.number().optional().describe('Filter by client ID'),
      department_id: z.number().optional().describe('Filter by department ID'),
      billable: z
        .number()
        .optional()
        .describe('Filter by billable status (0=non-billable, 1=billable)'),
      format: z.enum(['json', 'csv']).optional().describe('Report format (default: json)'),
    }),
  • Registration of getTimeReport in the legacyTools array, which is exported and combined with optimizedTools to form the final tools export.
      // Reporting tools
      getTimeReport,
      getProjectReport,
      getPeopleUtilizationReport,
    ];
  • Import of getTimeReport from the reporting module into the tools index file.
    // Reporting tools
    import {
      getTimeReport,
      getProjectReport,
      getPeopleUtilizationReport,
    } from './reporting/reports.js';
  • The createTool helper function that wraps a handler with validation and error handling. Used by getTimeReport to build the tool object with name, description, inputSchema, and handler.
    export const createTool = <T, P extends z.ZodType>(
      name: string,
      description: string,
      schema: P,
      handler: (params: z.infer<P>) => Promise<T>
    ): {
      name: string;
      description: string;
      inputSchema: P;
      handler: (params: unknown) => Promise<ToolResponse<T>>;
    } => {
      return {
        name,
        description,
        inputSchema: schema,
        handler: async (params: unknown): Promise<ToolResponse<T>> => {
          try {
            const validatedParams = schema.parse(params);
            const result = await handler(validatedParams);
    
            // Extract format from params if available
            const responseFormat =
              ((validatedParams as Record<string, unknown>).format as ResponseFormat) || 'json';
    
            return { success: true, data: result, format: responseFormat };
          } catch (error) {
            logger.error(`Error in ${name} tool:`, error);
    
            // Handle Float API errors with enhanced formatting
            if (error instanceof FloatApiError) {
              return FloatErrorHandler.formatErrorForMcp(error) as ToolResponse<T>;
            }
    
            // Handle parameter validation errors
            if (error instanceof z.ZodError) {
              return {
                success: false,
                error: `Parameter validation failed: ${error.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join(', ')}`,
                errorCode: 'PARAMETER_VALIDATION_ERROR',
                details: {
                  validationErrors: error.errors,
                },
              } as ToolResponse<T>;
            }
    
            // Handle other errors
            return {
              success: false,
              error: error instanceof Error ? error.message : 'Unknown error occurred',
              errorCode: 'UNKNOWN_ERROR',
            } as ToolResponse<T>;
          }
        },
      };
    };
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. The description only says 'Get time tracking report with various filters' but does not explain return values, authentication needs, performance implications, or what happens if filters are invalid. This is insufficient transparency.

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

Conciseness3/5

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

The description is brief at five words, which is concise but lacks necessary detail. It could include a sentence on report scope or alternative tools without becoming overly long. A middle score reflects that it is not bloated but is under-specified.

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

Completeness2/5

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

With 8 parameters, no output schema, and no behavioral notes, the description is incomplete. It does not describe the report's format, aggregation level, or constraints (e.g., maximum date range). Given the tool's complexity, the description should provide more context for proper use.

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 description coverage is 100%, so the description does not need to add parameter details. However, the description adds no semantic value beyond 'various filters' – it does not explain how parameters interact or which combinations are typical. Baseline 3 is appropriate given the schema already documents parameters.

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

Purpose3/5

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

The description states it gets a time tracking report with filters, which is clear but vague. It doesn't specify what the report contains (summary, details) or differentiate from siblings like get-billable-time-report or get-project-report, which also generate reports. A more specific verb and resource description would improve clarity.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives. With many sibling tools for reports and filtering (e.g., get-billable-time-report, get-logged-time), the description provides no context for selection or exclusions, leaving the agent to guess.

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/asachs01/float-mcp'

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