Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

get_clients

Retrieve all client records from a Clockify workspace, with options to filter by archived status, name, and paginate results for efficient management.

Instructions

Get all clients in a workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYesWorkspace ID
archivedNoFilter by archived status
nameNoFilter by client name
pageNoPage number (default: 1)
pageSizeNoPage size (default: 50, max: 5000)

Implementation Reference

  • The main handler function for the 'get_clients' tool. It constructs a query to the Clockify API endpoint `/workspaces/{workspaceId}/clients` with optional filters (archived, name, page, pageSize), fetches the clients, and returns a formatted text response listing them.
    private async getClients(args: any) {
      const { workspaceId, ...params } = args;
    
      const queryParams = new URLSearchParams();
      Object.entries(params).forEach(([key, value]) => {
        if (value !== undefined && value !== null) {
          queryParams.append(key, String(value));
        }
      });
    
      const endpoint = queryParams.toString()
        ? `/workspaces/${workspaceId}/clients?${queryParams.toString()}`
        : `/workspaces/${workspaceId}/clients`;
    
      const clients = await this.makeRequest(endpoint);
    
      return {
        content: [
          {
            type: "text",
            text: `Found ${clients.length} client(s):\n${clients
              .map((c: any) => `- ${c.name} (${c.id}) | Archived: ${c.archived}`)
              .join("\n")}`,
          },
        ],
        isError: false,
      };
    }
  • src/index.ts:788-790 (registration)
    Registration of the 'get_clients' tool handler in the CallToolRequestSchema switch statement, which dispatches to the getClients method.
    case "get_clients":
      if (!args?.workspaceId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId is required');
      return await this.getClients(args as any);
  • Tool schema definition including name, description, and input schema registered in the ListToolsRequestSchema response.
    {
      name: "get_clients",
      description: "Get all clients in a workspace",
      inputSchema: {
        type: "object",
        properties: {
          workspaceId: { type: "string", description: "Workspace ID" },
          archived: { type: "boolean", description: "Filter by archived status" },
          name: { type: "string", description: "Filter by client name" },
          page: { type: "number", description: "Page number (default: 1)" },
          pageSize: { type: "number", description: "Page size (default: 50, max: 5000)" },
        },
        required: ["workspaceId"],
      },
    },
  • TypeScript interface defining the Client object structure used by the get_clients tool.
    interface Client {
      id?: string;
      name: string;
      workspaceId: string;
      archived?: boolean;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions retrieving 'all clients' but doesn't clarify if this includes archived clients by default, how pagination works with the page/pageSize parameters, or what the response format looks like. This leaves significant gaps for a tool with 5 parameters.

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 a single, efficient sentence that gets straight to the point without unnecessary words. It's perfectly front-loaded and wastes no space, making it easy to parse quickly.

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?

For a tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the filtering behavior (archived/name), pagination details, or what the return data looks like. The agent would need to guess about important behavioral 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 all parameters are documented in the schema itself. The description doesn't add any meaningful information about parameters beyond implying workspace context, which the schema already covers with workspaceId. This meets 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 ('Get') and resource ('all clients in a workspace'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_workspace_users' or 'get_projects' that also retrieve workspace-related data, which prevents a perfect score.

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 'get_workspace_users' or 'get_projects', nor does it mention prerequisites such as needing workspace access. It only states what the tool does, not when it's appropriate.

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

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