Skip to main content
Glama

getUserTimeEntries

Retrieve time entries for a specific user from Clockify. Filter by date range using optional start and end parameters in ISO8601 format.

Instructions

List time entries for a specified user. Optional: start, end (ISO8601).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesUser ID
startNoStart date (ISO8601, optional)
endNoEnd date (ISO8601, optional)

Implementation Reference

  • The handler logic for the 'getUserTimeEntries' tool. It extracts userId, optional start and end dates from arguments, constructs the Clockify API URL for the user's time entries, fetches the data, and returns it as JSON text.
    case "getUserTimeEntries": {
      const {
        userId: targetUserId,
        start,
        end,
      } = request.params.arguments || {};
      if (!targetUserId) {
        throw new Error("userId is required");
      }
      let url = `/workspaces/${workspaceId}/user/${targetUserId}/time-entries`;
      const params = [];
      if (typeof start === "string" && start)
        params.push(`start=${encodeURIComponent(start)}`);
      if (typeof end === "string" && end)
        params.push(`end=${encodeURIComponent(end)}`);
      if (params.length) url += `?${params.join("&")}`;
      const entries = await clockifyFetch(url);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(entries, null, 2),
          },
        ],
      };
    }
  • The input schema and description for the 'getUserTimeEntries' tool, defined in the listToolsHandler response.
      name: "getUserTimeEntries",
      description:
        "List time entries for a specified user. Optional: start, end (ISO8601).",
      inputSchema: {
        type: "object",
        properties: {
          userId: { type: "string", description: "User ID" },
          start: {
            type: "string",
            description: "Start date (ISO8601, optional)",
          },
          end: {
            type: "string",
            description: "End date (ISO8601, optional)",
          },
        },
        required: ["userId"],
      },
    },
  • Helper function used by the handler to make authenticated API calls to Clockify, including error handling.
    async function clockifyFetch(endpoint: string, options: RequestInit = {}) {
      const apiKey = getApiKey();
      const baseUrl = "https://api.clockify.me/api/v1";
      const url = endpoint.startsWith("http") ? endpoint : `${baseUrl}${endpoint}`;
      const headers = {
        "X-Api-Key": apiKey,
        "Content-Type": "application/json",
        ...(options.headers || {}),
      };
      const response = await fetch(url, { ...options, headers });
    
      if (!response.ok) {
        const text = await response.text();
        console.error(
          `[Error] Clockify API ${url} failed: ${response.status} ${text}`,
        );
        throw new Error(`Clockify API error: ${response.status} ${text}`);
      }
      return response.json();
    }
  • src/index.ts:43-43 (registration)
    Registration of the listToolsHandler, which exposes the tool schema including getUserTimeEntries.
    server.setRequestHandler(ListToolsRequestSchema, listToolsHandler);
  • src/index.ts:49-49 (registration)
    Registration of the callToolHandler, which dispatches to the getUserTimeEntries case.
    server.setRequestHandler(CallToolRequestSchema, callToolHandler);
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool lists time entries and mentions optional date parameters, but it doesn't disclose behavioral traits such as pagination, rate limits, authentication needs, error handling, or what the return format looks like. For a read operation with no annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is concise and front-loaded: the first sentence states the core purpose, and the second adds optional parameter details. Every sentence earns its place with no wasted words, making it efficient and easy to parse.

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?

Given the complexity (a read operation with 3 parameters) and lack of annotations and output schema, the description is incomplete. It doesn't explain return values, error cases, or behavioral constraints, which are crucial for an AI agent to use the tool correctly. The description should provide more context to compensate for the missing structured data.

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 schema already documents all parameters (userId, start, end) with descriptions. The description adds minimal value by noting that start and end are optional and in ISO8601 format, but this is redundant with the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 the tool's purpose: 'List time entries for a specified user.' It specifies the verb ('List'), resource ('time entries'), and target ('specified user'), making the function unambiguous. However, it doesn't distinguish this tool from its sibling 'getTimeEntries' (which likely lists all time entries vs. user-specific), missing full differentiation.

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 by mentioning 'for a specified user,' suggesting this is for user-specific queries, but it doesn't explicitly state when to use this tool versus alternatives like 'getTimeEntries' or 'getUserTimeEntriesByName.' No guidance on prerequisites, exclusions, or specific contexts is provided, leaving usage somewhat inferred.

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/inakianduaga/clockify-mcp'

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