Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

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

Implementation Reference

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

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