Slice OpenAPI 3.0/3.1 or Swagger 2.0 Specification
slice_openapi_specScores OpenAPI/Swagger endpoints against a natural-language query (BM25 + boosted operationId, summary, tags, and path tokens) or explicit operationIds/pathPatterns, walks every reachable JSON Pointer $ref with cycle protection, prunes unused paths/components, and emits ready-to-use curl + TypeScript fetch snippets. Pricing: $0.001 USD per OpenAPI/Swagger subgraph slice (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.
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": {
"spec": "<spec>"
},
"name": "slice_openapi_spec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | OpenAPI 3.0/3.1 or Swagger 2.0 specification provided as either a parsed JSON object or a serialized JSON string (up to 5 MiB). | |
| query | No | Natural-language task intent (e.g. 'create credit note and refund invoice') scored via Okapi BM25 plus boosted matches on operationId, summary, tags, and path segments. | |
| methods | No | Optional HTTP method allowlist. | |
| operationIds | No | Explicit operationId values to extract (case-insensitive). | |
| pathPatterns | No | Explicit path templates or 'METHOD /v1/path/*' glob patterns to extract (e.g. 'POST /v1/invoices/*/refund'). | |
| maxOperations | No | Maximum number of matched operations to retain in the sliced OpenAPI spec. | |
| includeSnippets | No | Generate ready-to-use curl and TypeScript fetch code snippets for each selected operation. | |
| compactDescriptions | No | Strip verbose prose descriptions, examples, and externalDocs while keeping spec-valid response descriptions. |