update_tag
Modify existing tags in Clockify workspaces to update names or archive status for better time tracking organization.
Instructions
Update an existing tag
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | Workspace ID | |
| tagId | Yes | Tag ID | |
| name | No | Tag name | |
| archived | No | Whether tag is archived |
Implementation Reference
- src/index.ts:1373-1391 (handler)Executes the update_tag tool by sending a PUT request to the Clockify API to update the specified tag with the provided data (name, archived status). Returns a success message with updated tag info.private async updateTag(args: any) { const { workspaceId, tagId, ...updateData } = args; const tag = await this.makeRequest( `/workspaces/${workspaceId}/tags/${tagId}`, "PUT", updateData ); return { content: [ { type: "text", text: `Tag updated successfully!\nName: ${tag.name}\nArchived: ${tag.archived}`, }, ], isError: false, }; }
- src/index.ts:638-647 (schema)Input schema defining parameters for the update_tag tool: requires workspaceId and tagId, optional name and archived.inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, tagId: { type: "string", description: "Tag ID" }, name: { type: "string", description: "Tag name" }, archived: { type: "boolean", description: "Whether tag is archived" }, }, required: ["workspaceId", "tagId"], },
- src/index.ts:636-648 (registration)Tool registration in the list of available tools returned by ListToolsRequest, including name, description, and input schema.name: "update_tag", description: "Update an existing tag", inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, tagId: { type: "string", description: "Tag ID" }, name: { type: "string", description: "Tag name" }, archived: { type: "boolean", description: "Whether tag is archived" }, }, required: ["workspaceId", "tagId"], }, },
- src/index.ts:805-807 (registration)Dispatch handler in the CallToolRequest switch statement that validates inputs and calls the updateTag method.case "update_tag": if (!args?.workspaceId || !args?.tagId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId and tagId are required'); return await this.updateTag(args as any);