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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Concrete or templated path, e.g. /pets/{petId} or /pets/42. | |
| spec | No | The OpenAPI document as a JSON object (use specText for YAML). | |
| method | Yes | ||
| specText | No | The OpenAPI document as JSON text (up to 400000 characters) or YAML text (up to 50000 characters). |