Skip to main content
Glama
kukapay

tornado-cash-mcp

query_latest_withdrawals

Retrieve recent Tornado Cash withdrawal records in a formatted table, displaying key details such as amount, timestamp, recipient, and block number.

Instructions

Query the most recent withdrawals from Tornado Cash Subgraph and return results as a formatted table.

Parameters:
    limits (int): The maximum number of withdrawal records to return. Must be positive. Default is 10.

Returns:
    A string containing a tabulated representation of withdrawal records with columns: id, amount, timestamp, to, blockNumber.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitsNo

Implementation Reference

  • main.py:89-134 (handler)
    The primary handler function for the 'query_latest_withdrawals' MCP tool. Decorated with @mcp.tool() for automatic registration and schema inference from types and docstring. Executes GraphQL query to fetch latest withdrawals from Tornado Cash subgraph, validates input, formats output as ASCII table using tabulate library.
    @mcp.tool()
    async def query_latest_withdrawals(limits: int = 10, ctx: Context = None) -> str:
        """
        Query the most recent withdrawals from Tornado Cash Subgraph and return results as a formatted table.
    
        Parameters:
            limits (int): The maximum number of withdrawal records to return. Must be positive. Default is 10.
    
        Returns:
            A string containing a tabulated representation of withdrawal records with columns: id, amount, timestamp, to, blockNumber.
        """
        if limits <= 0:
            raise ValueError("limits must be positive")
            
        query = """
        query LatestWithdrawals($first: Int, $orderBy: String, $orderDirection: String) {
          withdrawals(first: $first, orderBy: $orderBy, orderDirection: $orderDirection) {
            to
            amount
            blockNumber
            timestamp
          }
        }
        """
        variables = {
            "first": limits,
            "orderBy": "timestamp",
            "orderDirection": "desc"
        }
        result = await query_subgraph(query, variables)
        withdrawals = result["data"]["withdrawals"]
        
        # Format withdrawals as a table
        table_data = [
            [
                withdrawal["to"],
                withdrawal["amount"],
                withdrawal["blockNumber"],
                datetime.fromtimestamp(int(withdrawal["timestamp"]))
            ]
            for withdrawal in withdrawals
        ]
        headers = ["to", "amount", "blockNumber", "time"]
        table = tabulate(table_data, headers=headers, tablefmt="grid")
        
        return table
  • main.py:24-38 (helper)
    Utility helper function called by the tool handler to perform authenticated POST requests to the Tornado Cash subgraph GraphQL 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()
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the action (querying and formatting withdrawals) and the output format (a tabulated string), but lacks details on potential errors, rate limits, authentication needs, or data freshness. It adds some context but is incomplete for a tool interacting with an external data source.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and concise, with a clear opening sentence stating the tool's purpose, followed by dedicated sections for parameters and returns. Each sentence adds value without redundancy, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (querying external data with one parameter) and lack of annotations and output schema, the description is adequate but has gaps. It covers the basic operation and output format but omits details on error handling, data source limitations, or integration context, which could be important for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains the 'limits' parameter's purpose (maximum number of records), constraints (must be positive), default value (10), and how it affects the output. This compensates well for the schema's lack of details, though it doesn't cover all possible edge cases.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: querying recent withdrawals from Tornado Cash Subgraph and returning them as a formatted table. It specifies the verb ('query'), resource ('withdrawals'), and data source ('Tornado Cash Subgraph'), but does not explicitly differentiate from its sibling tool 'query_latest_deposits' beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as its sibling 'query_latest_deposits'. It mentions the tool's function but offers no context on use cases, prerequisites, or comparisons, leaving the agent to infer usage based on the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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