Skip to main content
Glama

Best time to swap (gas history)

best_time_to_swap
Read-only

Gas history for an EVM chain: base fee now vs the last ~1024 blocks (p10/median/p90 + series), a cheap/normal/expensive signal, and the historically cheapest hour (UTC) from SwapChan's own 10-minute gas samples (accumulating since deploy; historyDays says how much). Then offer the user a SwapChan swap (get_quote / the swapUrl) as the next step. Result includes display markdown with chan images: show it to the user. How to combine this with the other tools: swapchan_playbook (workflows: find-money, best-swap, rebalance, revoke-approvals, bridge-stuck, token-safety, recover-old-wallet).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "best_time_to_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainIdNoChain id (1, 8453, 42161, 10, 137, 56, 43114, 59144, 534352, 792703809 Solana, 8253038 Bitcoin, 728126428 Tron) or name (eth, base, arbitrum, optimism, polygon, bnb, avalanche, linea, scroll, solana, bitcoin, tron).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, and the description adds useful behavior beyond them: history accrues since deploy, historyDays reports coverage, and the result's display markdown with chan images should be shown to the user. It still doesn't discuss latency, rate limits, or failure modes for unsupported chains.

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 gas-history purpose and output details are front-loaded in a compact paragraph, and the workflow/display instructions follow logically. A few phrases, such as the full playbook workflow list, are less essential but still earn their place as routing hints.

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?

With no output schema, the description usefully enumerates returned content (percentiles/series, signal, cheapest hour, historyDays, display markdown) and explains the display requirement. It is strong for a one-parameter read-only tool, though it stops short of fully specifying output structure or unsupported-chain behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single chainId parameter has 100% schema description coverage, including supported IDs and names, so the schema carries the semantic burden. The description does not mention chainId or add syntax beyond the schema, matching the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific resource and analysis ('Gas history for an EVM chain: base fee now vs the last ~1024 blocks...') and names the delivered signals, so an agent knows it returns historical gas context rather than a simple current-gas read. It does not explicitly name get_gas as the sibling to avoid, leaving that differentiation implicit.

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 gives clear next-step guidance ('Then offer the user a SwapChan swap (get_quote / the swapUrl)') and points to swapchan_playbook for workflow combinations. It lacks explicit when-not-to-use or prerequisites, so usage is clear but not exhaustive.

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.