Skip to main content
Glama
topaisaas-dev

Universal Native MCP Server Hub

topai_openapi_flattener

Read-onlyIdempotent

Flatten OpenAPI 3.0/3.1 specs into self-contained JSON by resolving internal/external $refs and circular references; use before importing into RapidAPI, Postman, or LLM tools that reject $refs.

Instructions

Dereferences internal and external $ref pointers, neutralizes circular schema references, and flattens OpenAPI 3.0/3.1 specifications into a self-contained JSON document. Use before importing complex OpenAPI specs into RapidAPI, Postman, or LLM function-calling compilers that reject nested $ref pointers. Do not use for general JSON token minification (use topai_token_slimmer instead). Stateless, read-only, idempotent schema transformation.

Input Schema

NameRequiredDescriptionDefault
spec_urlNoOptional public HTTP/HTTPS URL pointing to an OpenAPI JSON specification to fetch and flatten.
spec_jsonNoOptional raw OpenAPI JSON string passed inline for immediate local dereferencing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.2

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint, and openWorldHint, so 'stateless, read-only, idempotent' largely restates structured data. However, the description adds genuine behavioral context beyond annotations: that it handles both internal and external $refs, neutralizes circular references, and yields a self-contained JSON document.

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

Conciseness4/5

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

Three sentences, front-loaded with the core action, followed by usage routing and then a trait summary. The final clause mildly duplicates the annotation set, but overall the text is tight and well ordered.

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?

No output schema exists, but the description discloses the return shape ('self-contained JSON document') and the transformation behavior, which is sufficient. Adding input format guidance (e.g., that exactly one of the two optional params is expected) would make it fully 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?

Schema description coverage is 100% and both parameters (spec_url, spec_json) are fully documented in the schema. The description adds no parameter-level syntax or format detail beyond what the schema already provides, so the baseline of 3 applies.

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 uses specific verbs (dereferences, neutralizes, flattens) and names the exact resource (OpenAPI 3.0/3.1 specifications, internal and external $ref pointers). It explicitly distinguishes itself from the sibling topai_token_slimmer, so an agent can tell them apart without opening either schema.

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

Usage Guidelines5/5

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

It states the precise use case (before importing into RapidAPI, Postman, or LLM function-calling compilers that reject nested $ref pointers) and an explicit exclusion with a named alternative (not for JSON token minification, use topai_token_slimmer). Nothing is left to inference.

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