get_transaction
Retrieve confirmed transaction details on the Solana blockchain by providing a transaction hash. Ideal for verifying transaction status and analyzing blockchain activity.
Instructions
Returns transaction details for a confirmed transaction.
Args: hash (str): Transaction signature as base-58 encoded string
Returns: str: Transaction details in the format "Transaction: {transaction}"
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hash | Yes |
Implementation Reference
- src/server.py:30-45 (handler)The main handler function for the get_transaction tool. It is decorated with @mcp.tool() which registers it as an MCP tool. It takes a transaction hash as input, queries the Solana RPC client for the transaction details, and returns a formatted string with the transaction information.@mcp.tool() async def get_transaction(hash: str) -> str: """Returns transaction details for a confirmed transaction. Args: hash (str): Transaction signature as base-58 encoded string Returns: str: Transaction details in the format "Transaction: {transaction}" """ async with AsyncClient(rpc_url) as client: transaction = await client.get_transaction( Signature.from_string(hash), max_supported_transaction_version=0 ) return f"Transaction: {transaction}"