Skip to main content
Glama

cfg_commit

Replace a full config record with drift-guarded, versioned commits: read the live record first, edit it, then pass its oid to prevent overwriting newer changes; use dry_run to preview.

Instructions

Replace a record with a full document (drift-guarded, versioned). Read it first with cfg_show ref="=live", edit that doc, and pass its oid as expected_live_oid. dry_run=true returns state="would_commit" with the field-level delta (on a branch: against the branch's current draft), the records and code that reference this record, and writes nothing.

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>",
      "doc_json": "<doc_json>",
      "message": "<message>",
      "expected_live_oid": "<expected_live_oid>"
    },
    "name": "cfg_commit"
  }
}

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.
branchNoCommit to this branch instead of main (branch commit; does not mutate runtime).
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).
doc_jsonYesThe FULL document (object or JSON string): commit replaces the whole record. Start from cfg_show ref="=live" (Extended JSON) and edit that. For a partial edit use cfg_set.
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.
expected_live_oidYes`oid` from the cfg_show ref="=live" you edited. If live changed since, the commit refuses with stale_base instead of overwriting the newer change. Required; pass null only when you deliberately overwrite without reading.
allow_remove_fieldsNoAllow the commit to delete top-level fields live has but doc_json leaves out. Off by default: a partial doc is refused with state fields_removed.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.5

TDQS

A4/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 drift-guarding semantics (a stale base is refused rather than silently overwriting), versioning/history, and exactly what dry_run returns (state="would_commit", field-level delta, referencing records and code) while writing nothing. It does not surface the destructive-adjacent opt-ins (allow_remove_fields, no_validate, allow_secret, allow_type_change) at the tool level, though those are documented per-parameter.

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, front-loaded with the operation and its safety model, then the required read-then-commit workflow, then the preview contract. No filler or restatement of the title.

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 13-parameter mutation with no annotations, the description covers the critical path (read-first, drift guard, dry-run preview) and an output schema exists to explain return shape. It is slightly thin on environment/branch implications and the safety opt-in flags, but nothing an agent needs to make a first correct call 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 description coverage is 100%, so every one of the 13 parameters is already documented, establishing a baseline of 3. The description reinforces expected_live_oid and dry_run with workflow context beyond the schema, but it adds no meaning for the remaining parameters and no syntax guidance for doc_json beyond what the schema already states.

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?

"Replace a record with a full document (drift-guarded, versioned)" gives a specific verb, resource, and write mode, so an agent knows this is a whole-document overwrite rather than a patch. The contrast with a partial-edit sibling (cfg_set) exists only inside the doc_json parameter description, not the tool description itself, so the top-level text alone doesn't fully route between the two.

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?

It prescribes a concrete prerequisite workflow: read with cfg_show ref="=live", edit that doc, then pass its oid as expected_live_oid. It also states when to use dry_run=true. It stops short of explicit when-not-to-use guidance at the tool level (e.g., bulk vs. single record, or branch vs. main), leaving those to parameter descriptions.

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