Skip to main content
Glama

Create event block

create-event-block
Destructive

Persist a real-world business event. apply_handlers=False (default): capture-only, status='captured'. apply_handlers=True: resolves an event_handler, fires the template, creates GL entries atomically, status='classified'. Use preview-event-block to dry-run before committing. For journal_entry_recorded, whether the entry writes back to a connected source system follows source (schedule/manual publish; system does not) unless metadata.publish_to_source says otherwise — set it false for an alignment entry mirroring a change already made upstream, which would otherwise be applied twice. An invoice_issued or bill_received takes due_date, or terms_days (net N from occurred_at); with neither it is due on receipt. A later due date is a field correction on update-event-block.

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": "create-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.5/5.0
Behavior4/5

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

The annotations already declare destructiveHint=true, readOnlyHint=false and idempotentHint=false, so the description adds real value beyond them: atomic handler execution and GL creation, the resulting status values, handler metadata validation, and a substantive double-application hazard (publish-to-source on alignment entries). It does not discuss what an un-handled or failed write leaves behind, so it stops short of full behavioral coverage.

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-loaded with the core mode distinction and dense with decisions, with no filler sentences. The journal_entry_recorded clause is a single run-on sentence with parenthetical digressions, which costs some readability.

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 25-parameter write surface with a nested free-form metadata object and no output schema, the description covers the decisions an agent must get right: mode selection, dry-run, settlement terms, upstream write-back, and correction routing. What remains unaddressed is the response shape (e.g. returned event id/status) and failure/rollback behavior.

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 100%, so the baseline is 3, but the description adds cross-parameter rules the schema states only piecemeal: the apply_handlers mode split, the due_date/terms_days/'due on receipt' precedence, and the metadata.publish_to_source convention for journal_entry_recorded, which the free-form metadata property cannot express. With 25 parameters it does not touch every field, but the consequential ones are covered.

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 opening sentence names a specific verb and resource ("Persist a real-world business event") and then splits the tool into its two concrete modes, capture-only vs handler-fired, each with the resulting status. It also names the sibling it complements (preview-event-block) and the sibling that owns a related change (update-event-block), so an agent can place it without opening 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit when-to-use guidance for the apply_handlers flag (default capture-only, True to fire a handler and post GL entries) and an explicit pre-commit step ("Use preview-event-block to dry-run before committing"). It also routes a nearby case away from this tool: a later due date is a field correction on update-event-block.

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.