Skip to main content
Glama

get_top_chain_pairs_by_num_transfers

Identify the most active blockchain pairs by analyzing cross-chain transfer volumes on the Wormhole protocol to understand network usage patterns.

Instructions

Fetch top chain pairs by number of transfers from Wormholescan API.

Args:
    timeSpan: Time span for data (7d, 15d, 30d). Default: 7d

Returns:
    String representation of a pandas DataFrame containing top chain pairs by number of transfers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeSpanNo7d

Implementation Reference

  • main.py:284-341 (handler)
    The handler function for the 'get_top_chain_pairs_by_num_transfers' tool, decorated with @mcp.tool() for registration. It validates the timeSpan parameter, fetches data from the Wormholescan API endpoint '/api/v1/top-chain-pairs-by-num-transfers', transforms the JSON response into a pandas DataFrame using the id2name helper for chain names, sorts by number of transfers, and returns a markdown representation of the table.
    # Define the get_top_chain_pairs_by_num_transfers tool
    @mcp.tool()
    async def get_top_chain_pairs_by_num_transfers(
        timeSpan: str = "7d"
    ) -> str:
        """
        Fetch top chain pairs by number of transfers from Wormholescan API.
        
        Args:
            timeSpan: Time span for data (7d, 15d, 30d). Default: 7d
        
        Returns:
            String representation of a pandas DataFrame containing top chain pairs by number of transfers
        """
        try:
            # Validate parameters
            valid_time_spans = {"7d", "15d", "30d"}
            
            if timeSpan not in valid_time_spans:
                raise ValueError(f"Invalid timeSpan. Must be one of {valid_time_spans}")
            
            # Construct query parameters
            params = {"timeSpan": timeSpan}
            
            # Make API request
            async with httpx.AsyncClient() as client:
                response = await client.get(
                    f"{API_BASE}/api/v1/top-chain-pairs-by-num-transfers",
                    params=params
                )
                response.raise_for_status()
                
                # Parse JSON response
                data = response.json()
                
                # Transform data for DataFrame
                rows = [
                    {
                        "source_chain": id2name(item.get("emitterChain")),
                        "destination_chain": id2name(item.get("destinationChain")),
                        "number_of_transfers": item.get("numberOfTransfers")
                    }
                    for item in data.get("chainPairs", [])
                ]
                
                # Create DataFrame
                df = pd.DataFrame(rows)
                
                # Convert number_of_transfers to numeric
                df["number_of_transfers"] = pd.to_numeric(df["number_of_transfers"], errors="coerce")
                
                # Sort by number_of_transfers descending for readability
                df = df.sort_values("number_of_transfers", ascending=False)
                
                return df.to_markdown(index=False)
                
        except Exception as e:
            return str(e)     
Behavior2/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 states the tool fetches data and returns a string representation of a pandas DataFrame, which implies a read-only operation. However, it doesn't mention potential limitations like rate limits, authentication needs, error handling, or data freshness, which are critical for an API-based tool. The description adds minimal behavioral context beyond the basic operation.

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 efficiently structured and front-loaded, with the core purpose stated first, followed by clear sections for arguments and returns. Each sentence adds value without redundancy, and the total length is appropriate for the tool's complexity. There's no wasted text, making it easy for an agent to parse 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 (API fetch with one parameter) and lack of annotations or output schema, the description is partially complete. It covers the purpose and parameter semantics adequately but lacks usage guidelines, detailed behavioral traits, and output specifics (e.g., DataFrame structure). This leaves gaps that could hinder effective tool invocation in varied contexts.

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% coverage. It explains the 'timeSpan' parameter's purpose ('Time span for data'), provides allowed values ('7d, 15d, 30d'), and notes the default ('Default: 7d'). This compensates well for the schema's lack of documentation, though it doesn't detail format constraints or validation rules.

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: 'Fetch top chain pairs by number of transfers from Wormholescan API.' It specifies the verb ('fetch'), resource ('top chain pairs'), and metric ('number of transfers'), making the intent unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_top100_corridors' or 'get_top_assets_by_volume', which likely involve similar data but different metrics or scopes.

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. It mentions the data source ('Wormholescan API') but doesn't specify use cases, prerequisites, or comparisons to sibling tools such as 'get_cross_chain_activity' or 'get_top_symbols_by_volume'. This lack of context leaves the agent without clear direction on tool selection.

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

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/wormhole-metrics-mcp'

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