update_client
Modify client details such as name or archive status within a Clockify workspace by specifying the workspace and client ID using this integration tool.
Instructions
Update an existing client
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| archived | No | Whether client is archived | |
| clientId | Yes | Client ID | |
| name | No | Client name | |
| workspaceId | Yes | Workspace ID |
Implementation Reference
- src/index.ts:1286-1304 (handler)The main handler function for the 'update_client' tool. It extracts workspaceId, clientId, and updateData from arguments, makes a PUT request to the Clockify API endpoint `/workspaces/{workspaceId}/clients/{clientId}` with the update data, and returns a success message with the updated client details.private async updateClient(args: any) { const { workspaceId, clientId, ...updateData } = args; const client = await this.makeRequest( `/workspaces/${workspaceId}/clients/${clientId}`, "PUT", updateData ); return { content: [ { type: "text", text: `Client updated successfully!\nName: ${client.name}\nArchived: ${client.archived}`, }, ], isError: false, }; }
- src/index.ts:580-591 (schema)The input schema definition for the 'update_client' tool, registered in the ListTools response. Defines parameters like workspaceId (required), clientId (required), name, and archived.name: "update_client", description: "Update an existing client", inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, clientId: { type: "string", description: "Client ID" }, name: { type: "string", description: "Client name" }, archived: { type: "boolean", description: "Whether client is archived" }, }, required: ["workspaceId", "clientId"], },
- src/index.ts:793-795 (registration)The dispatch/registration in the CallToolRequestSchema handler's switch statement, which validates required params and calls the updateClient method.return await this.updateClient(args as any); case "delete_client": if (!args?.workspaceId || !args?.clientId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId and clientId are required');