Skip to main content
Glama

Preview event block

preview-event-block
Read-onlyIdempotent

Dry-run: resolve the matching handler and evaluate the transaction template without writing any rows. Returns the matched handler + planned debit/credit lines + any validation errors. Use this before create-event-block(apply_handlers=True) to confirm the GL plan.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "amount": 250000,
      "source": "quickbooks",
      "agent_id": "ent_customer_acme",
      "currency": "USD",
      "metadata": {
        "terms": "net_30",
        "invoice_number": "INV-2026-0421"
      },
      "event_type": "invoice_issued",
      "description": "April consulting retainer — Acme Corp",
      "event_class": "economic",
      "external_id": "qb_inv_4521",
      "occurred_at": "2026-05-01T14:30:00Z",
      "external_url": "https://app.qbo.intuit.com/app/invoice?txnId=4521",
      "dimension_ids": [
        "dim_dept_consulting"
      ],
      "resource_type": "services",
      "event_category": "sales"
    },
    "name": "preview-event-block"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountNoEconomic value of the event in **cents** of `currency`, signed. Sign convention follows the perspective of the entity that owns the graph: inflows positive, outflows negative. `null` for non-economic events (e.g. `event_class='support'`).
sourceYes'manual' | 'system' | 'schedule', a connected provider name (e.g. 'quickbooks'), or a source_name registered via an 'external' connection. Validated against the graph's registered connections.
agent_idNoID of the counterparty agent (customer, vendor, employee, lender) involved in the event. `null` for internal-only events.
currencyNoISO 4217 currency code for `amount`.USD
due_dateNoWhen an obligation falls due: an `invoice_issued` or a `bill_received`. Give it, or `terms_days`; with neither, the obligation is due on receipt. Refused on any other event type.
metadataNoFree-form payload, opaque to the event surface. When `apply_handlers=True`, the matched handler's metadata schema validates this dict — required keys depend on the handler registered for `event_type`. Use `preview-event-block` to discover the expected shape without writing.
entity_idNoThe entity whose books the event lands in, by id; every GL row its handler writes follows it. Omit for the group parent.
event_typeYesOpen vocabulary: 'invoice_issued' | 'contract_signed' | 'bank_transaction' | ...
terms_daysNoNet terms in days from `occurred_at` (30 for net 30), in place of `due_date`. Only on an `invoice_issued` or a `bill_received`.
descriptionNoFree-text human-readable summary of the event.
document_idNoThe stored document this event rests on, as evidence: the invoice PDF, the vendor bill, the receipt photo (upload it with create-document-upload and complete-document-upload). Must be a document on this graph. While the event is live, the document cannot be deleted.
event_classNoREA event class. 'economic' events change resources and drive GL postings; 'support' events are audit-trail / value-chain primitives (typically captured with apply_handlers=False).economic
external_idNoSource-system dedup key. (source, external_id) is enforced unique when external_id is provided, so retries from external adapters are idempotent at the DB level.
occurred_atYesWhen the event happened in the real world
effective_atNoAccounting recognition date, if different from occurred_at
event_actionNoCanonical action verb refining `event_category`. Disambiguates concepts ERPs collapse: `transferAllRights` (ownership transfer, no physical movement) vs `transferCustody` (physical only, no rights transfer) — load-bearing for consignment, drop-shipping, marketplace settlement, escrow. Optional; null is valid for legacy events and during adapter rollout.
external_urlNoDeep link back to source-system record
dimension_idsNoManagement dimension members tagging this event (department, class, location, project), one per axis. Every line its handler writes carries them on the axes the line does not tag itself.
resource_typeNoREA resource kind being exchanged. One of: `goods`, `services`, `money`, `right`, `obligation`, `information`, `labor`.
apply_handlersNoWhen True, resolves the event_type to a handler (Python registry first, then DSL) and fires it atomically with event creation.
event_categoryYesREA classification. Economic categories (sales, purchase, financing, payroll, treasury, adjustment, recognition, other) require event_class='economic'. Support categories (control, approval, reconciliation, inquiry) require event_class='support'. The DB CHECK rejects mismatched pairings.
source_versionNoThe source's revision of this record: a number that only grows, such as a revision counter or a last-modified timestamp. It matters for a `journal_entry_recorded` event from the external ledger that keeps the entity's books (a connection registered with `ledger`): sending the same `external_id` again with a higher version replaces the entry in the books, in an open period. An equal or lower version, or none, is the 409 of a repeat delivery. From any other source it is stored and has no effect.
discharges_event_idNoSettlement link: the obligation this event discharges (e.g. cash_received pointing at the originating sale_invoiced).
resource_element_idNoID of the specific element being exchanged, when known (e.g. the cash account for a treasury movement, the inventory item for a sale).
obligated_by_event_idNoForward-materialization link: the event that scheduled or obligated this one (e.g. depreciation entries point at the asset_acquired event).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and idempotentHint=true, so the safety profile is covered. The description adds real value beyond them by stating that no rows are written, that handler resolution and template evaluation both occur, and what comes back — matched handler, planned debit/credit lines, validation errors. It stops short of covering permissions or side effects of handler resolution (e.g., whether a handler lookup can create registry state).

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 short sentences, each doing distinct work: what it does, what it returns, and when to reach for it. The dry-run framing is front-loaded and there is no redundant restatement of the tool name or title.

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?

This is a 25-parameter tool with a rich schema and no output schema, and the description fills exactly that gap by enumerating the return payload (matched handler, planned lines, validation errors). Combined with the explicit no-write guarantee, an agent has everything needed to call it correctly and interpret the result.

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?

With 25 parameters at 100% schema description coverage, the schema already carries the per-field meaning, so the baseline of 3 applies. The description adds no parameter-level guidance of its own — notably it does not say that apply_handlers must be false (or is ignored) on a preview call, which is the one input interaction worth clarifying.

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?

The description leads with 'Dry-run: resolve the matching handler and evaluate the transaction template without writing any rows' — a concrete verb plus resource plus scope. It clearly separates this tool from the mutating sibling create-event-block, so an agent can distinguish the two without opening either 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?

It gives an explicit usage rule: 'Use this before create-event-block(apply_handlers=True) to confirm the GL plan,' naming both the alternative and the condition that selects it. There is no explicit when-not guidance (e.g., do not call once the plan is already confirmed), which keeps it just short of the top mark given the number of preview-* siblings.

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.