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
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID | |
| apiId | Yes | API ID |
Implementation Reference
- src/services/mcpServer.ts:96-104 (handler)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) }] }; }
- src/services/mcpServer.ts:92-95 (schema)Zod input schema for the 'get_api' tool parameters.{ projectId: z.string().describe("Project ID"), apiId: z.string().describe("API ID") },
- src/services/mcpServer.ts:90-105 (registration)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) }] }; } );
- src/services/eolinkService.ts:82-92 (helper)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; } }
- src/models/api.ts:15-28 (schema)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; }