Skip to main content
Glama
trustxai

amazing-binance-mcp

by trustxai

binance_get_fiat_history

Read-onlyIdempotent

Retrieve complete fiat deposit, withdrawal, buy, and sell history across pages and time windows, with automatic paging, API-call budgeting, and a resume cursor for interrupted walks.

Instructions

Walk fiat deposit/withdraw or buy/sell history across pages and time windows.

Tries ONE call spanning beginTime=since .. endTime=now (or resume_before when resuming) and pages page until a short page signals the end. If that wide-span attempt fails with a plausibly span-related HTTP error (commonly -1127, an undocumented span cap on these two endpoints), falls back to walking 30-day windows newest-first instead.

Honors a max_calls budget so one invocation can never blow past the weight-limited call rate — deposits/withdrawals cost UID 45000/call (default budget 4, i.e. the whole 180000/min UID budget for a minute), buys/sells cost IP 1/call (default budget 20). Every request checks the budget first, and a request that itself errors still counts against it, since it still spent real quota.

The walk NEVER discards rows it already has: whenever it stops early — budget exhaustion or ANY request failure, span-related or not — it renders the normal report (rows collected so far, totals, call count) plus a resume_before cursor, and for a failure it also shows the underlying error (via handle_api_error) as a prominent line. Binance treats endTime as inclusive, so a re-fetched boundary row is expected; rows are deduped by orderNo before being returned. The cursor comes in two flavours, worded differently so one is never mistaken for the other: a redo cursor (the wide span, or the window in progress, was not fully covered — page order inside it is undocumented, so the whole thing must be retried) says it "re-covers the same range, it does not advance"; an advance cursor (every window up to it is fully covered; only the budget stopped a NEW window from starting) says rows "were not fetched" before it and to "continue" from there.

Status values Binance returns for fiat orders/payments: Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped.

When to Use:

  • A bulk backfill of fiat activity (deposits, withdrawals, or crypto buys/sells with fiat) since account creation, paged and budgeted automatically.

  • Continuing a previous walk that stopped early: pass its resume_before back in.

When NOT to Use:

  • A single narrow lookup — use binance_get_fiat_orders / binance_get_fiat_payments directly with your own begin_time/end_time; it is one call instead of many.

  • Binance Card spend — not retrievable via any API (see the module docstring); a "Credit Card" paymentMethod in buys/sells is a bank card, not the Binance Card.

Returns: Deduped rows sorted newest-first (display capped at 50, JSON keeps the full walked set), a per-fiat-currency total (and, for buys/sells, a per-crypto-currency received total), how many API calls were spent, whether the window fallback triggered, and — when the walk stopped early — a resume_before cursor plus (for a failure) the error that caused the stop.

Examples: params = {"kind": "deposits"} params = {"kind": "buys", "since": "2023-01-01"} params = {"kind": "withdrawals", "resume_before": 1700000000000}

Error Handling: A span-related HTTP error on the wide-span attempt triggers the 30-day-window fallback automatically. Any failure after that point — inside a window, or an auth/rate-limit/envelope/other error that was never span-related — stops the walk instead of raising: the response still shows the rows already collected, the API-call count, a resume_before cursor, and the failure itself via handle_api_error. A malformed since/resume_before returns Error: <field> must be epoch milliseconds or an ISO-8601 string before any call is made.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Despite annotations declaring readOnlyHint, idempotentHint, and destructiveHint, the description goes far beyond by disclosing the paging strategy, 30-day window fallback, max_calls budget mechanics (with per-call cost), deduplication by orderNo, the distinction between redo and advance cursors, and early-stop behavior that returns partial results plus a resume_before cursor. This is rich behavioral disclosure that fully informs the agent about side effects and failure modes.

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?

The description is comprehensive but lengthy; however, it is well-structured with clear sections (general behavior, When to Use, When NOT to Use, Returns, Examples, Error Handling) and front-loaded with the core behavior. Every sentence conveys meaningful information for a complex tool, so the length is justified, though a tighter edit could trim redundancy.

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?

For a tool with such complexity—paging, fallback logic, budget constraints, cursor semantics, deduplication, and error handling—the description covers all operational aspects: input parameters, expected returns (including totals, call count, cursor, and error details), example invocations, and detailed error handling behavior. Nothing an agent needs to correctly invoke and interpret results is 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 provides thorough descriptions for all parameters (kind, rows, since, max_calls, resume_before, response_format), so the baseline is high. The description adds valuable context beyond the schema: the cost per call for each kind (UID vs IP), default budget values, and the semantic meaning of the resume_before cursor (redo vs advance). It does not repeat schema details, only enriches them.

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 precise verb+resource: 'Walk fiat deposit/withdraw or buy/sell history across pages and time windows.' It explicitly distinguishes itself from sibling tools in the 'When NOT to Use' section by naming `binance_get_fiat_orders` and `binance_get_fiat_payments` for single narrow lookups. The purpose is unmistakable and well differentiated.

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?

A dedicated 'When to Use' section covers bulk backfills and resuming previous walks, while 'When NOT to Use' explicitly excludes single narrow lookups and Binance Card spend, naming alternatives. This is exemplary usage guidance with clear conditions and exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools