Skip to main content
Glama

Conftest pull

conftest_pull
DestructiveIdempotent

Downloads Rego policies from OCI registries or Git repositories into a local policy directory, preparing them for conftest test runs.

Instructions

Download Rego policies from an OCI registry or Git repository into a local directory using conftest pull. Use this to hydrate a local policy/ directory before running conftest_test. Requires conftest on PATH or CONFTEST_BINARY set. The policy directory must be inside OPA_MCP_ALLOWED_PATHS, or a folder the client shares when that is unset. SECURITY: pulled policies are arbitrary Rego source that will be executed by conftest_test. Only pull from registries or repositories you own or explicitly trust -- malicious policy code can use OPA built-ins (http.send, opa.runtime) to exfiltrate data or make outbound network requests when the tests run.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "conftest_pull"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesPolicy URL to pull. Supported schemes: `oci://registry/repo:tag` (OCI registry), `github.com/org/repo//path` (GitHub subdirectory), `git::https://example.com/repo//path` (generic Git). See https://www.conftest.dev/sharing/ for the full URL syntax.
policyNoLocal directory where the pulled policies will be written. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Omitted, it falls back to `policy` in the working directory of the server process, the conftest convention, which must itself sit inside an allowed root. The directory is emptied before the pull, so do not point it at one holding anything you want to keep.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.0
    • changedInput schema / properties / policy / description
      Previous value: -"Local directory where the pulled policies will be written. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Defaults to `./policy` (conftest's convention)."New value: +"Local directory where the pulled policies will be written. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Omitted, it falls back to `policy` in the working directory of the server process, the conftest convention, which must itself sit inside an allowed root. The directory is emptied before the pull, so do not point it at one holding anything you want to keep."
  2. Addedv0.1.13

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations: requires `conftest` on PATH or CONFTEST_BINARY, requires the target directory to sit in OPA_MCP_ALLOWED_PATHS, and warns that pulled policies are arbitrary Rego executed at test time with http.send/opa.runtime exfiltration risk. That operational and security context is exactly what annotations cannot convey.

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?

Front-loads the action, then prerequisites, then the security warning in a clear order. A few clauses duplicate schema facts (allowed paths, directory being emptied), costing some tightness but not clarity.

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 two-parameter mutating tool with no output schema, it covers everything an agent needs: what it does, prerequisites, path constraints, destruction of existing contents, and downstream execution risk. No meaningful gap remains.

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 coverage is 100%, so the schema already documents both `url` (scheme syntax) and `policy` (allowed root, default, emptying behavior). The description repeats the path-allowlist constraint but adds no new meaning about the URL forms or default resolution, so the baseline 3 applies.

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?

States a specific verb and resource: download Rego policies from an OCI registry or Git repo into a local directory. It also names the sibling (conftest_test) that consumes the result, so the agent can distinguish it from conftest_push or the local opa_* policy tools.

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?

Explicitly gives the when: hydrate a local `policy/` directory before running `conftest_test`. It does not say when to skip the tool (e.g. policies already present locally) or contrast it with conftest_push, but the sequencing guidance is otherwise unambiguous.

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