Skip to main content
Glama

Re-import historical activity

reimport_historical
Idempotent

Queues a historical import for the org over a chosen window: the worker lists the connected account's activity (Stripe charges/refunds/payouts, or Mercury transactions across all accounts) and feeds it through the same pipeline as live webhooks. Safe to call any time — it is idempotent: events already present (from live webhooks or an earlier import) are skipped, never duplicated, so the P&L and ledger are never double-counted. After import, a reconciliation sweep drains fully-settled Stripe payouts out of clearing once their matching Mercury deposit has imported. If the chosen window overlaps an already-completed import, the call returns an overlap_warning and does NOT queue unless confirm_overlap is true (the dedup guard still prevents any double-booking; this is a "did you mean to re-scan?" prompt). Returns the run state; poll get_financial_summary to watch progress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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
windowNoHow far back to import: 'last_90_days' (default), 'last_12_months', 'this_year', or 'all_available'.last_90_days
providerNoWhich connected provider to import. Defaults to Stripe.stripe
confirm_overlapNoSet true to proceed even when the window overlaps an already-completed import (skips the overlap warning).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceYes
queuedYes
statusYes
providerYes
overlap_warningYes
not_queued_reasonYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the idempotentHint annotation, the description reveals key behaviors: events already present are skipped, the P&L is never double-counted, an overlap_warning is returned unless confirm_overlap is true, and a reconciliation sweep may drain Stripe payouts from clearing. This adds substantial operational context beyond the structured annotations.

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 information-dense but every sentence earns its place: purpose, idempotency/safety, overlap behavior, side-effect sweep, and follow-up action. It is well-structured and front-loaded with the core purpose.

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?

The description covers what the tool does, when it is safe to call, edge cases, side effects, and how to monitor progress. With an output schema present, the return-value discussion is not necessary, and no critical operational details are missing.

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?

The schema already covers all parameters with descriptions, so the baseline is 3. The description adds meaningful context by explaining what happens on overlap, the purpose of confirm_overlap as a 'did you mean to re-scan?' prompt, and the data scope for providers. This exceeds minimal schema coverage.

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 clearly states the tool 'queues a historical import' over a chosen window and specifies the data sources (Stripe charges/refunds/payouts, Mercury transactions). It names the affected resource and distinguishes this as a re-import operation from the initial connect tools in the sibling list.

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 explicitly says 'safe to call any time', explains idempotency, and gives concrete guidance on overlap behavior with confirm_overlap. It also tells the agent to poll get_financial_summary for progress, but it does not explicitly contrast this tool with an alternative for live or initial sync.

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