Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

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
NameRequiredDescriptionDefault
hashYes

Implementation Reference

  • 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}"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tywenk/mcp-sol'

If you have feedback or need assistance with the MCP directory API, please join our Discord server