Skip to main content
Glama

get_clients

Retrieve all clients within a Clockify workspace by specifying filters like name, archived status, and pagination. Streamlines workspace client management and organization.

Instructions

Get all clients in a workspace

Input Schema

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

Implementation Reference

  • The handler function for the 'get_clients' tool. It constructs the API endpoint for fetching clients from a Clockify workspace, applies optional query parameters for filtering (archived, name, pagination), calls the makeRequest helper, and formats the response as a textual list of clients.
    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:564-578 (registration)
    Tool registration in the ListTools handler, defining the name, description, and input schema for 'get_clients'.
    { 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"], }, },
  • src/index.ts:788-790 (registration)
    Dispatch logic in the CallToolRequestSchema handler that routes 'get_clients' calls 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);
  • TypeScript interface defining the structure of a Client object, used in the codebase for type safety with API responses.
    interface Client { id?: string; name: string; workspaceId: string; archived?: boolean; }

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