Skip to main content
Glama

Beancount.io

Update Entry Source

updateEntrySource
Destructive

Replace one entry's source text with newContent, addressed by the entry_hash listLedgerEntries returns (as entryHash or entry_hash) and sha256sum from getEntryContext. The commit message is composed from the operation; there is no message argument. Returns the entry's new hash as newEntryHash; the request's hash is stale after the commit. A replacement that would take a free ledger past its directive limit is RESOURCE_LIMIT_REACHED. A write that would add a bean-check error the ledger did not have is refused with VALIDATION_FAILED naming each new error — lone imbalance refuses as UNBALANCED with the residual; pass allowInvalid: true to commit it anyway. dry_run previews without committing.

Input Schema

NameRequiredDescriptionDefault
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_runNoRun every check and return the preview without committing
entryHashNoThe entry's hash.
sha256sumYes
entry_hashNoAlias of entryHash, as list output spells it.
newContentYes
allowInvalidNoCommit even when the write would add bean-check errors (VALIDATION_FAILED with newLedgerErrors), instead of refusing it.
allow_invalidNoAlias of allowInvalid.

Output Schema

NameRequiredDescriptionDefault
okYes
errorNo
resultNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • addedInput schema / properties / allow_invalid
      Added value: +{
      +  "description": "Alias of allowInvalid.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / dryRun
      Added value: +{
      +  "description": "Alias of dry_run, as REST and GraphQL spell it.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "description": "Run every check and return the preview without committing",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / entryHash / description
      Added value: +"The entry's hash."
    • addedInput schema / properties / entry_hash
      Added value: +{
      +  "description": "Alias of entryHash, as list output spells it.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "entryHash",
      -  "sha256sum",
      -  "newContent"
      -]New value: +[
      +  "sha256sum",
      +  "newContent"
      +]
    • addedOutput schema / properties / result / properties / dry_run
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / result / properties / preview
      Added value: +{
      +  "description": "Per-file affected text; populated on dry runs only.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "path": {
      +        "type": "string"
      +      },
      +      "text": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "path",
      +      "text"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / result / required
      Previous value: -[
      -  "summary",
      -  "message",
      -  "entryHash",
      -  "newSha256sum",
      -  "newEntryHash",
      -  "wrote",
      -  "entryHashes",
      -  "validation"
      -]New value: +[
      +  "summary",
      +  "message",
      +  "entryHash",
      +  "preview",
      +  "newSha256sum",
      +  "newEntryHash",
      +  "dry_run",
      +  "wrote",
      +  "entryHashes",
      +  "validation"
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With destructiveHint=true and idempotentHint=false already declared, the description still adds substantial context: the commit message is auto-composed with no message argument, the returned hash invalidates the request's hash, and the specific error codes (RESOURCE_LIMIT_REACHED, VALIDATION_FAILED, UNBALANCED) are enumerated with their trigger conditions and the allowInvalid escape hatch.

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-loads the operation and addressing scheme, then layers error semantics. Dense and information-rich, though several clauses are packed into long sentences that could be split for faster scanning.

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?

For a destructive write with a complex validation model, the description covers addressing inputs, return value, hash staleness, the two failure classes and overrides, and the dry-run preview. An output schema exists, so return-shape explanation is not required beyond the newEntryHash note.

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?

At 78% schema coverage the schema already documents most parameters, yet the description adds real meaning: where sha256sum and entryHash come from, the alias relationships, and the refuse-vs-allowInvalid behavior tied to that parameter. It does not mention the ledger parameter's unpinned-credential default, leaving one documented 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 specific verb and resource ('Replace one entry's source text with newContent') and names the addressing inputs from specific sibling tools, which distinguishes it from deleteEntrySource, addLedgerEntries and appendLedgerText without needing 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?

Explains the addressing workflow (hash from listLedgerEntries, sha256sum from getEntryContext) and when to use dry_run or allowInvalid, giving clear operating context. It lacks an explicit 'use X instead when...' contrast against delete/add sibling tools, so it stops short of 5.

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.