Skip to main content
Glama

cfg_set

Edit live config records atomically by dotted path; append or remove array values and preview changes with dry run.

Instructions

Partial edit: set fields by dotted path, append to / remove from arrays. Computed from the current live doc atomically (no read needed; a concurrent write returns stale_base, just rerun). Drift-guarded and versioned. dry_run=true previews the delta and references.

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": {
      "record": "<record>",
      "assignments": "<assignments>",
      "message": "<message>"
    },
    "name": "cfg_set"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNoEnvironment name from .cfg.toml (e.g. dev, prod). Selects the target database.dev
authorNoAuthor attribution hint. Ignored/rejected in authenticated/enforced identity modes where a verified identity is required.
recordYesRecord address as collection:id, e.g. agent_configs:refund_resolution.
dry_runNoPreview the change and return the would-be result without writing anything.
messageYesWhy you are making this change (stored in history).
assignmentsYesEdits as a dotted-path→value map (e.g. {"enabled": true, "retry.max": 3}; preferred), a list of {field, value, op} objects (op: set | append | remove) or of "field=value" strings, or one "field=value other=value" string (each value is read as JSON when it parses, else as text). List edits in a map: {"orgs+=": "abc"} appends if absent, {"orgs-=": "abc"} removes every match; a list value applies to each element. Dates/decimals as Extended JSON ({"$date": ...}).
config_fileNoOmit: the server uses the .cfg.toml it started with. A different path is refused unless the server runs with CFGIT_MCP_ALLOW_CONFIG_OVERRIDE=1.
no_validateNoSkip the collection validator for an emergency write (recorded in history). Off by default.
allow_secretNoAllow committing values that match secret-deny rules (logged). Off by default.
allow_type_changeNoAllow replacing a live datetime/decimal/ObjectId with a different type, e.g. an ISO string (logged). Off by default; send dates as {"$date": ...} instead.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.5

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well: it discloses atomic compute-from-live-doc semantics, named failure mode 'stale_base' with a prescribed retry, drift guarding, versioning, and that dry_run returns the would-be delta and references. It omits permission/identity requirements and the effect of the validator and secret-deny paths, which live only in the schema field text.

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?

Four compact sentences, front-loaded with the operation type and then layering atomicity, error handling, and preview behavior in a logical order. Every sentence carries information; only the trailing 'dry_run=true previews the delta and references' mildly duplicates schema text.

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 ten-parameter mutation tool with a full schema and an output schema, the description covers the risky, non-obvious parts: atomicity, concurrency failure and retry, drift guarding, and preview mode. Remaining gaps (return payload shape, history entry creation) are covered by the output schema and the message parameter's own description.

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 ten parameters, including the elaborate assignments grammar, are already fully documented in structured fields. The description restates the dotted-path editing and dry_run preview in one clause but adds no syntax or format detail beyond the schema, which is the correct baseline-3 outcome.

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 opening 'Partial edit: set fields by dotted path, append to / remove from arrays' states a specific operation and the exact editing model, which is far more precise than a bare 'set'. It never names a sibling (e.g. cfg_commit or cfg_bulk_commit) for contrast, so the agent must infer the boundary from names alone.

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 through the atomicity note ('no read needed; a concurrent write returns stale_base, just rerun') and the dry_run preview path, which tells the agent how to call it safely. It gives no explicit guidance on when to choose cfg_set over cfg_commit, cfg_bulk_commit, or cfg_rm, so the selection decision among write siblings is left implicit.

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