Skip to main content
Glama

set_secret

Set or merge write-only secrets for a service; returns only key names so agents can configure credentials without reading stored values.

Instructions

Set/merge write-only secrets for a service; returns key names only.

    WARNING: the values you pass here transit this agent's transcript in
    plaintext; for high-value shared keys (broadly-scoped API keys,
    credentials shared across every app) prefer ``nerdit secrets set --shared`` from the CLI
    instead of routing them through an agent. The leak-free path for any
    value: a human runs ``nerdit secrets set <service> --prompt KEY``
    (hidden input) and you only ever name ``KEY``; it is injected at
    launch, overriding an ``env`` key of the same name. You may set secrets
    before the service exists; the name is then reserved for your token
    until you deploy it (another token's deploy of that name gets 409
    ``service.name_claimed``).
    

Input Schema

NameRequiredDescriptionDefault
valuesYesKEY → value pairs merged into the stored set: a listed key is overwritten, an unlisted one kept. Key names are env-var identifiers (``[A-Za-z_][A-Za-z0-9_]*``); a value may be multi-line but may contain no NUL and no control character other than tab/newline/CR. An empty map is refused.
serviceYesService (app, model or database) whose secrets this call modifies — need not exist yet: a set on an undeployed name reserves it for this token until deployed — or ``shared`` for the global scope (set: unscoped submitter or admin; delete: admin), read by a service only where a ``${secrets.shared.KEY}`` reference is honoured (``ai``/``db``/``edge_auth`` refs, a git ``token_ref``), never via ``env``.
idempotency_keyNoCaller-chosen key: a retry with the same key replays the first result instead of acting twice. Omit and a fresh key is minted per call, so each call acts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/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 so: it discloses that values are plaintext in the transcript, that storage is write-only, that merges overwrite listed keys and keep unlisted ones, that deployment injects the secret overriding an env key of the same name, and that only key names come back. This is unusually complete risk and side-effect disclosure for a mutation tool.

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 core verb and return contract before any warnings. The warning block is long and partly reads as CLI advocacy, but each sentence carries a distinct risk or escape hatch, so little is genuinely redundant.

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?

No output schema exists, yet the description states the return (key names only). For a mutation tool with no annotations and nested value objects, it covers safety, scope, merge behavior, failure mode and alternative paths, leaving nothing an agent needs before calling it.

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 parameters, key-name regex, value character restrictions, empty-map rejection, the ``shared`` scope and idempotency replay are all already documented in the schema. The description adds context about injection overriding env keys but does not extend parameter meaning beyond what structured fields provide, 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 ("Set/merge write-only secrets for a service") plus the return contract ("returns key names only"). The merge semantics and write-only nature distinguish it from siblings such as set_variable, remove_secret and list_secret_names 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?

Explicitly routes the agent away from this tool for high-value shared keys, naming the exact alternative (``nerdit secrets set --shared``) and the leak-free human path (``--prompt KEY`` with hidden input). It also states that pre-deploy reservation is allowed and what conflict (409 ``service.name_claimed``) to expect.

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