Skip to main content
Glama

Build OPA bundle

opa_bundle_build
DestructiveIdempotent

Build deployable OPA bundles from policy and data paths, producing a .tar.gz archive with optional signing, optimization, custom revision, and WASM target.

Instructions

Build a deployable bundle from policy / data paths using opa build. Output is a .tar.gz archive with optional inline signing. Supports optimization, custom revision strings, and the WASM target.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYesPolicy / data paths to include. Each must be in an allowed root.
bundleNoLoad `paths` as bundle files or root directories (`--bundle`). Implied by `signingKey` and `verificationKey`; set it explicitly to rebuild an existing bundle without signing.
ignoreNoFile/directory name patterns to ignore during loading (`--ignore`), e.g. `[".*"]` to skip hidden files. These are name patterns, not filesystem paths.
outputYesOutput bundle path (typically `*.tar.gz`). Must be in an allowed root.
targetNoBuild target (default `rego`; `wasm` compiles to WebAssembly).
optimizeNoOptimization level (0 = none, 2 = aggressive).
revisionNoBundle revision string written to the manifest.
claimsFileNoPath to a claims file for inline signing.
signingAlgNoSigning algorithm (e.g. RS256).
signingKeyNoPath to a PEM private key for signing the built bundle (`--signing-key`). Implies `bundle: true`, which OPA requires for signing.
entrypointsNoEntrypoint refs (required when `target=wasm` or `optimize > 0`).
pruneUnusedNoExclude dependents of entrypoints that are not reachable from them (`--prune-unused`). Most useful alongside `entrypoints`.
capabilitiesNoPath to a capabilities JSON file.
v1CompatibleNoOpt in to OPA v1.0-compatible behaviors (`--v1-compatible`). Affects the built bundle's runtime semantics.
verificationKeyNoPath to a PEM public key (or HMAC secret file) used to re-verify an existing signed bundle during the build (`--verification-key`). Implies `bundle: true`, which OPA requires for verification.
verificationKeyIdNoKey ID for verification (`--verification-key-id`, OPA default `default`).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed3 schema fields changedv0.5.0
    • changedInput schema / properties / bundle / description
      Previous value: -"Load `paths` as bundle files or root directories (`--bundle`). Required when rebuilding or re-signing an existing bundle."New value: +"Load `paths` as bundle files or root directories (`--bundle`). Implied by `signingKey` and `verificationKey`; set it explicitly to rebuild an existing bundle without signing."
    • changedInput schema / properties / signingKey / description
      Previous value: -"Path to a signing key for inline signing."New value: +"Path to a PEM private key for signing the built bundle (`--signing-key`). Implies `bundle: true`, which OPA requires for signing."
    • changedInput schema / properties / verificationKey / description
      Previous value: -"Path to a PEM public key (or HMAC secret file) used to re-verify an existing signed bundle during the build (`--verification-key`). Pair with `bundle: true`."New value: +"Path to a PEM public key (or HMAC secret file) used to re-verify an existing signed bundle during the build (`--verification-key`). Implies `bundle: true`, which OPA requires for verification."
  2. Changed6 schema fields changedv0.1.20
    • addedInput schema / properties / bundle
      Added value: +{
      +  "description": "Load `paths` as bundle files or root directories (`--bundle`). Required when rebuilding or re-signing an existing bundle.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / ignore
      Added value: +{
      +  "description": "File/directory name patterns to ignore during loading (`--ignore`), e.g. `[\".*\"]` to skip hidden files. These are name patterns, not filesystem paths.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / pruneUnused
      Added value: +{
      +  "description": "Exclude dependents of entrypoints that are not reachable from them (`--prune-unused`). Most useful alongside `entrypoints`.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / v1Compatible
      Added value: +{
      +  "description": "Opt in to OPA v1.0-compatible behaviors (`--v1-compatible`). Affects the built bundle's runtime semantics.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / verificationKey
      Added value: +{
      +  "description": "Path to a PEM public key (or HMAC secret file) used to re-verify an existing signed bundle during the build (`--verification-key`). Pair with `bundle: true`.",
      +  "type": "string"
      +}
    • addedInput schema / properties / verificationKeyId
      Added value: +{
      +  "description": "Key ID for verification (`--verification-key-id`, OPA default `default`).",
      +  "type": "string"
      +}
  3. Addedv0.1.13
  4. Removedv0.1.5
  5. Addedv0.1.2
  6. Removedv0.1.1
  7. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and idempotentHint=true, covering the safety profile. The description adds that the output is a .tar.gz archive and that signing is optional, but it does not disclose additional behavioral details such as overwriting existing outputs or the fact that signing implies bundle mode (though the schema covers the latter). No contradiction with 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?

Three sentences with no wasted words: purpose first, then output format, then supported features. The description is front-loaded and every sentence contributes useful information. The mention of `opa build` clarifies the underlying command 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?

Given the tool's complexity (16 parameters, 2 required, no output schema), the description is a useful but high-level summary. It does not guide the agent on when to choose this tool over opa_bundle_sign/verify, nor does it highlight important constraints like entrypoints being required for wasm/optimize; the schema covers those details, but the description alone is not fully complete for a tool of this complexity.

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 documents all 16 parameters. The description adds a high-level summary of key capabilities (optimization, revision strings, WASM target) that maps to parameters, but it does not provide meaningful new meaning beyond what the schema already states. 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?

The description clearly states a specific verb ('Build') and resource ('deployable bundle from policy / data paths') and adds concrete output details (.tar.gz, optional signing, WASM target). This distinguishes it from related siblings like opa_bundle_sign and opa_bundle_verify, which handle signing/verification rather than building.

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 implies usage for building deployable bundles from policy/data paths, but it does not explicitly contrast this with related tools such as opa_bundle_sign, opa_bundle_verify, or rego_eval. There is no explicit when-to-use or when-not-to-use guidance, so the agent must infer the boundary from the description and sibling names.

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

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