Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

create_client

Add a new client to your Clockify workspace to organize projects and track time for specific customers or departments.

Instructions

Create a new client

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYesWorkspace ID
nameYesClient name
archivedNoWhether client is archived (optional)

Implementation Reference

  • The handler method that implements the create_client tool. It extracts workspaceId and client data from arguments, makes a POST request to the Clockify API endpoint /workspaces/{workspaceId}/clients, and returns a success message with the created client's details.
    private async createClient(args: any) {
      const { workspaceId, ...clientData } = args;
    
      const client = await this.makeRequest(
        `/workspaces/${workspaceId}/clients`,
        "POST",
        clientData
      );
    
      return {
        content: [
          {
            type: "text",
            text: `Client created successfully!\nID: ${client.id}\nName: ${client.name}\nArchived: ${client.archived}`,
          },
        ],
        isError: false,
      };
    }
  • src/index.ts:552-562 (registration)
    Registration of the create_client tool in the ListToolsRequestSchema handler, including the tool name, description, and input schema definition.
    name: "create_client",
    description: "Create a new client",
    inputSchema: {
      type: "object",
      properties: {
        workspaceId: { type: "string", description: "Workspace ID" },
        name: { type: "string", description: "Client name" },
        archived: { type: "boolean", description: "Whether client is archived (optional)" },
      },
      required: ["workspaceId", "name"],
    },
  • src/index.ts:785-787 (registration)
    Dispatch registration in the CallToolRequestSchema switch statement that routes create_client calls to the createClient handler method.
    case "create_client":
      if (!args?.workspaceId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId is required');
      return await this.createClient(args as any);
  • TypeScript interface defining the structure of a Client object used in the codebase.
    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