Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

delete_client

Remove a client from your Clockify workspace to maintain accurate project organization and time tracking records.

Instructions

Delete a client

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYesWorkspace ID
clientIdYesClient ID

Implementation Reference

  • The handler function that performs the DELETE request to the Clockify API endpoint for deleting a client and returns a success message.
    private async deleteClient(workspaceId: string, clientId: string) {
      await this.makeRequest(
        `/workspaces/${workspaceId}/clients/${clientId}`,
        "DELETE"
      );
    
      return {
        content: [
          {
            type: "text",
            text: `Client ${clientId} deleted successfully!`,
          },
        ],
        isError: false,
      };
    }
  • Input schema defining the required parameters: workspaceId and clientId for the delete_client tool.
    inputSchema: {
      type: "object",
      properties: {
        workspaceId: { type: "string", description: "Workspace ID" },
        clientId: { type: "string", description: "Client ID" },
      },
      required: ["workspaceId", "clientId"],
    },
  • src/index.ts:593-604 (registration)
    Registration of the delete_client tool in the list of tools returned by ListToolsRequestHandler, including name, description, and schema.
    {
      name: "delete_client",
      description: "Delete a client",
      inputSchema: {
        type: "object",
        properties: {
          workspaceId: { type: "string", description: "Workspace ID" },
          clientId: { type: "string", description: "Client ID" },
        },
        required: ["workspaceId", "clientId"],
      },
    },
  • src/index.ts:794-796 (registration)
    Dispatch case in the CallToolRequestHandler switch statement that validates arguments and calls the deleteClient handler method.
    case "delete_client":
      if (!args?.workspaceId || !args?.clientId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId and clientId are required');
      return await this.deleteClient(args.workspaceId as string, args.clientId as string);
  • TypeScript interface defining the Client object structure used in the codebase.
    interface Client {
      id?: string;
      name: string;
      workspaceId: string;
      archived?: boolean;
    }

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