Skip to main content
Glama
team.tools.ts1.56 kB
import { Tool } from "@modelcontextprotocol/sdk/types.js"; import { ClickUpService } from "../services/clickup.service.js"; import { logger } from "../logger.js"; // Tool Definition export const getTeamsTool: Tool = { name: "clickup_get_teams", description: "Get all teams (workspaces) accessible to the authenticated user.", inputSchema: { type: "object", properties: {}, // No input arguments needed }, outputSchema: { type: "object", properties: { teams: { type: "array", items: { type: "object", properties: { id: { type: "string" }, name: { type: "string" } } } } }, description: "An object containing an array of team objects in the 'teams' property." }, }; // Handler Function export async function handleGetTeams( clickUpService: ClickUpService, args: Record<string, unknown>, // Args likely unused but kept for consistent signature ): Promise<any> { logger.info(`Handling tool call: ${getTeamsTool.name}`); try { const teams = await clickUpService.getTeams(); return { content: [ { type: "text", text: JSON.stringify(teams, null, 2), // Stringify the JSON data }, ], // AJOUT: structuredContent requis par MCP quand outputSchema est défini structuredContent: { teams }, }; } catch (error) { logger.error(`Error in ${getTeamsTool.name}:`, error); throw error instanceof Error ? error : new Error("Failed to get teams"); } }

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/Nazruden/clickup-mcp-server'

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