Check Rego
rego_checkType-check Rego policies with opa check. Returns success or diagnostics with file locations. Supports inline source, file paths, strict mode, and bundles.
Instructions
Type-check Rego with opa check. Returns { valid: true, errors: [] } on success, or a list of structured diagnostics with file/line locations on failure. Provide either source for inline checking or paths for file/directory checking.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | Inline Rego source. Mutually exclusive with `paths`. | |
| paths | No | Filesystem paths to check. Each path must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). | |
| strict | No | Enable strict mode -- fail on unused vars, deprecated builtins, etc. | |
| capabilities | No | Path to a capabilities JSON file restricting allowed builtins. | |
| schemaDir | No | Schema directory for input/data validation. | |
| maxErrors | No | Maximum number of errors to collect before `opa check` aborts compilation (`--max-errors`, OPA default 10). Raise it to surface more diagnostics from a badly broken policy in a single pass. | |
| bundle | No | Load `paths` as bundle files or root directories (`--bundle`). Only valid with `paths`, not inline `source`. |