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", [])],
        )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but provides no information about authentication requirements, rate limits, error conditions, response format, or whether this is a read-only operation. The description is too minimal for a tool that presumably interacts with external APIs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise at just 6 words, front-loading the essential information with zero wasted words. It follows the principle that every sentence earns its place, though this brevity comes at the cost of completeness in other dimensions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the context of API information retrieval with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'general information' includes, how the information is structured, whether authentication is required, or what happens with invalid API identifiers. For a tool that likely returns structured data about APIs, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, with the single parameter 'api' documented as 'API name or direct URL'. The description adds no additional parameter context beyond what's in the schema, so it meets the baseline for high schema coverage but doesn't enhance understanding of what constitutes valid API identifiers or how they're resolved.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('general information about an API'), making the purpose immediately understandable. However, it doesn't distinguish this tool from similar siblings like 'get_endpoint_details' or 'get_model_schema' which also retrieve API-related information, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_endpoint_details' (for specific endpoints), 'get_model_schema' (for data models), and 'list_saved_apis' (for listing APIs), there's no indication whether this tool returns metadata, configuration, or summary data about an API.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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