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
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | Workspace ID | |
| name | Yes | Client name | |
| archived | No | Whether client is archived (optional) |
Implementation Reference
- src/index.ts:1237-1255 (handler)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);
- src/index.ts:51-56 (schema)TypeScript interface defining the structure of a Client object used in the codebase.interface Client { id?: string; name: string; workspaceId: string; archived?: boolean; }