update_tag
Modify tag details such as name and archived status within Clockify by specifying workspace and tag IDs, ensuring accurate time entry and project organization.
Instructions
Update an existing tag
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| archived | No | Whether tag is archived | |
| name | No | Tag name | |
| tagId | Yes | Tag ID | |
| workspaceId | Yes | Workspace ID |
Implementation Reference
- src/index.ts:1373-1391 (handler)The handler function that executes the tool logic: extracts parameters, makes a PUT request to Clockify API to update the tag, and returns a success message.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:805-807 (registration)Tool call dispatcher in the CallToolRequestSchema handler that routes to the updateTag method after validation.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);
- src/index.ts:635-648 (registration)Tool registration in the ListToolsRequestSchema response, defining the tool 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:638-647 (schema)Input schema defining parameters for the update_tag tool: workspaceId and tagId required, name and archived optional.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"], },