Skip to main content
Glama

get_projects

Retrieve and filter projects within a specific workspace using filters like archived status, project name, client IDs, user IDs, and sorting options to streamline project management on the Clockify MCP Server.

Instructions

Get all projects in a workspace

Input Schema

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

Implementation Reference

  • The handler function for the 'get_projects' tool. It constructs the API endpoint for fetching projects from a Clockify workspace with optional query parameters, calls the makeRequest method, and returns a formatted text list of projects.
    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, }; }
  • Input schema defining parameters for the 'get_projects' tool, including required workspaceId and optional filters for projects.
    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)" }, },
  • src/index.ts:409-429 (registration)
    Registers the 'get_projects' tool in the ListToolsRequestSchema response, including name, description, and schema.
    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:754-756 (registration)
    Registers the handler dispatch for 'get_projects' in the CallToolRequestSchema switch statement.
    case "get_projects": if (!args?.workspaceId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId is required'); return await this.getProjects(args as any);
  • TypeScript interface defining the Project data structure used in the tool's responses.
    interface Project { id?: string; name: string; clientId?: string; workspaceId: string; isPublic?: boolean; billable?: boolean; color?: string; estimate?: { estimate: string; type: "AUTO" | "MANUAL"; }; }

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