Infer input schema
rego_infer_input_schemaStatically analyze Rego policies to generate JSON Schema of input fields, simplifying integration test writing and schema validation.
Instructions
Statically analyse one or more Rego policies and return a JSON Schema (draft-07) object describing every input.* field the policies read. Uses opa parse for AST-level analysis -- no running OPA server required. Correct starting point for writing integration tests, configuring opa check --schema validation, or documenting a policy API. Accepts inline source, individual files, or directories (walked recursively for *.rego files).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | Inline Rego source to analyse. Mutually exclusive with paths. | |
| paths | No | Policy files or directories to analyse. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Directories are walked recursively for *.rego files. |