Skip to main content
Glama

Update documents

update_documents

Change the due date on many documents in one call: every document a filter matches (the list_documents filters, and/or ids), up to 250. Use this, never save_document one by one, when the user asks to change due dates on several documents. Send duedate for a fixed date, or due_days for each document's own date plus N days. Call with dry_run=true first, tell the user how many documents would change, and apply once they confirm. Partial success: returns updated, skipped (already due on that date) and errors.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "update_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoOnly documents with a due date on/before this date (inclusive, ISO 8601; e.g. today to isolate bills due by now). Documents with no due date are kept.
idsNoOnly these document ids (up to 250). Combine with the filters to narrow further.
fromNoOnly documents with a due date on/after this date (inclusive, ISO 8601, e.g. "2026-01-01"). Documents with no due date are kept.
typeNoThe kind of document. One of: invoice — Bill a customer for goods or services. Money in.; quote — A pre-sale estimate for a customer; becomes money in once accepted.; recurring — An invoice that repeats on a schedule. Money in.; debit_note — Reduce what you owe a supplier (offsets a bill). Money in.; credit_note — Refund or reduce a customer's invoice. Money out.; purchase_order — Order goods or services from a supplier. Money out.; bill — A supplier's bill that you owe. Money out.; grn — Record stock received against a purchase order. Money out..
queryNoCase-insensitive substring match over the document's text (reference/number, name, notes, purchase order, contact and line items). Combine with type to jump straight to one document by its reference number, e.g. type=bill, query="4B66E86E-0286".
statusNoFilter to documents whose computed status matches (case-insensitive), e.g. "overdue", "due", "paid", "partiallypaid", "sent", "draft". Combine with type=bill for overdue-bill analysis.
unpaidNoWhen true, return only documents with an outstanding balance (excludes fully paid / zero-outstanding rows).
contactNoFilter to documents for this contact id (a client or supplier).
dry_runNoWhen true, change nothing: return how many documents would change and which. Call with dry_run first, tell the user the count, and apply once they confirm.
duedateNoSet every matched document's due date to this date (ISO 8601, e.g. "2026-11-30"). Send this or due_days.
currencyNoFilter to documents in this currency (ISO 4217 code, e.g. "USD", "ZAR"). Documents with no stored currency are excluded when set.
due_daysNoSet each matched document's due date to its own document date plus this many days, e.g. 30. Send this or duedate.
directionNoMoney direction filter: "in" for sales documents (invoices, quotes, debit notes), "out" for purchase documents (bills, POs, credit notes, GRNs).
repeatingNoWhen true, return only the documents whose repeat schedule is on: each live series' template. Generated copies and stopped series are left out. Pass a row's id to set_recurring_invoice to stop or change that series.
min_outstandingNoOnly documents whose outstanding balance is at least this amount (inclusive).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false; the description adds real behavioral context beyond that — the 250-document cap, the dry_run preview behaviour, and the partial-success return shape (updated / skipped already-due / errors). It does not cover permissions or whether changes can be undone, so it stops short of a 5.

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?

Front-loaded with the core action and scope, then alternatives, then the dry_run protocol, then the return shape. Five sentences, none redundant, no marketing filler.

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 15-parameter bulk mutation with no output schema, the description covers the essentials: how to select targets, how to set dates, the preview step, and the result structure. It never addresses what happens to documents that lack a due date on write (the schema hints they are kept for filters) or any permission prerequisites, which keeps it from a 5.

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 the baseline is 3. The description does clarify the duedate-vs-due_days choice and that 'from'/'to'/'query' are the list_documents filter set, but both semantics are already spelled out in the schema, so it adds little unique meaning.

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 ('Change the due date on many documents in one call') and delimits scope precisely: every document a filter matches, up to 250. It is immediately distinguishable from save_document (single-document writes) and list_documents (whose filters it explicitly reuses).

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?

Gives explicit routing: 'Use this, never save_document one by one, when the user asks to change due dates on several documents', names the alternative and the condition that selects it, and prescribes a dry_run-first confirmation workflow.

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.

Resources