Skip to main content
Glama

getTimeEntries

Retrieve logged work hours from Clockify for a specified date range using ISO8601 format parameters.

Instructions

List time entries for the authenticated user. Optional: start, end (ISO8601).

Input Schema

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

Implementation Reference

  • Implements the getTimeEntries tool by fetching the current user's time entries from the Clockify API, optionally filtered by start and end dates, and returns them as JSON.
    case "getTimeEntries": {
      const { start, end } = request.params.arguments || {};
      let url = `/workspaces/${workspaceId}/user/${userId}/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),
          },
        ],
      };
    }
  • Defines the tool name, description, and input schema for getTimeEntries in the listToolsHandler response.
    {
      name: "getTimeEntries",
      description:
        "List time entries for the authenticated user. Optional: start, end (ISO8601).",
      inputSchema: {
        type: "object",
        properties: {
          start: {
            type: "string",
            description: "Start date (ISO8601, optional)",
          },
          end: {
            type: "string",
            description: "End date (ISO8601, optional)",
          },
        },
        required: [],
      },
    },
  • src/index.ts:43-43 (registration)
    Registers the listToolsHandler which includes the getTimeEntries tool definition.
    server.setRequestHandler(ListToolsRequestSchema, listToolsHandler);
  • src/index.ts:49-49 (registration)
    Registers the callToolHandler which dispatches to the getTimeEntries implementation.
    server.setRequestHandler(CallToolRequestSchema, callToolHandler);
  • Helper function used by getTimeEntries handler to make authenticated API calls to Clockify.
    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();
    }
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 it lists time entries for the authenticated user, implying a read-only operation, but doesn't disclose behavioral traits such as authentication requirements, rate limits, pagination, or error handling. This leaves significant gaps in understanding how the tool behaves.

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 concise and front-loaded, stating the main purpose in the first sentence and adding parameter details in the second. There's no wasted text, making it efficient, though it could be slightly more structured for clarity.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the return values look like (e.g., format, fields), authentication needs, or error cases. For a tool with no structured support, this leaves the agent under-informed about critical usage aspects.

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?

The schema description coverage is 100%, so the input schema already documents both parameters with descriptions. The description adds minimal value by mentioning the parameters are optional and in ISO8601 format, but this doesn't go beyond what the schema provides, aligning with the baseline for high schema coverage.

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 verb ('List') and resource ('time entries for the authenticated user'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'getUserTimeEntries' or 'getUserTimeEntriesByName', which appear similar, so it doesn't fully distinguish from alternatives.

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?

The description provides no guidance on when to use this tool versus alternatives like 'getUserTimeEntries' or 'getUserTimeEntriesByName'. It mentions optional parameters but doesn't specify contexts or exclusions for usage, leaving the agent with minimal direction.

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