Skip to main content
Glama

register_api

Register APIs by ingesting OpenAPI specifications to parse specs, build dependency graphs, and create searchable embeddings for API orchestration.

Instructions

Register a new API by ingesting its OpenAPI specification. This parses the spec, builds a dependency graph, and creates searchable embeddings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_idYesUnique identifier for this API (e.g., 'stripe', 'github')
spec_urlYesURL to the OpenAPI specification (JSON or YAML)

Implementation Reference

  • The _register_api function handles the core logic for the register_api tool, delegating the indexing of an OpenAPI spec to self.indexer.index_from_url.
    async def _register_api(self, args: dict[str, Any]) -> ToolResult:
        """Register a new API."""
        api_id = args["api_id"]
        spec_url = args["spec_url"]
    
        result = await self.indexer.index_from_url(api_id, spec_url)
    
        if result.success:
            return ToolResult(
                success=True,
                data={
                    "api_id": result.api_id,
                    "title": result.title,
                    "version": result.version,
                    "endpoint_count": result.endpoint_count,
                    "dependency_count": result.dependency_count,
                    "message": f"Successfully registered {result.title} with {result.endpoint_count} endpoints",
                },
            )
        else:
            return ToolResult(
                success=False,
  • RegisterApiInput defines the expected input schema for the register_api tool, including api_id and spec_url.
    class RegisterApiInput(BaseModel):
        """Input for register_api tool."""
    
        api_id: str = Field(
            ...,
            description="Unique identifier for this API",
            min_length=1,
            max_length=100,
            pattern=r"^[a-zA-Z0-9_-]+$",
        )
  • The register_api tool is mapped to the _register_api handler method in the tools dispatcher dictionary.
    "register_api": self._register_api,
Behavior4/5

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

With no annotations provided, the description carries the full burden and successfully discloses internal side effects: parsing the spec, building a dependency graph, and creating searchable embeddings. However, it lacks explicit safety information (idempotency, error handling on duplicate api_id, or execution time expectations).

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?

Two efficient sentences with zero waste: the first establishes the primary action and method, while the second explains valuable internal processing mechanics. Information is front-loaded and appropriately sized.

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

Completeness4/5

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

Given no output schema and no annotations, the description adequately covers the tool's purpose and internal mechanics (parsing, embeddings). It could be improved by clarifying idempotency behavior or return value structure, but the core functionality is well-documented given the 100% schema coverage.

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?

Schema description coverage is 100%, establishing a baseline of 3. The description mentions 'OpenAPI specification' which maps to spec_url and implies api_id through 'new API', but does not add syntax details, format constraints, or examples beyond the schema definitions.

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

Purpose5/5

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

The description provides a specific verb ('Register') and resource ('API'), and clearly distinguishes this from sibling tools like delete_api, call_api, or list_apis by specifying this is for 'new' API ingestion via OpenAPI specification.

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

Usage Guidelines3/5

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

The word 'new' implies this is for initial registration rather than updating existing APIs, but there is no explicit 'when to use' guidance, workflow context, or named alternatives to guide the agent in selecting this over siblings like set_api_auth.

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/nk3750/jitapi'

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