Close period
close-periodClose a fiscal period: post its drafts, lock it, and save its statements.
WHEN TO USE:
Month-end: the step that posts a period's drafts and locks the period
WHAT IT DOES (atomic):
Validates closeable gates (sequence, period complete, sync current)
Bulk-transitions all draft entries in the period to status='posted' (under a 'shadow' QuickBooks connection: to 'shadowed' instead — nothing posts or publishes, and the gates that would have blocked are returned as gate_findings rather than enforced)
Validates the BS equation balances for the period
Transitions the FiscalPeriod from open → closed
Advances closed_through; auto-advances close_target if reached
Pivots the posted ledger and stamps the period's canonical statement FactSets (balance sheet / income statement / cash flow) — closing IS the act that persists the month's statements. Re-closing replaces them. Soft-skipped (statements_stamped=false with a note) when the tenant has no CoA mapping yet.
Auto-runs the rule engine for every schedule Structure with facts in the closed period, and the statement rule corpus against the stamped sets. Rule outcomes ride on the response as
rule_summary/evaluated_structure_ids/statement_rule_summary, per schedule and statement.Emits a period_closed audit event
PARAMETERS:
period (required): YYYY-MM format (e.g., "2026-03")
entity_id (optional): the entity whose period to close; omit for the group parent. Each entity closes on its own calendar, so a subsidiary's close leaves its siblings open
allow_stale_sync (optional): lifts the sync-current gate, closing on QuickBooks data older than the freshness window.
allow_stranded_obligations (optional): lifts the stranded-obligation gate, closing without adjusting entries for matured classified obligations that have none drafted. promote-obligations (dispatch_handlers=true) drafts them.
allow_reconciling_items (optional): lifts the reconciling-item gate, closing with posted events still flagged as changed in the source system. resolve-reconciling-item settles each one.
allow_unposted_source_events (optional): lifts the unposted-source-event gate, closing without bank-feed lines or QuickBooks transactions dated in the period that were never committed; they stay out of the period.
allow_unreconciled_accounts (optional): lifts the reconciliation gate, closing although a reconciliation the close waits on is not reconciled for the period. refresh-reconciliations reports what does not tie.
allow_unexplained_residuals (optional): on the consolidation entity, lifts the group close's residual gate; each difference stays in the consolidated statements and is named in the audit note.
allow_held_bank_lines (optional): lifts the held-bank-line gate, closing although bank lines a sync held out of an earlier closed month are undecided; each is recorded as decided by this close and none posts.
RETURNS:
Two shapes. Usually the receipt below, returned once the close lands. If the
close is still running when this call's budget runs out, you instead get
status: "in_progress" with an operation_id and worker_started (see
NOTES). That is not a failure and not a timeout: the close is running on
the worker and is atomic.
The receipt:
period: the period that was closed
entries_posted: TOTAL drafts transitioned to posted, across both post paths; entries_published_to_qb / entries_posted_locally carry the split (drafts published to QuickBooks are promoted at publish time, before the local bulk transition)
target_auto_advanced: true if close_target moved forward after this close
fiscal_calendar: updated calendar state (same shape as get-fiscal-calendar)
rule_summary: aggregated rule-eval tally across every schedule Structure with facts in the closed period — keys: pass / fail / error / skipped. null when no schedules had facts in the period.
evaluated_structure_ids: ids of schedule Structures whose rules were evaluated. Pairs with rule_summary.
statements_stamped / statement_stamp_note: whether the close stamped the period's canonical statement FactSets (note carries the soft-skip reason, e.g. no_coa_mapping).
stamped_statement_sets: structure_id -> fact_set_id for the minted canonical sets; get-information-block renders them.
statement_rule_summary: verification tally across the stamped statements (pass / fail / error / skipped); null when no rules exist.
GATES (a 422 error names the gate):
the period is out of sequence
the period is the current, still-open month
the QuickBooks sync is stale (lifted by allow_stale_sync)
stranded obligations: matured and classified, with no drafted entry (lifted by allow_stranded_obligations)
unresolved reconciling items: posted events whose source payload changed afterwards (lifted by allow_reconciling_items)
source events dated in the period that were never committed: inbox lines, QuickBooks transactions whose automatic posting failed (lifted by allow_unposted_source_events)
a reconciliation the close waits on is not reconciled for the period, or was never compared for it (lifted by allow_unreconciled_accounts)
bank lines a sync held out of an earlier closed month, undecided (lifted by allow_held_bank_lines)
on the consolidation entity, the group close: every entity the month consolidates closed it; its consolidating entries posted or drafted; no residual or intercompany disagreement left (lifted by allow_unexplained_residuals); the consolidated statements pass
the balance sheet equation does not balance for the period
NOTES:
The close is dispatched to the worker and this call waits ~18s for it. An
in_progressresponse means it is running; get-period-close-status shows period_status closed and a filled close_receipt once it lands, and get-fiscal-calendar shows has_close_receipt on the period row.worker_started: falsemeans it is queued behind a busy worker. A repeat call within 30s returns the same operation (deduplicated: true).Posted entries cannot be re-drafted; reopen-period undoes a close
Manual entries (drafted via create-event-block event_type='journal_entry_recorded') are posted alongside schedule drafts
Which drafts write back to QuickBooks follows the event's source (schedule/manual publish; system posts locally), unless metadata.publish_to_source overrides it per entry. list-period-drafts previews the split
After close, close_target auto-advances to the next period
The close runs on the worker, so a slow QuickBooks publish can outlast this call. The work is unaffected by that — only who is waiting for it
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"period": "<period>"
},
"name": "close-period"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Optional note captured in the audit event | |
| period | Yes | Fiscal period in YYYY-MM format | |
| entity_id | No | The entity whose books this acts on, by id (get-graph-info lists them). Omit for the group parent. | |
| allow_stale_sync | No | Lift the sync-current gate (default false), closing on QuickBooks data older than the freshness window. | |
| allow_held_bank_lines | No | Override the held-bank-line gate (default false). Closes although bank lines a sync held out of an earlier closed month are undecided; each is recorded as decided and none posts. Prefer reopening the month they are dated in. | |
| allow_reconciling_items | No | Override the reconciling-item gate (default false). Closes over posted events still flagged as changed in the source system, leaving those differences undecided; the override is recorded in the close audit note. | |
| allow_stranded_obligations | No | Override the stranded-obligation gate (default false). Closes over matured classified obligations that have no drafted closing entry, knowingly omitting them; the override is recorded in the close audit note. | |
| allow_unexplained_residuals | No | On the consolidation entity, close the group month although a residual or intercompany disagreement is left unexplained. | |
| allow_unreconciled_accounts | No | Override the reconciliation gate (default false). Closes although a reconciliation the close waits on is not reconciled for the period; the override is recorded in the close audit note. | |
| allow_unposted_source_events | No | Override the unposted-source-event gate (default false). Closes over source events dated in the period that were never committed, leaving them out of the period; the override is recorded in the close audit note. |