Skip to main content
Glama

openapi-slice

Slice one operation out of an OpenAPI 3.0 or 3.1 document with every component it needs — Extracts one operation (path plus HTTP method, matching templated paths like /pets/{id}) from an OpenAPI 3.0.x or 3.1.x document, given as JSON, YAML or a parsed object, and returns a smaller valid OpenAPI document holding that operation, its path-level parameters and servers, and the transitive closure of every local $ref it uses: schemas, parameters, requestBodies, responses, headers, examples,

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": {
      "path": "<path>",
      "method": "<method>"
    },
    "name": "openapi-slice"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesConcrete or templated path, e.g. /pets/{petId} or /pets/42.
specNoThe OpenAPI document as a JSON object (use specText for YAML).
methodYes
specTextNoThe OpenAPI document as JSON text (up to 400000 characters) or YAML text (up to 50000 characters).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden and does disclose the non-obvious core behavior: the result is a *valid* OpenAPI document containing path-level parameters, servers, and the transitive closure of every *local* $ref, which implicitly flags that external refs are not resolved. Gaps remain around error behavior for a missing path/method and precedence between `spec` and `specText`, but the critical output shape is disclosed.

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?

Wrong scale; reassigning below.

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, so the description must explain the return value, and it does so precisely (smaller valid document plus transitive $ref closure). For a four-parameter extraction tool this is nearly complete; only failure modes and `spec`/`specText` precedence are missing.

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 coverage is 75% and the enum plus both path examples are already documented in the schema, so the description largely restates them. Its only added value is summarizing that the document may arrive as JSON, YAML, or a parsed object, which loosely maps `spec` vs `specText` but does not explain precedence or conflict handling.

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?

States a specific verb and resource: slice one operation (path plus HTTP method) out of an OpenAPI 3.0.x/3.1.x document, and returns a smaller valid document. The templated-path matching behavior (`/pets/{id}`) further distinguishes it from a generic spec tool.

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?

Usage is implied by the input requirements (a path and method must exist in the spec), but there is no explicit when-to-use/when-not guidance, no mention of what happens when the path or method is absent, and no routing to or away from siblings such as openapi-breaking-change.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources