Skip to main content
Glama

Conftest verify

conftest_verify

Verify conftest policies by running their test_* rules to ensure correctness. Returns per-file pass/fail results or NO_TESTS_FOUND.

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.
v0CompatibleNoRead the policies as Rego v0 (`--rego-version v0`), the syntax before OPA 1.0: rules without `if`, `deny[msg] { ... }`. conftest reads v1 by default and refuses such a policy.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.0
    • addedInput schema / properties / v0Compatible
      Added value: +{
      +  "description": "Read the policies as Rego v0 (`--rego-version v0`), the syntax before OPA 1.0: rules without `if`, `deny[msg] { ... }`. conftest reads v1 by default and refuses such a policy.",
      +  "type": "boolean"
      +}
  2. 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."
  3. Addedv0.1.13

TDQS

A3.7/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, openWorldHint=true, which say nothing specific), it discloses concrete behavior: per-file pass/fail results, a NO_TESTS_FOUND sentinel for empty test sets, the external `conftest` dependency (PATH or CONFTEST_BINARY), and a CONFTEST_NOT_FOUND failure mode. This is genuinely useful operational context, though it omits what happens if a test itself errors mid-run.

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

Conciseness4/5

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

Four sentences, each carrying distinct information (what it runs, the opa-test equivalence, return values, dependencies), with the core purpose front-loaded. It is dense but not padded; the equivalence sentence could be tightened slightly but earns its place by anchoring expectations.

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

Completeness4/5

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

With no output schema, the description correctly steps in to describe return shape (per-file pass/fail, NO_TESTS_FOUND) and prerequisite/environment failure (CONFTEST_NOT_FOUND). For a 4-param, zero-required tool this is largely complete; the only gap is the unaddressed overlap with the conftest_test sibling.

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 parameters (data, policy, namespace, v0Compatible) are already fully documented with constraints and allowed roots. The description adds only a passing reference to the policy directory and does not enrich parameter meaning beyond the schema, so the baseline 3 applies.

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 gives a specific verb and resource ('Run the `test_*` rules inside `*_test.rego` files within a conftest policy directory') and clarifies the goal is verifying the policies themselves. It is clear in isolation, but it never distinguishes itself from the very similar sibling conftest_test, so an agent cannot confidently route between them.

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?

It implies usage by framing the tool as 'Equivalent to `opa test` but using conftest's policy-loading machinery', which hints at when to pick it over plain OPA tooling. However, it gives no explicit when-to-use/when-not, and says nothing about how it differs from conftest_test or the rego_test siblings, leaving the closest routing decision to inference.

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