Skip to main content
Glama

Sign OPA bundle

opa_bundle_sign
DestructiveIdempotent

Signs an OPA bundle directory in place by writing .signatures.json, so the bundle can later be verified with OPA.

Instructions

Sign a bundle directory with opa sign. A directory is signed in place: .signatures.json is written into it. OPA 1.23 and later name the files relative to the bundle root, the folder holding .manifest, so the directory can be moved or renamed; earlier versions name them <directory name>/<file>, so it must keep its name. Either way it verifies with opa_bundle_verify, or with opa build or opa run --bundle <name> from its parent, under an OPA on the same side of 1.23 as the one that signed it. A directory whose .manifest sits in a subfolder is refused under OPA 1.23 and later, which roots the bundle there. An archive is refused: OPA reads the signature from inside it, so a signed archive comes from opa_bundle_build with signingKey. The key is a PEM private key (RSA or ECDSA); for HMAC algorithms pass a file holding the secret. Extra claims such as keyid and scope come from claimsFile. Returns the path written, the algorithm, and the number of files covered.

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": {
      "bundle": "<bundle>",
      "signingKey": "<signingKey>"
    },
    "name": "opa_bundle_sign"
  }
}

Input Schema

NameRequiredDescriptionDefault
bundleYesPath to a bundle directory. Must be inside an allowed root. An archive is refused, since OPA reads the signature from inside it; build a signed archive with `opa_bundle_build` and `signingKey`.
claimsFileNoPath to a JSON file of extra claims to sign, such as {"keyid": "...", "scope": "..."}. Must be inside an allowed root.
signingAlgNoSigning algorithm: RS256 (default), RS384, RS512, PS256, PS384, PS512, ES256, ES384, ES512, HS256, HS384, HS512.
signingKeyYesPath to the PEM private key (RSA or ECDSA), or for HMAC algorithms a file holding the secret. Must be inside an allowed root.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.0
    • changedInput schema / properties / bundle / description
      Previous value: -"Path to a bundle directory or `.tar.gz` archive. Must be inside an allowed root."New value: +"Path to a bundle directory. Must be inside an allowed root. An archive is refused, since OPA reads the signature from inside it; build a signed archive with `opa_bundle_build` and `signingKey`."
    • removedInput schema / properties / outputDir
      Removed value: -{
      -  "description": "For an archive, the directory that receives `.signatures.json`; defaults to the archive's own directory. Must exist and be inside an allowed root. Not accepted for a directory bundle, which is signed in place.",
      -  "type": "string"
      -}
  2. Changed5 schema fields changedv0.5.0
    • changedInput schema / properties / bundle / description
      Previous value: -"Path to a bundle directory or archive. Must be in an allowed root."New value: +"Path to a bundle directory or `.tar.gz` archive. Must be inside an allowed root."
    • changedInput schema / properties / claimsFile / description
      Previous value: -"Path to extra claims to include in the signature."New value: +"Path to a JSON file of extra claims to sign, such as {\"keyid\": \"...\", \"scope\": \"...\"}. Must be inside an allowed root."
    • addedInput schema / properties / outputDir
      Added value: +{
      +  "description": "For an archive, the directory that receives `.signatures.json`; defaults to the archive's own directory. Must exist and be inside an allowed root. Not accepted for a directory bundle, which is signed in place.",
      +  "type": "string"
      +}
    • changedInput schema / properties / signingAlg / description
      Previous value: -"Signing algorithm (e.g. RS256). Default: RS256."New value: +"Signing algorithm: RS256 (default), RS384, RS512, PS256, PS384, PS512, ES256, ES384, ES512, HS256, HS384, HS512."
    • changedInput schema / properties / signingKey / description
      Previous value: -"Path to the signing key."New value: +"Path to the PEM private key (RSA or ECDSA), or for HMAC algorithms a file holding the secret. Must be inside an allowed root."
  3. Addedv0.1.13
  4. Removedv0.1.5
  5. Addedv0.1.2
  6. Removedv0.1.1
  7. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (destructive, idempotent, non-read-only), the description discloses that the directory is modified in place by writing `.signatures.json`, that file naming depends on the OPA version relative to 1.23, and that this determines whether the directory may be moved or renamed. It also states the refusal conditions and key type expectations — substantial behavioral context the 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?

The critical facts (in-place write, refusal of archives, alternative tool) are front-loaded and information-dense. Some sentences are long and run together version behavior with verification guidance, and the archive-refusal point is duplicated from the schema's `bundle` description.

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?

Although there is no output schema, the description specifies the return contents (path written, algorithm, number of files covered). Combined with version semantics, refusal cases, key formats, and cross-tool routing, nothing an agent needs to call this correctly is missing.

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 all four parameters already document their meaning, including key formats and claims content. The description largely restates the schema's bundle/signingKey/claimsFile semantics with only marginal added framing; baseline 3 is appropriate where the schema does the heavy lifting.

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 opening sentence gives a specific verb and resource ("Sign a bundle directory with `opa sign`") and immediately contrasts with the archive case, which belongs to `opa_bundle_build`. An agent can distinguish this from `opa_bundle_verify` and `opa_bundle_build` without opening any schema.

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

Usage Guidelines5/5

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

It explicitly routes the agent: archives are refused, use `opa_bundle_build` with `signingKey` instead; verification goes through `opa_bundle_verify`, `opa build`, or `opa run --bundle`. It also states the OPA-version compatibility rule that must hold between signing and verifying, and the subfolder-manifest refusal case.

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