Skip to main content
Glama

list-projects

Retrieve and display all available projects from the Strateegia platform for project management and collaboration.

Instructions

List projects from Strateegia API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler logic for the 'list-projects' tool. Fetches project data from Strateegia API, processes labs and projects, and returns a formatted 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, }, ], }; }
  • Tool definition including name, description, and input schema (empty object, no parameters required).
    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 ListToolsRequest handler so it appears in tool lists.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [LIST_PROJECTS_TOOL], }));
  • Helper function to perform authenticated fetches to the Strateegia API, called 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(); }
  • Helper function to obtain an access token using the STRATEEGIA_API_KEY environment variable, used by fetchStrateegiaAPI.
    async function getAccessToken(): Promise<string> { const api_key = process.env.STRATEEGIA_API_KEY; if (!api_key) { throw new Error("STRATEEGIA_API_KEY environment variable is not set"); } const options = { method: "POST", headers: { "x-api-key": api_key, }, }; async function fetchAccessToken() { const response = await fetch(API_AUTH_BASE, options); if (!response.ok) { const errorText = await response.text(); throw new Error( `API request failed: ${response.status} ${response.statusText} - ${errorText}` ); } return response.json(); } const token = await fetchAccessToken(); return token.access_token; }

Other 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