mcp-daily-tasks
Version:
MCP para manejar tareas y resúmenes con integración ClickUp.
14 lines (13 loc) • 668 B
JavaScript
import { z } from "zod";
import { fetchClockify } from "../utils/fetchClockify.js";
export function registerGetProjectsTool(server) {
server.tool("get_projects", "Obtener los proyectos de un workspace en Clockify", {
workspaceId: z.string().describe("ID del workspace")
}, async ({ workspaceId }) => {
const data = await fetchClockify(`/workspaces/${workspaceId}/projects`);
if (!data || !Array.isArray(data) || data.length === 0) {
return { content: [{ type: "text", text: "No hay proyectos en este workspace." }] };
}
return { content: [{ type: "text", text: JSON.stringify(data) }] };
}).disable();
}