Block Info
Overview
| Tool | Function | Use Case |
|---|
| getLatestBlock | Latest block | Block number, hash, size, timestamp, witness, tx count |
| getBlocks |
Block list | Pagination, sort, filter by producer/time |
| getBlockStatistic | Block statistics | 24h payment total, block count, burn total |
Use Cases
- 1. Latest Block: Use
getLatestBlock for current block number, hash, size, timestamp, witness, tx count. - Block Reward: Reward info can be derived from block data or chain params; block list gives block-level data.
- Block Time / Producer: Use
getLatestBlock or getBlocks for timestamp and witness (producer). - Burned TRX: Use
getBlockStatistic for 24h burn total; per-block burn may be in block payload. - Resource Consumption: Block-level resource use is reflected in block size and tx count; use
getBlockStatistic for aggregates. - Transaction Count: Use
getLatestBlock for tx count in latest block; use getBlocks for multiple blocks. - Network Load: Combine
getLatestBlock, getBlocks, and getBlockStatistic for real-time load view.
MCP Server
Tools
getLatestBlock
- - API:
getLatestBlock — Calls /api/block/latest; returns latest solidified block (number, hash, size, timestamp, witness, tx count) - Use when: User asks for "latest block", "current block", or "block height".
- Response: number, hash, size, timestamp, witness, tx count, etc.
- Note:
/api/block/latest does not return witnessName, fee, energyUsage, blockReward, voteReward, confirmations, netUsage. These may appear as 0 or null in the response—ignore them. For witness name, block reward, fees, or resource usage, use getBlocks instead.
getBlocks
- - API:
getBlocks — Get block list with pagination, sort, filter by producer/time range - Use when: User asks for "recent blocks", "blocks by producer", or "blocks in time range".
- Input: limit, sort (e.g.
-number), optional producer address, start/end time.
getBlockStatistic
- - API:
getBlockStatistic — Get block statistics (24h payment total, block count, burn total) - Use when: User asks for "block stats", "24h blocks", or "burned TRX".
- Response: 24h payment, block count, burn total, and related aggregates.
Troubleshooting
- - MCP connection failed: If you see "Connection refused", verify TronScan MCP is connected in Settings > Extensions.
- API rate limit / 429: TronScan API has call count and frequency limits when no API key is used. If you encounter rate limiting or 429 errors, go to TronScan Developer API to apply for an API key, then add it to your MCP configuration and retry.
Notes
- - For "block reward", combine block data with
getChainParameters (Witness category) if reward rules are needed. - Real-time monitoring: poll
getLatestBlock and/or getBlockStatistic for load and burn. - INLINECODE27 may return 0/null for
witnessName, blockReward, voteReward, fee, energyUsage, netUsage, confirmations (underlying /api/block/latest does not provide them); use getBlocks when these fields are needed.
区块信息
概览
| 工具 | 功能 | 用途 |
|---|
| getLatestBlock | 最新区块 | 区块号、哈希、大小、时间戳、见证人、交易数量 |
| getBlocks |
区块列表 | 分页、排序、按生产者/时间筛选 |
| getBlockStatistic | 区块统计 | 24小时支付总额、区块数量、销毁总额 |
使用场景
- 1. 最新区块:使用 getLatestBlock 获取当前区块号、哈希、大小、时间戳、见证人、交易数量。
- 区块奖励:奖励信息可从区块数据或链参数中获取;区块列表提供区块级数据。
- 区块时间/生产者:使用 getLatestBlock 或 getBlocks 获取时间戳和见证人(生产者)。
- 销毁的TRX:使用 getBlockStatistic 获取24小时销毁总额;单区块销毁信息可能在区块负载中。
- 资源消耗:区块级资源使用体现在区块大小和交易数量中;使用 getBlockStatistic 获取聚合数据。
- 交易数量:使用 getLatestBlock 获取最新区块的交易数量;使用 getBlocks 获取多个区块的数据。
- 网络负载:结合 getLatestBlock、getBlocks 和 getBlockStatistic 获取实时负载视图。
MCP服务器
工具
getLatestBlock
- - API:getLatestBlock — 调用 /api/block/latest;返回最新固化区块(区块号、哈希、大小、时间戳、见证人、交易数量)
- 使用时机:当用户询问最新区块、当前区块或区块高度时。
- 响应:区块号、哈希、大小、时间戳、见证人、交易数量等。
- 注意:/api/block/latest 不返回 witnessName、fee、energyUsage、blockReward、voteReward、confirmations、netUsage。这些字段在响应中可能显示为0或null——请忽略。如需获取见证人名称、区块奖励、费用或资源使用情况,请改用 getBlocks。
getBlocks
- - API:getBlocks — 获取区块列表,支持分页、排序、按生产者/时间范围筛选
- 使用时机:当用户询问最近区块、按生产者查询区块或时间范围内的区块时。
- 输入:数量限制、排序方式(如 -number)、可选的生产者地址、开始/结束时间。
getBlockStatistic
- - API:getBlockStatistic — 获取区块统计信息(24小时支付总额、区块数量、销毁总额)
- 使用时机:当用户询问区块统计、24小时区块或销毁的TRX时。
- 响应:24小时支付总额、区块数量、销毁总额及相关聚合数据。
故障排除
- - MCP连接失败:如果看到连接被拒绝,请检查TronScan MCP是否已在设置>扩展中连接。
- API速率限制/429错误:未使用API密钥时,TronScan API有调用次数和频率限制。如果遇到速率限制或429错误,请前往TronScan开发者API申请API密钥,然后将其添加到MCP配置中并重试。
备注
- - 关于区块奖励:如果需要奖励规则,请将区块数据与 getChainParameters(见证人类别)结合使用。
- 实时监控:轮询 getLatestBlock 和/或 getBlockStatistic 获取负载和销毁数据。
- getLatestBlock 可能返回 witnessName、blockReward、voteReward、fee、energyUsage、netUsage、confirmations 为0或null(底层 /api/block/latest 不提供这些字段);当需要这些字段时,请使用 getBlocks。