Skip to main content
Glama

Close a period (unrealized FX revaluation)

close_period
Idempotent

Runs the month-end (period-end) close for an organisation: remeasures every open foreign-currency monetary balance (per-bank cash accounts whose currency differs from the home/reporting currency) to the period-end closing rate, and books the difference to 6750 Unrealized FX Gain/Loss — distinct from 6700 realized FX. Each revaluation entry SELF-REVERSES on the first day of the next period, so the next period opens at the original basis. This WRITES financial data. IDEMPOTENT: closing the same period_end twice is REFUSED (it fails rather than double-booking). VALIDATED: a period_end in the future (including the still-running current month) is REFUSED — closing is irreversible (no reopen flow), so only completed months can close; a period_end at or below the current closing watermark is REFUSED as already closed. SOFT CHECK (same as the web close): when unrecorded opening balances would be locked behind this close, the call returns closed: false with opening_balance_warnings and writes NOTHING — surface the warnings to the user and re-call with force: true to close anyway (the check itself fails open on provider outages). A home-currency-only org, or one with no open foreign balances, closes with revalued_account_count 0 and writes no entries. Accounts can be excluded individually via the per-account FX revaluation toggle. Returns the period_end, how many balances were revalued, and the classified_event ids of the revaluation entries (not their reversals).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoSet true to close even when the pre-close soft check flagged unrecorded opening balances (after surfacing the warnings to the user).
org_idNoOptional. Defaults to the organisation the authenticated API key is bound to, so you normally omit it and never need to ask the user for their organisation UUID. If provided, it must match the key’s org or the request is rejected.0e91146d-511c-469f-bdee-5c867b26ae0d
actor_idNoOptional. Defaults to the organisation entity (correct for an org-scoped key). If provided, it must be an entity belonging to this organisation — arbitrary UUIDs are rejected, so the audit trail cannot be attributed to someone else.
period_endYesThe period-end date to close, ISO 8601 (YYYY-MM-DD). A period is a calendar month, so this MUST be a month-end (the last day of a month, e.g. 2026-06-30); a mid-month date is rejected.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
closedYes
entry_idsNo
period_endYes
revalued_account_countNo
opening_balance_warningsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

The description goes far beyond the annotations by disclosing that the operation WRITES financial data, is irreversible with no reopen flow, self-reverses entries next period, refuses double closes, and writes nothing when the soft check trips. It even notes provider-outage fail-open behavior. No contradiction with readOnlyHint=false, idempotentHint=true, or destructiveHint=false is present.

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?

The description is long, but every sentence earns its place for a tool this nuanced. It is front-loaded with the core operation, then structured with labeled sections (IDEMPOTENT, VALIDATED, SOFT CHECK) that make complex behavior scannable. The parenthetical 'same as the web close' is minor and does not undermine the overall density of useful information.

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?

Given the tool's high complexity, the description is remarkably complete: it covers validation rules, idempotency, soft-check behavior, no-op scenarios, per-account exclusions, self-reversals, and return contents. The presence of an output schema further reduces the need to explain return structure, and the description still does so.

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, and the schema already documents all four parameters in detail. The description adds extra semantic value by reinforcing the period_end month-end constraint and explaining the force parameter's role in the soft-check bypass, though it does not add new meaning for org_id or actor_id.

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 opens with a specific verb and resource: 'Runs the month-end (period-end) close for an organisation.' It then explains the exact mechanism (remeasuring foreign-currency balances and booking to 6750 Unrealized FX Gain/Loss) and distinguishes this from realized FX, making it clear how this differs from related financial tools.

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?

The description gives explicit when-to-use and when-not-to-use guidance: only completed months can close; future/current months are refused; already-closed periods are refused. It also explains the soft-check flow, including how to respond (surface warnings, re-call with force: true) and the no-op case for orgs without foreign balances.

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