Skip to main content
Glama

sops_add_metadata

Adds _meta_unencrypted metadata to an existing SOPS-encrypted file that lacks it, or records metadata for keys a partial block omits, then re-encrypts while preserving plaintext values.

Instructions

Add _meta_unencrypted metadata to an existing SOPS-encrypted file that lacks it, or describe the keys a partial block leaves out. secret_metadata must name exactly the keys the block doesn't describe (every key, for a file with no block); existing entries are kept and never replaced. Decrypts the file, adds metadata, and re-encrypts preserving original plaintext values. Requires a private key for the target domain.

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": {
      "encrypted_content": "<encrypted_content>",
      "secret_metadata": "<secret_metadata>"
    },
    "name": "sops_add_metadata"
  }
}

Input Schema

NameRequiredDescriptionDefault
domainNoName of the key domain to encrypt to / decrypt with. Optional. Defaults to the domain recorded in the file's _meta_unencrypted block, and failing that to 'default'. Call sops_list_domains to see what this server has configured.
secret_metadataYesMapping of key names to metadata. Each value has 'source' ('generated', 'external', or 'derived') and optional 'description'. For 'derived', also provide 'transform' and 'from'.
encrypted_contentYesContents of a secrets.enc.yaml file

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.0
    • addedInput schema / properties / domain
      Added value: +{
      +  "description": "Name of the key domain to encrypt to / decrypt with. Optional. Defaults to the domain recorded in the file's _meta_unencrypted block, and failing that to 'default'. Call sops_list_domains to see what this server has configured.",
      +  "type": "string"
      +}
  2. First observedv0.10.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses the decrypt/add/re-encrypt cycle, guarantees plaintext values are preserved, and states that existing entries are kept and never replaced (an important non-destructive property). It omits failure behavior when secret_metadata does not match the undescribed keys, and does not describe the return value.

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-loaded with the purpose, then constraints, then mechanics, and closing with the key requirement — a sensible order. Roughly four dense sentences with little waste, though the 'or describe the keys a partial block leaves out' phrasing is slightly elliptical and forces a re-read.

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 mutating, encryption-adjacent tool with no annotations and no output schema, the description covers the mutation path, the non-destructive guarantee, and the key prerequisite. The remaining gap is error/validation behavior and any indication of what a successful call returns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning the schema does not: secret_metadata must enumerate exactly the keys the block does not already describe, including every key when no block exists. That constraint is essential to invoking the tool correctly and is not derivable from the schema alone.

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 ('Add _meta_unencrypted metadata') and a precise scope ('an existing SOPS-encrypted file that lacks it'), which cleanly separates it from the sops_add_secrets / sops_create_* family that creates rather than annotates. An agent can tell what this does and what it does not without opening the schema.

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?

Gives clear triggering conditions: the file must already exist and lack the block, and the 'describe the keys a partial block leaves out' clause covers the secondary case. It also states the prerequisite ('Requires a private key for the target domain'). It stops short of naming an alternative tool or an explicit when-not (e.g., what to do for a file that already has a complete block).

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