create_tag
Add custom tags to organize and categorize time entries in Clockify workspaces for better project tracking and reporting.
Instructions
Create a new tag
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | Workspace ID | |
| name | Yes | Tag name | |
| archived | No | Whether tag is archived (optional) |
Implementation Reference
- src/index.ts:1324-1342 (handler)The handler function that implements the core logic for the 'create_tag' tool. It sends a POST request to the Clockify API to create a new tag in the specified workspace and returns a formatted success response with the new tag's ID, name, and archived status.private async createTag(args: any) { const { workspaceId, ...tagData } = args; const tag = await this.makeRequest( `/workspaces/${workspaceId}/tags`, "POST", tagData ); return { content: [ { type: "text", text: `Tag created successfully!\nID: ${tag.id}\nName: ${tag.name}\nArchived: ${tag.archived}`, }, ], isError: false, }; }
- src/index.ts:608-619 (registration)The tool registration entry in the listTools response, defining the name, description, and input schema for the 'create_tag' tool.name: "create_tag", description: "Create a new tag", inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, name: { type: "string", description: "Tag name" }, archived: { type: "boolean", description: "Whether tag is archived (optional)" }, }, required: ["workspaceId", "name"], }, },
- src/index.ts:799-801 (registration)The dispatch logic in the CallToolRequestHandler switch statement that validates input and calls the createTag handler method.case "create_tag": if (!args?.workspaceId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId is required'); return await this.createTag(args as any);
- src/index.ts:610-618 (schema)The input schema defining the parameters for the 'create_tag' tool: workspaceId (required string), name (required string), archived (optional boolean).inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, name: { type: "string", description: "Tag name" }, archived: { type: "boolean", description: "Whether tag is archived (optional)" }, }, required: ["workspaceId", "name"], },