Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

get_projects

Retrieve all projects from a Clockify workspace with filtering options for archived status, name, clients, users, templates, and sorting preferences.

Instructions

Get all projects in a workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYesWorkspace ID
archivedNoFilter by archived status
nameNoFilter by project name
clientIdsNoFilter by client IDs (comma-separated)
containsClientNoFilter projects that have clients
clientStatusNoFilter by client status
usersNoFilter by user IDs (comma-separated)
isTemplateNoFilter by template status
sortColumnNoSort column
sortOrderNoSort order
pageNoPage number (default: 1)
pageSizeNoPage size (default: 50, max: 5000)

Implementation Reference

  • The core handler function for the 'get_projects' tool. It builds query parameters from input args, calls the Clockify API to fetch projects from /workspaces/{workspaceId}/projects, and formats a response listing the projects with name, ID, client, and billable status.
    private async getProjects(args: any) {
      const { workspaceId, ...params } = args;
    
      const queryParams = new URLSearchParams();
      Object.entries(params).forEach(([key, value]) => {
        if (value !== undefined && value !== null) {
          queryParams.append(key, String(value));
        }
      });
    
      const endpoint = queryParams.toString()
        ? `/workspaces/${workspaceId}/projects?${queryParams.toString()}`
        : `/workspaces/${workspaceId}/projects`;
    
      const projects = await this.makeRequest(endpoint);
    
      return {
        content: [
          {
            type: "text",
            text: `Found ${projects.length} project(s):\n${projects
              .map((p: any) => `- ${p.name} (${p.id}) | Client: ${p.clientName || "None"} | Billable: ${p.billable}`)
              .join("\n")}`,
          },
        ],
        isError: false,
      };
    }
  • src/index.ts:408-428 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the name, description, and detailed inputSchema for parameters like workspaceId, filters, sorting, and pagination.
    {
      name: "get_projects",
      description: "Get all projects in a workspace",
      inputSchema: {
        type: "object",
        properties: {
          workspaceId: { type: "string", description: "Workspace ID" },
          archived: { type: "boolean", description: "Filter by archived status" },
          name: { type: "string", description: "Filter by project name" },
          clientIds: { type: "string", description: "Filter by client IDs (comma-separated)" },
          containsClient: { type: "boolean", description: "Filter projects that have clients" },
          clientStatus: { type: "string", enum: ["ACTIVE", "ARCHIVED"], description: "Filter by client status" },
          users: { type: "string", description: "Filter by user IDs (comma-separated)" },
          isTemplate: { type: "boolean", description: "Filter by template status" },
          sortColumn: { type: "string", description: "Sort column" },
          sortOrder: { type: "string", enum: ["ASCENDING", "DESCENDING"], description: "Sort order" },
          page: { type: "number", description: "Page number (default: 1)" },
          pageSize: { type: "number", description: "Page size (default: 50, max: 5000)" },
        },
        required: ["workspaceId"],
      },
  • src/index.ts:755-757 (registration)
    Dispatch logic in the CallToolRequestSchema switch statement that validates workspaceId and invokes the getProjects handler.
      if (!args?.workspaceId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId is required');
      return await this.getProjects(args as any);
    case "get_project":
  • TypeScript interface defining the structure of a Project object, used throughout the codebase for type safety.
    interface Project {
      id?: string;
      name: string;
      clientId?: string;
      workspaceId: string;
      isPublic?: boolean;
      billable?: boolean;
      color?: string;
      estimate?: {
        estimate: string;
        type: "AUTO" | "MANUAL";
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get all projects' but doesn't clarify if this is a read-only operation, whether it requires specific permissions, how pagination works (implied by page/pageSize parameters), or what the output format is. This leaves significant gaps for a tool with 12 parameters and no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (12 parameters, no output schema, and no annotations), the description is insufficient. It doesn't explain the return values, pagination behavior, or error conditions, leaving the agent with incomplete information to use the tool effectively in a real-world context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'in a workspace,' which aligns with the required workspaceId parameter, but adds no further semantic context beyond what the schema provides. With 100% schema description coverage, the baseline is 3, as the schema already documents all parameters thoroughly, and the description doesn't compensate with additional insights like default behaviors or filtering logic.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('projects in a workspace'), making the purpose understandable. However, it doesn't distinguish this tool from its sibling 'get_project' (singular), which appears to fetch a single project rather than all projects, missing an opportunity for explicit differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_project' for single projects or 'get_detailed_report' for more comprehensive data, nor does it specify prerequisites or exclusions, leaving the agent to infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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