Skip to main content
Glama

Beancount.io

Update Ledger Files

updateLedgerFiles
DestructiveIdempotent

Change existing text files in one atomic commit: per file, either replace an exact text (old_string must appear exactly once) with new_string, or overwrite the whole file with content (pass its sha from readLedgerFiles to refuse it if the file changed since). Several items for one file apply in order, each to the text the previous one produced. Each new/resulting file is limited to 1 MiB of UTF-8 bytes, including dry runs. dry_run previews without committing: the same refusal as the commit, plus a unified diff per touched file and bean-check's verdict over the projected contents.

Input Schema

NameRequiredDescriptionDefault
filesYes
dryRunNoAlias of dry_run, as REST and GraphQL spell it.
ledgerNoTarget ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.
dry_runNoIf true, validates all operations and returns a preview without committing.
messageNoAlias of description, as REST and GraphQL spell it.
descriptionNoOne sentence describing what these changes do. Shown to the user for approval and used verbatim as the commit message.

Output Schema

NameRequiredDescriptionDefault
okYes
errorNo
resultNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / dryRun
      Added value: +{
      +  "description": "Alias of dry_run, as REST and GraphQL spell it.",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / dry_run / default
      Removed value: -false
    • addedInput schema / properties / message
      Added value: +{
      +  "description": "Alias of description, as REST and GraphQL spell it.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "description",
      -  "files"
      -]New value: +[
      +  "files"
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With annotations already declaring destructive=true and idempotent=true, the description adds substantial behavioral detail the annotations cannot convey: atomic commit semantics, the old_string-must-appear-exactly-once rule, sequential application of multiple items to one file, the sha-based refusal on concurrent change, the 1 MiB UTF-8 limit, and exactly what dry_run returns (same refusals plus a unified diff and bean-check verdict). No contradiction with readOnlyHint=false / destructiveHint=true.

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?

Three dense sentences, front-loaded with the core action, and every clause carries real information. It is slightly over-packed with nested parentheticals, which costs a bit of readability, but there is no filler.

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?

The tool is a destructive mutation with six parameters and an output schema (return values need not be described). The description still covers atomicity, refusal conditions, size limits, ordering, and dry-run output, leaving no material gap for correct invocation.

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 already 83%, so parameters are largely self-describing; the description's added value is the ordering/chaining semantics ('several items for one file apply in order, each to the text the previous one produced') and the sha-guard purpose, neither of which is in the schema. It does not cover the dryRun/message/ledger alias parameters, which is a minor gap.

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 precise verb and resource — 'Change existing text files in one atomic commit' — and enumerates the two per-file modes (exact-text replacement vs. full overwrite). The word 'existing' implicitly distinguishes it from createLedgerFiles/deleteLedgerFiles, and the sibling readLedgerFiles is named as the source of the sha guard.

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?

Clearly explains how to choose between the two item shapes (old_string/new_string vs. content, with sha for optimistic concurrency) and when to use dry_run. It does not explicitly route away from appendLedgerText or createLedgerFiles, so the agent must infer those boundaries, but the operating context is unambiguous.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.