update_client
Modify client details in Clockify, including name and archive status, to maintain accurate project organization and time tracking records.
Instructions
Update an existing client
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | Workspace ID | |
| clientId | Yes | Client ID | |
| name | No | Client name | |
| archived | No | Whether client is archived |
Implementation Reference
- src/index.ts:1286-1304 (handler)The handler function that implements the core logic of 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}`, and returns a success message with 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:791-793 (registration)The switch case in the CallToolRequest handler that routes calls to the 'update_client' tool to the updateClient method, with parameter validation.case "update_client": if (!args?.workspaceId || !args?.clientId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId and clientId are required'); return await this.updateClient(args as any);
- src/index.ts:580-591 (schema)The tool registration entry that defines the name, description, and input schema (parameters and requirements) for the 'update_client' tool in the ListTools response.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:580-591 (registration)Registration of the 'update_client' tool in the tools list returned by ListToolsRequestHandler.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:51-56 (schema)TypeScript interface defining the structure of a Client object, used in the context of client management tools including update_client.interface Client { id?: string; name: string; workspaceId: string; archived?: boolean; }