Skip to main content
Glama

Conftest test

conftest_test
Read-onlyIdempotent

Evaluate configuration files (Kubernetes, Terraform, Dockerfiles, etc.) against Rego policies and get pass/fail/warn results per file and namespace.

Instructions

Evaluate configuration files (Kubernetes manifests, Terraform plans, Dockerfiles, Helm charts, or any YAML/JSON/HCL/TOML/INI) against Rego policies using conftest test. Returns per-file, per-namespace pass/fail/warn results so you can pinpoint exactly which policy rules fired. Requires conftest on PATH or CONFTEST_BINARY set; returns CONFTEST_NOT_FOUND otherwise. Provide config via files (disk paths) or inlineConfig (inline string). Provide policy via policy (disk path) or inlinePolicy (inline Rego source). Omit policy and inlinePolicy to use conftest's default ./policy directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNoFilesystem paths to configuration files to evaluate (YAML, JSON, HCL, Dockerfile, etc.). Each path must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Mutually exclusive with `inlineConfig`.
inlineConfigNoInline configuration content to evaluate (e.g. a Kubernetes manifest as a YAML string). Mutually exclusive with `files`. Defaults to YAML format; set `inlineConfigParser` to override.
inlineConfigParserNoParser to use for `inlineConfig`. Valid values: yaml (default), json, toml, hcl1, hcl2, ini, xml, dotenv, cue, jsonnet, properties, edn, hocon, dockerfile. Ignored when `files` is used (conftest infers the parser from each file's extension, unless `parser` is set).
parserNoForce a specific parser for all input `files` via conftest's global `--parser` flag, overriding extension-based detection. Useful for files whose extension does not match their format (e.g. parse a `.tfstate` file as `json`). Valid values: yaml, json, toml, hcl1, hcl2, ini, xml, dotenv, cue, jsonnet, properties, edn, hocon, dockerfile. For `inlineConfig`, prefer `inlineConfigParser`.
policyNoPath to a directory or file containing Rego policies. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Mutually exclusive with `inlinePolicy`. Omit to let conftest use its default `./policy` directory.
inlinePolicyNoInline Rego policy source. Written to a temporary directory and passed as `--policy`. The policy should declare `package main` (or match the `namespace` parameter). Mutually exclusive with `policy`.
namespaceNoRego namespace (package name) to test against. Defaults to `main`. Use `allNamespaces: true` to test all discovered namespaces instead.
allNamespacesNoTest policies found in all discovered namespaces. Overrides `namespace`.
dataNoPaths to directories from which additional data will be loaded for the Rego policies. Each path must be inside an allowed root.
combineNoCombine all configuration files into a single input document before evaluating. Useful when policies need to inspect relationships across multiple files.
failOnWarnNoReturn `passed: false` even when only warnings (no hard failures) are present.
Behavior4/5

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

Annotations already indicate readOnlyHint=true and destructiveHint=false. The description adds value by mentioning the CONFTEST_NOT_FOUND error when the binary is missing, and implies a read-only operation by describing evaluation and result return. It does not contradict 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 is concise, front-loading the main action and key details. Every sentence serves a purpose, covering functionality, output, requirements, and parameter options without redundancy.

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

Completeness3/5

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

While the description covers main inputs, requirements, and high-level output, it lacks detail on the return value structure (no output schema) and potential errors beyond CONFTEST_NOT_FOUND. Given the tool's complexity and absence of output schema, more completeness would be beneficial.

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 baseline is 3. The description adds context about parameter pairs (files/inlineConfig, policy/inlinePolicy) and default behavior, but largely repeats schema information. The added value is moderate, justifying a score of 3.

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

Purpose5/5

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

The description clearly states the tool evaluates configuration files (Kubernetes, Terraform, Docker, etc.) against Rego policies using `conftest test`, and specifies the return format (per-file, per-namespace pass/fail/warn). It distinguishes well from sibling tools like conftest_pull or rego_test by focusing on configuration testing.

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

Usage Guidelines4/5

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

The description provides clear usage context, including prerequisites (conftest on PATH), mutual exclusivity between files/inlineConfig and policy/inlinePolicy, and default policy directory. However, it does not explicitly contrast with alternative tools or mention when not to use this tool, missing a chance to differentiate from siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/OrygnsCode/opa-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server