get-block-number
Retrieves current blockchain block numbers via Web3.py and environment-based RPCs.
Install
mkdir -p .claude/skills/get-block-number && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5599" && unzip -o skill.zip -d .claude/skills/get-block-number && rm skill.zipInstalls to .claude/skills/get-block-number
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Get the latest block number for a blockchain using Web3.py and JSON-RPC environment variablesKey capabilities
- →Retrieve latest block number for specified chains
- →Use JSON-RPC environment variables
- →Execute Web3.py scripts via command line
- →Verify blockchain sync status
How it works
It executes a Python script using Web3.py and environment-configured JSON-RPC URLs to fetch the current block height.
Inputs & outputs
When to use get-block-number
- →Get the latest block for Ethereum
- →Query current blockchain height
- →Verify chain sync status
About this skill
Get latest block number
This skill retrieves the latest block number from a blockchain using the configured JSON-RPC environment variables and Web3.py.
ALWAYS USE SCRIPT. NEVER RELY ON THE HISTORICAL INFORMATION OR GUESS.
Required inputs
- Chain name: The blockchain to query (e.g., Ethereum, Arbitrum, Base, Polygon)
Running the script
Generate and run a Python script to fetch the block number. Run it Python commadn line inline, don't write a new file.
import os
from web3 import Web3
from eth_defi.provider.multi_provider import create_multi_provider_web3
# Replace {CHAIN} with the uppercase chain name
json_rpc_url = os.environ.get("JSON_RPC_{CHAIN}")
if not json_rpc_url:
raise ValueError("JSON_RPC_{CHAIN} environment variable not set")
web3 = create_multi_provider_web3(json_rpc_url)
block_number = web3.eth.block_number
print(f"Latest block number: {block_number}")
Run the script with:
source .local-test.env && poetry run python <script_path>
Display output
Return the block number to the user in a clear format, e.g.:
Chain: Ethereum
Latest block number: 19,234,567
When not to use it
- →When relying on historical data instead of live queries
Prerequisites
Limitations
- →Requires valid JSON-RPC endpoint configuration
- →Limited to chains supported by the environment variables
How it compares
It forces a live script execution rather than relying on potentially stale historical information.
Compared to similar skills
get-block-number side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| get-block-number (this skill) | 1 | 6mo | Review | Beginner |
| fastapi-templates | 520 | 2mo | No flags | Intermediate |
| fastapi-pro | 79 | 4mo | No flags | Advanced |
| telegram-bot-builder | 106 | 6mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by tradingstrategy-ai
View all by tradingstrategy-ai →You might also like
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
fastapi-pro
sickn33
Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.
telegram-bot-builder
davila7
Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.
stripe-integration
wshobson
Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.
billing-automation
wshobson
Build automated billing systems for recurring payments, invoicing, subscription lifecycle, and dunning management. Use when implementing subscription billing, automating invoicing, or managing recurring payment systems.
hubspot-integration
davila7
Expert patterns for HubSpot CRM integration including OAuth authentication, CRM objects, associations, batch operations, webhooks, and custom objects. Covers Node.js and Python SDKs. Use when: hubspot, hubspot api, hubspot crm, hubspot integration, contacts api.