Skip to main content
Glama

create-logged-time

Create a logged time entry to track work hours by specifying person, project, date, and hours. Optionally add task, billable status, and notes for detailed time tracking.

Instructions

Create a new logged time entry for tracking work hours

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
people_idYesThe person ID who logged the time
project_idYesThe project ID for the logged time
task_idNoThe task ID for the logged time
dateYesThe date for the logged time (YYYY-MM-DD)
hoursYesThe number of hours logged
billableNoWhether the time is billable (1 = billable, 0 = non-billable)
notesNoOptional notes describing the work done
reference_dateNoReference date for UI suggestions

Implementation Reference

  • Primary handler for the 'create-logged-time' tool. Defines the tool via createTool() with the name 'create-logged-time', specifies the input schema (people_id, project_id, task_id, date, hours, billable, notes, reference_date), and implements the handler which POSTs to '/logged-time' via floatApi and validates the response against loggedTimeSchema.
    // Create new logged time entry
    export const createLoggedTime = createTool(
      'create-logged-time',
      'Create a new logged time entry for tracking work hours',
      z.object({
        people_id: z.union([z.string(), z.number()]).describe('The person ID who logged the time'),
        project_id: z.union([z.string(), z.number()]).describe('The project ID for the logged time'),
        task_id: z.string().optional().describe('The task ID for the logged time'),
        date: z.string().describe('The date for the logged time (YYYY-MM-DD)'),
        hours: z.number().describe('The number of hours logged'),
        billable: z
          .union([z.string(), z.number()])
          .optional()
          .describe('Whether the time is billable (1 = billable, 0 = non-billable)'),
        notes: z.string().optional().describe('Optional notes describing the work done'),
        reference_date: z.string().optional().describe('Reference date for UI suggestions'),
      }),
      async (params) => {
        const loggedTime = await floatApi.post('/logged-time', params, loggedTimeSchema);
        return loggedTime;
      }
    );
  • The response/validation schema (loggedTimeSchema) that defines the shape of a logged time entry as returned by the Float API. Used by the handler to validate the API response from POST /logged-time.
    export const loggedTimeSchema = z.object({
      logged_time_id: z.string().optional(), // Hexadecimal ID from Float API
      people_id: z.number().optional(), // Person who logged the time
      project_id: z.number().optional(), // Project the time was logged against
      task_id: z.string().nullable().optional(), // Task the time was logged against
      date: z.string().nullable().optional(), // Date the time was logged (YYYY-MM-DD)
      hours: z.number().nullable().optional(), // Hours logged
      billable: z.number().nullable().optional(), // 1 = billable, 0 = non-billable
      notes: z.string().nullable().optional(), // Optional notes describing the work
      reference_date: z.string().nullable().optional(), // Reference date for UI suggestions
      locked: z.number().nullable().optional(), // 1 = locked, 0 = unlocked
      created: z.string().nullable().optional(), // Float API uses 'created', not 'created_at'
      modified: z.string().nullable().optional(), // Float API uses 'modified', not 'updated_at'
      created_by: z.number().nullable().optional(), // User ID who created the entry
      modified_by: z.number().nullable().optional(), // User ID who last modified the entry
    });
  • The 'create-logged-time' tool (exported as createLoggedTime) is imported from the logged-time module and included in the legacyTools array (line 302) and subsequently in the tools/allTools arrays (lines 319, 322) for registration with the MCP server.
    import {
      listLoggedTime,
      getLoggedTime,
      createLoggedTime,
      updateLoggedTime,
      deleteLoggedTime,
      bulkCreateLoggedTime,
      getPersonLoggedTimeSummary,
      getProjectLoggedTimeSummary,
      getLoggedTimeTimesheet,
      getBillableTimeReport,
    } from './time-management/logged-time.js';
  • Input schema (Zod object) for the 'create-logged-time' tool defining the required and optional parameters accepted by the tool.
    z.object({
      people_id: z.union([z.string(), z.number()]).describe('The person ID who logged the time'),
      project_id: z.union([z.string(), z.number()]).describe('The project ID for the logged time'),
      task_id: z.string().optional().describe('The task ID for the logged time'),
      date: z.string().describe('The date for the logged time (YYYY-MM-DD)'),
      hours: z.number().describe('The number of hours logged'),
      billable: z
        .union([z.string(), z.number()])
        .optional()
        .describe('Whether the time is billable (1 = billable, 0 = non-billable)'),
      notes: z.string().optional().describe('Optional notes describing the work done'),
      reference_date: z.string().optional().describe('Reference date for UI suggestions'),
    }),
  • The createTool helper function used to define tools. It takes a name, description, Zod schema, and handler function. It wraps the handler with parameter validation and standardized error handling (wrapping results in ToolResponse with success/error fields).
    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, and the description only states that it creates an entry. It does not disclose behavioral traits such as whether it requires authentication, what happens on success (e.g., returns the created entry), or any side effects.

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 a single short sentence with no wasted words. However, it is too minimal and lacks depth, though it is efficiently structured.

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?

Without an output schema, the description should explain what the tool returns (e.g., the created entry ID). It does not. Additionally, no annotations are present, leaving gaps in understanding for this multi-parameter creation tool.

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 baseline is 3. The description adds minimal extra context ('for tracking work hours'), but does not clarify parameter semantics beyond what the schema already provides.

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

Purpose4/5

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

The description clearly states it creates a logged time entry for tracking work hours, which is a specific verb+resource. Among siblings, there is a bulk-create variant, implying this is for single entries, but no explicit differentiation.

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 its siblings like bulk-create-logged-time or update-logged-time. The description does not mention prerequisites or context for use.

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