simplify
Reduce complex OpenAPI specs for mocking by dropping anyOf/oneOf unions, stripping x-* extensions, and capping optional properties. Saves the result to disk and returns its path.
Instructions
Simplify an OpenAPI spec: drop or reduce union types (anyOf/oneOf), strip x-* extensions, and optionally limit the number of optional properties per schema. Writes the simplified spec to disk and returns its path. Use this when a spec is too large or too complex to mock cleanly (deeply nested unions, hundreds of optional fields) — the output is a faithful subset the agent can hand to serve_locally.
Optional-property handling:
• omit optional to keep every optional property
• optional: N keeps exactly N per schema (0 drops them all)
• optional_min/optional_max (must come together) picks a random count in that range per schema
Pass config for an oapi-codegen-dd codegen.yml when the user wants filter + overlay + prune applied before simplification.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Spec file path or public https URL. | |
| config | No | Path to an oapi-codegen-dd codegen.yml. Applies filter + overlay + prune before simplification. | |
| output | No | Where to write the simplified spec. Omit to write into ~/.cache/mockzilla-mcp/simplified/ and let the bridge pick a name. | |
| optional | No | Keep exactly N optional properties per schema. Mutually exclusive with optional_min/optional_max. | |
| optional_max | No | Range mode upper bound (use with optional_min). | |
| optional_min | No | Range mode lower bound (use with optional_max). |