Skip to main content
Glama

list-projects

Retrieve and display all available projects from the Strateegia API to manage and organize your collaborative initiatives efficiently.

Instructions

List projects from Strateegia API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the 'list-projects' tool by fetching labs and projects from the Strateegia API, processing them into a formatted summary, and returning a text response.
    if (request.params.name === "list-projects") { const labs: StrateegiaItemResponse[] = await fetchStrateegiaAPI( "/projects/v1/project" ); if (labs.length === 0) { return { content: [ { type: "text", text: "No labs found. Make sure your access token has the correct permissions.", }, ], }; } let labCount = 0; let projectCount = 0; const projectsSummary = labs .map((item) => { labCount++; projectCount += item.projects.length; return `Lab: ${item.lab.name} (ID: ${ item.lab.id })\nProjects:\n${item.projects .map((project) => { return `- ${project.title} (ID: ${project.id})`; }) .join("\n")}`; }) .join("\n\n"); const fullResponse = `Found ${labCount} labs and ${projectCount} projects:\n\n${projectsSummary}`; return { content: [ { type: "text", text: fullResponse, }, ], };
  • Schema definition for the 'list-projects' tool, specifying name, description, and empty input schema.
    const LIST_PROJECTS_TOOL: Tool = { name: "list-projects", description: "List projects from Strateegia API", inputSchema: { type: "object", properties: {}, required: [], }, };
  • src/index.ts:106-108 (registration)
    Registers the 'list-projects' tool in the ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [LIST_PROJECTS_TOOL], }));
  • Helper function to fetch data from Strateegia API with authentication, used by the list-projects handler.
    async function fetchStrateegiaAPI(endpoint: string): Promise<any> { const accessToken = await getAccessToken(); const response = await fetch(`${API_BASE_URL}${endpoint}`, { headers: { Authorization: `Bearer ${accessToken}`, "Content-Type": "application/json", }, }); if (!response.ok) { const errorText = await response.text(); throw new Error( `API request failed: ${response.status} ${response.statusText} - ${errorText}` ); } return response.json(); }
  • TypeScript interfaces defining the structure of Strateegia API responses used by the list-projects tool.
    interface StrateegiaItemResponse { lab: StrateegiaLabs; projects: StrateegiaProject[]; } interface StrateegiaLabs { id: string; name: string; owner_name: string; } interface StrateegiaProject { id: string; title: string; }

Other Tools

Related 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/filipecalegario/mcp-server-strateegia'

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