Skip to main content
Glama

get_api_info

Retrieve general information about an API, including endpoints, data models, and structure, to explore large OpenAPI schemas efficiently without loading entire schemas into LLM context.

Instructions

Get general information about an API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiYesAPI name or direct URL

Implementation Reference

  • MCP tool handler: validates API identifier, fetches API info from explorer, formats display, and returns text content or error.
    async def handle_call(self, arguments: Dict[str, Any]) -> List[TextContent]: try: self._validate_api_identifier(arguments["api"]) info = await self.explorer.get_api_info(arguments["api"]) result = info.format_display() return self._create_text_response(result) except Exception as e: return self._create_error_response(e)
  • Defines the tool schema including name, description, and input schema for API identifier.
    def get_tool_definition(self) -> Tool: return Tool( name=self.name, description=self.description, inputSchema=self.create_api_input_schema(), )
  • Registers GetApiInfoTool by instantiating it with config_manager and explorer, adding to tools dict.
    def _register_tools(self) -> None: """Register all available tools.""" tools = [ # API Management Tools AddApiTool(self.config_manager), ListSavedApisTool(self.config_manager), RemoveApiTool(self.config_manager), # API Exploration Tools GetApiInfoTool(self.config_manager, self.explorer), ListEndpointsTool(self.config_manager, self.explorer), SearchEndpointsTool(self.config_manager, self.explorer), GetEndpointDetailsTool(self.config_manager, self.explorer), ListModelsTool(self.config_manager, self.explorer), GetModelSchemaTool(self.config_manager, self.explorer), ] for tool in tools: self._tools[tool.name] = tool logger.debug(f"Registered tool: {tool.name}")
  • Helper method that retrieves OpenAPI schema, extracts info like title, version, description, base_url, tags into ApiInfo object.
    async def get_api_info(self, api_identifier: str) -> ApiInfo: """Get general information about an API.""" url, headers = self.config_manager.get_api_config(api_identifier) schema = await self.cache.get_schema(url, headers) info = schema.get("info", {}) base_url = self._get_base_url_from_schema(schema) return ApiInfo( title=info.get("title", "Unknown"), version=info.get("version", "Unknown"), description=info.get("description", ""), base_url=base_url, tags=[tag.get("name") for tag in schema.get("tags", [])], )

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/nyudenkov/openapi-mcp-proxy'

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