Skip to main content
Glama

get_api_spec

Retrieve raw OpenAPI, AsyncAPI, GraphQL, or other API specs for a Backstage entity to understand endpoints, schemas, and authentication before writing integration code.

Instructions

Retrieve the raw API specification (OpenAPI YAML/JSON, AsyncAPI, GraphQL schema, etc.) for a specific API entity. The spec content can be used to understand available endpoints, schemas, and authentication requirements for writing integration code.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "entityRef": "<entityRef>"
    },
    "name": "get_api_spec"
  }
}

Input Schema

NameRequiredDescriptionDefault
entityRefYesAPI entity reference, e.g. 'api:default/payment-api'. Use list_api_specs to find available APIs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden. It clearly indicates a read/retrieval operation and explains what the returned content is useful for, but it does not disclose permission requirements, error behavior when a spec is missing, or whether the raw spec is returned in full or normalized form.

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 two front-loaded sentences with no wasted wording. The first sentence defines what is retrieved and the formats involved; the second sentence explains the practical use of the returned spec.

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?

For a simple one-parameter read tool with no output schema, the description supplies enough context: what is returned, in what formats, and why an agent would use it. Minor gaps remain around explicit sibling routing and read-time failure behavior, but the definition is largely complete.

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 description adds only the general notion of a 'specific API entity,' while the input schema already has 100% description coverage, including an example entityRef and guidance to use list_api_specs. With one fully documented parameter, the schema does the heavy lifting and the description does not add syntax or format details beyond it.

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 states a specific verb and resource: 'Retrieve the raw API specification ... for a specific API entity.' It also names concrete formats (OpenAPI YAML/JSON, AsyncAPI, GraphQL schema), which makes the tool's scope clear. It stops short of explicitly naming the sibling listing tool, so the distinction from list_api_specs is only implied by 'specific API entity' and left to the schema.

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 description gives implied usage context by saying the spec content is useful 'for writing integration code' and understanding endpoints, schemas, and authentication. However, it does not explicitly say when to use this tool versus list_api_specs or other alternatives; that routing hint appears only in the entityRef schema description.

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