Skip to main content
Glama

get_api

Retrieve API details from Eolink OpenAPI by specifying project and API identifiers for integration and management in Windsurf IDE development environments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
apiIdYesAPI ID

Implementation Reference

  • MCP tool handler for 'get_api': calls eolinkService.getApi and returns JSON-formatted API details.
    async ({ projectId, apiId }) => { const api = await eolinkService.getApi(projectId, apiId); return { content: [{ type: "text", text: JSON.stringify({ api }, null, 2) }] }; }
  • Zod input schema for the 'get_api' tool parameters.
    { projectId: z.string().describe("Project ID"), apiId: z.string().describe("API ID") },
  • Registration of the 'get_api' MCP tool including name, schema, and handler function.
    this.server.tool( "get_api", { projectId: z.string().describe("Project ID"), apiId: z.string().describe("API ID") }, async ({ projectId, apiId }) => { const api = await eolinkService.getApi(projectId, apiId); return { content: [{ type: "text", text: JSON.stringify({ api }, null, 2) }] }; } );
  • Helper method that performs the actual HTTP request to retrieve API details from Eolink.
    async getApi(projectId: string, apiId: string): Promise<Api | null> { try { const response = await axios.get(`${this.baseUrl}/projects/${projectId}/apis/${apiId}`, { headers: this.getHeaders(), }); return response.data.data || null; } catch (error) { console.error(`Error fetching API ${apiId} in project ${projectId}:`, error); return null; } }
  • TypeScript interface defining the structure of the Api object returned by the tool.
    export interface Api { id: string; name: string; projectId: string; path: string; method: HttpMethod; description?: string; requestHeaders?: Header[]; requestParams?: Parameter[]; requestBody?: RequestBody; responses?: Response[]; createdAt: string; updatedAt: string; }

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/scarqin/mcp-apikit'

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