create_tag
Create a new tag in Clockify by specifying a workspace ID and tag name, with an optional archived status, to enhance task organization and time tracking.
Instructions
Create a new tag
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| archived | No | Whether tag is archived (optional) | |
| name | Yes | Tag name | |
| workspaceId | Yes | Workspace ID |
Implementation Reference
- src/index.ts:1324-1342 (handler)The main handler function for the 'create_tag' tool. It extracts workspaceId and tag data from arguments, makes a POST request to Clockify API endpoint `/workspaces/{workspaceId}/tags`, and returns a success message with the created tag details.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)Registration of the 'create_tag' tool in the list of tools provided to ListToolsRequestSchema, including its name, description, and input schema.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:608-619 (schema)Input schema definition for the 'create_tag' tool, specifying required workspaceId and name, optional archived boolean.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 (handler)Dispatch handler in the CallToolRequestSchema that validates workspaceId and delegates to the createTag method.case "create_tag": if (!args?.workspaceId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId is required'); return await this.createTag(args as any);