Skip to main content
Glama

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
NameRequiredDescriptionDefault
archivedNoWhether tag is archived (optional)
nameYesTag name
workspaceIdYesWorkspace ID

Implementation Reference

  • 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"], }, },
  • 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"], }, },
  • 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);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ratheesh-aot/clockify-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server