Skip to main content
Glama
projects.ts1.09 kB
import { projectsService } from "../clockify-sdk/projects"; import { TOOLS_CONFIG } from "../config/api"; import { z } from "zod"; import { McpResponse, McpToolConfig, TFindProjectSchema } from "../types"; export const findProjectTool: McpToolConfig = { name: TOOLS_CONFIG.projects.list.name, description: TOOLS_CONFIG.projects.list.description, parameters: { workspaceId: z .string() .describe( "The ID of the workspace that you need to get the projects from" ), }, handler: async ({ workspaceId, }: TFindProjectSchema): Promise<McpResponse> => { if (!workspaceId && typeof workspaceId === "string") throw new Error("Workspace ID required to fetch projects"); const response = await projectsService.fetchAll(workspaceId as string); const projects = response.data.map((project: any) => ({ name: project.name, clientName: project.clientName, id: project.id, })); return { content: [ { type: "text", text: JSON.stringify(projects), }, ], }; }, };

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/https-eduardo/clockify-mcp-server'

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