Skip to main content
Glama

get_cross_chain_activity

Fetch cross-chain activity data from Wormholescan API to analyze transaction volumes, top assets, and chain pairs. Returns data as a pandas DataFrame for insights into Wormhole protocol metrics.

Instructions

Fetch cross-chain activity data from Wormholescan API and return as a pandas DataFrame.

Args:
    timeSpan: Time span for data (7d, 30d, 90d, 1y, all-time). Default: 7d
    by: Render results by notional or tx count. Default: notional
    app: Comma-separated list of apps. Default: all apps

Returns:
    String representation of a pandas DataFrame containing cross-chain activity data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeSpanNo7d
byNonotional
appNo

Implementation Reference

  • main.py:72-140 (handler)
    Handler function decorated with @mcp.tool() that implements the get_cross_chain_activity tool. Fetches data from Wormholescan API, validates params, processes into a pivot DataFrame of source-to-dest chain volumes, returns markdown table.
    @mcp.tool()
    async def get_cross_chain_activity(
        timeSpan: str = "7d",
        by: str = "notional",
        app: str = ""
    ) -> str:
        """
        Fetch cross-chain activity data from Wormholescan API and return as a pandas DataFrame.
        
        Args:
            timeSpan: Time span for data (7d, 30d, 90d, 1y, all-time). Default: 7d
            by: Render results by notional or tx count. Default: notional
            app: Comma-separated list of apps. Default: all apps
        
        Returns:
            String representation of a pandas DataFrame containing cross-chain activity data
        """
        try:
            # Validate parameters
            valid_time_spans = {"7d", "30d", "90d", "1y", "all-time"}
            valid_by = {"notional", "tx count"}
            
            if timeSpan not in valid_time_spans:
                raise ValueError(f"Invalid timeSpan. Must be one of {valid_time_spans}")
            if by not in valid_by:
                raise ValueError(f"Invalid 'by' parameter. Must be one of {valid_by}")
            
            # Construct query parameters
            params = {
                "timeSpan": timeSpan,
                "by": by
            }
            if app:
                params["apps"] = app  # API expects 'apps' as query param name
            
            # Make API request
            async with httpx.AsyncClient() as client:
                response = await client.get(
                    f"{API_BASE}/api/v1/x-chain-activity",
                    params=params
                )
                response.raise_for_status()
                
                # Parse JSON response
                data = response.json()
                
                # Flatten the nested data for DataFrame
                rows = []
                for tx in data.get("txs", []):
                    source_chain = tx.get("chain")
                    for dest in tx.get("destinations", []):
                        rows.append({
                            "source_chain": id2name(source_chain),
                            "dest_chain": id2name(dest.get("chain")),
                            "volume": dest.get("volume"),
                        })
                
                # Create DataFrame
                df = pd.DataFrame(rows)
                pivot_df = df.pivot(index="source_chain", columns="dest_chain", values="volume")
                
                # Convert volume to numeric and fill NaN with empty string
                pivot_df = pivot_df.apply(pd.to_numeric, errors="coerce").fillna("")
                
                return pivot_df.to_markdown()
                
        except Exception as e:
            return str(e)
  • main.py:67-70 (helper)
    Helper function to convert chain ID to name using WORMHOLE_CHAINS dict, used in get_cross_chain_activity for labeling chains.
    def id2name(id) -> str:
        id = str(id)
        return WORMHOLE_CHAINS.get(id, id)
  • main.py:73-88 (schema)
    Input schema defined by annotated parameters and docstring describing valid values and purpose.
    async def get_cross_chain_activity(
        timeSpan: str = "7d",
        by: str = "notional",
        app: str = ""
    ) -> str:
        """
        Fetch cross-chain activity data from Wormholescan API and return as a pandas DataFrame.
        
        Args:
            timeSpan: Time span for data (7d, 30d, 90d, 1y, all-time). Default: 7d
            by: Render results by notional or tx count. Default: notional
            app: Comma-separated list of apps. Default: all apps
        
        Returns:
            String representation of a pandas DataFrame containing cross-chain activity data
        """
  • main.py:72-72 (registration)
    @mcp.tool() decorator registers the function as an MCP tool.
    @mcp.tool()
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 mentions the data source ('Wormholescan API') and output format ('pandas DataFrame'), but lacks critical details: it doesn't specify if this is a read-only operation, potential rate limits, authentication needs, error handling, or what 'activity data' entails beyond the parameters. For a tool fetching external API data, this is a significant gap.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, starting with the core purpose. The Args and Returns sections are structured clearly, though the 'Returns' could be more precise (e.g., noting it's a string representation). No extraneous information is included, making it efficient.

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 3 parameters with 0% schema coverage and no output schema, the description does well on parameters but lacks completeness in other areas. It doesn't explain the return structure beyond 'pandas DataFrame', and with no annotations, it misses behavioral aspects like data freshness or API constraints. For a tool with external dependencies, more context is needed.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It successfully adds meaning beyond the bare schema by explaining all three parameters: 'timeSpan' with allowed values and default, 'by' with options and default, and 'app' with format and default. This provides essential context not present in the schema's minimal titles.

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 action ('fetch cross-chain activity data') and the resource ('from Wormholescan API'), and specifies the output format ('return as a pandas DataFrame'). It distinguishes from siblings by focusing on cross-chain activity, unlike tools for KPIs, money flow, or top assets/chains. However, it doesn't explicitly contrast with similar-sounding siblings like 'get_top_chain_pairs_by_num_transfers'.

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 doesn't mention any prerequisites, context for selection among siblings, or exclusions. The sibling tools include related metrics (e.g., 'get_top_chain_pairs_by_num_transfers'), but no comparison is offered.

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