Skip to main content
Glama

Conftest verify

conftest_verify

Run test rules in Rego policy files to verify policy correctness, returning per-file pass/fail results. Requires conftest binary.

Instructions

Run the test_* rules inside *_test.rego files within a conftest policy directory, verifying that the policies themselves are correct. Equivalent to opa test but using conftest's policy-loading machinery. Returns per-file pass/fail results, and NO_TESTS_FOUND when the directory holds no test rules. Requires conftest on PATH or CONFTEST_BINARY set; returns CONFTEST_NOT_FOUND otherwise.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoPaths to data directories. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS).
policyNoPath to the directory containing both the Rego policies and the `*_test.rego` test files. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Omit to use conftest's default `./policy` directory.
namespaceNoNamespace to verify. Omit to verify all namespaces.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.0
    • changedInput schema / properties / namespace / description
      Previous value: -"Namespace to verify. Defaults to `main`. Omit to verify all namespaces."New value: +"Namespace to verify. Omit to verify all namespaces."
  2. Addedv0.1.13

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, it discloses exact return behavior (`per-file pass/fail`), the `NO_TESTS_FOUND` case, and the `CONFTEST_NOT_FOUND` error condition plus the binary resolution order. These are important runtime behaviors that the schema and annotations don't express. Nothing here contradicts the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description moves from core behavior to equivalence, return format, and runtime requirements in a few compact sentences with no filler or repeated schema content. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema, the description still covers return format, error conditions, and external dependency requirements. Combined with the fully documented input schema, an agent has enough context to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already carries the parameter definitions including allowed-root constraints and defaults. The description adds some helpful context by explaining what a policy directory must contain (`test_*` rules in `*_test.rego`), but it doesn't add meaning for `data` or `namespace`.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb and resource: it runs `test_*` rules in `*_test.rego` files and frames the purpose as verifying that policies are correct. It also contrasts itself with `opa test`, which clarifies its niche, but it doesn't explicitly distinguish from closely named siblings like `conftest_test` or `rego_test`.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is implied by the explicit reference to conftest's policy-loading machinery and the prerequisite that `conftest` must be on PATH or `CONFTEST_BINARY` set. However, the description never names sibling alternatives or states when to prefer this tool over `conftest_test`/`rego_test`.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.