Skip to main content
Glama
kukapay

tornado-cash-mcp

query_latest_deposits

Fetch recent Tornado Cash deposit records in a structured table format, including details like amount, timestamp, and origin, to track asset trails and wallet interactions.

Instructions

Query the most recent deposits from Tornado Cash Subgraph and return results as a formatted table. Parameters: limits (int): The maximum number of deposit records to return. Must be positive. Default is 10. Returns: A string containing a tabulated representation of deposit records with columns: id, amount, timestamp, commitment, blockNumber, from.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitsNo

Implementation Reference

  • main.py:41-86 (handler)
    The handler function for the 'query_latest_deposits' MCP tool, including the @mcp.tool() decorator for registration. It validates input, executes a GraphQL query on the Tornado Cash subgraph for the latest deposits, processes the data, formats it into a tabulated string using tabulate, and returns it.
    async def query_latest_deposits(limits: int = 10, ctx: Context = None) -> str: """ Query the most recent deposits from Tornado Cash Subgraph and return results as a formatted table. Parameters: limits (int): The maximum number of deposit records to return. Must be positive. Default is 10. Returns: A string containing a tabulated representation of deposit records with columns: id, amount, timestamp, commitment, blockNumber, from. """ if limits <= 0: raise ValueError("limits must be positive") query = """ query LatestDeposits($first: Int, $orderBy: String, $orderDirection: String) { deposits(first: $first, orderBy: $orderBy, orderDirection: $orderDirection) { from amount blockNumber timestamp commitment } } """ variables = { "first": limits, "orderBy": "timestamp", "orderDirection": "desc" } result = await query_subgraph(query, variables) deposits = result["data"]["deposits"] table_data = [ [ deposit["from"], deposit["amount"], deposit["blockNumber"], datetime.fromtimestamp(int(deposit["timestamp"])), deposit["commitment"][:10] + "...", ] for deposit in deposits ] headers = ["from", "amount", "blockNumber", "time", "commitment"] table = tabulate(table_data, headers=headers, tablefmt="grid") return table
  • main.py:24-38 (helper)
    Supporting helper function 'query_subgraph' used by the tool to perform authenticated GraphQL queries to the Tornado Cash subgraph endpoint.
    async def query_subgraph(query: str, variables: Dict = None) -> Dict: """Helper function to query the Tornado Cash Subgraph with API key.""" headers = { "Authorization": f"Bearer {THEGRAPH_API_KEY}", "Content-Type": "application/json" } async with httpx.AsyncClient() as client: response = await client.post( SUBGRAPH_URL, json={"query": query, "variables": variables or {}}, headers=headers ) response.raise_for_status() return response.json()
  • main.py:41-41 (registration)
    The @mcp.tool() decorator registers the query_latest_deposits function as an MCP tool.
    async def query_latest_deposits(limits: int = 10, ctx: Context = None) -> str:
Install Server

Other Tools

Related Tools

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/kukapay/tornado-cash-mcp'

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