Skip to main content
Glama

Conftest push

conftest_push
Destructive

Push local Rego policy directories to an OCI registry as artifacts via conftest, publishing policies for distribution. Credentials must already be configured in the host environment.

Instructions

Package the local Rego policy directory as an OCI artifact and push it to a registry using conftest push. Registry credentials must be pre-configured in the host environment (docker login, ORAS keychain, etc.) -- this tool never handles credentials. The policy directory must be inside OPA_MCP_ALLOWED_PATHS, or a folder the client shares when that is unset. Requires conftest on PATH or CONFTEST_BINARY set.

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": {
      "repository": "<repository>"
    },
    "name": "conftest_push"
  }
}

Input Schema

NameRequiredDescriptionDefault
policyNoPath to the local directory containing Rego policies to push. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS) and must exist. 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.
repositoryYesOCI repository URL to push policies to (e.g. `ghcr.io/my-org/policies:latest`). Registry credentials must already be configured in the host environment (via `docker login`, ORAS keychain, or REGISTRY_AUTH_FILE). This tool does not accept or store registry credentials.
v0CompatibleNoRead the policy as Rego v0 (`--v0-compatible`), the syntax OPA used before 1.0: rules without `if`, partial sets as `deny[msg] { ... }`. Needed for a policy that has not been migrated, which OPA 1.x otherwise refuses to load. Where the tool also takes a query, the query is read as v0 too, with the future keywords imported so `in`, `every` and `some x in` still work in it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.0
    • addedInput schema / properties / v0Compatible
      Added value: +{
      +  "description": "Read the policy as Rego v0 (`--v0-compatible`), the syntax OPA used before 1.0: rules without `if`, partial sets as `deny[msg] { ... }`. Needed for a policy that has not been migrated, which OPA 1.x otherwise refuses to load. Where the tool also takes a query, the query is read as v0 too, with the future keywords imported so `in`, `every` and `some x in` still work in it.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv0.5.0
    • changedInput schema / properties / policy / description
      Previous value: -"Path to the local directory containing Rego policies to push. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS) and must exist. Defaults to `./policy` (conftest's convention)."New value: +"Path to the local directory containing Rego policies to push. Must be inside an allowed root (OPA_MCP_ALLOWED_PATHS) and must exist. 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."
  3. Addedv0.1.13

TDQS

A3.8/5.0
Behavior4/5

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

Beyond the annotations, the description adds meaningful operational context: credentials are never handled by this tool, the policy directory must sit inside an allowed root, and a conftest binary must be present. These are concrete behavioral constraints an agent needs before invoking an open-world push. It does not mention whether pushing an existing tag overwrites prior artifact content, which is a notable omission given destructiveHint=true.

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 front-loaded with the core action, followed by concise prerequisite constraints. Every sentence contributes necessary information about credentials, path restrictions, or binary availability. There is no redundant or filler wording.

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?

For a destructive, open-world push operation without an output schema, the description covers the critical prerequisites: credentials, allowed paths, and binary availability. It could be more complete by explaining overwrite behavior for existing repository tags or what a successful push returns. Given the annotations already flag destructive and open-world behavior, the remaining gap is moderate rather than severe.

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 all three parameters are already well documented in the schema, including the policy path constraint and the v0Compatible flag semantics. The description largely repeats the allowed-path restriction already present in the schema and adds no new syntax or format detail beyond it. Baseline 3 is appropriate when the schema carries the parameter documentation.

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 states a specific verb and resource: package the local Rego policy directory as an OCI artifact and push it to a registry via `conftest push`. This is clearly distinguishable from read-style siblings such as conftest_pull and conftest_test. It does not explicitly name an alternative tool, so it falls just short of the top score.

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?

The description supplies important prerequisites (pre-configured registry credentials, allowed path roots, conftest binary availability), which gives clear context for using the tool. However, it never states when to choose this over sibling operations like opa_bundle_build or conftest_pull, nor does it describe when not to use it. Usage is therefore implied rather than explicitly guided.

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