get_kpi_list
Fetch key performance indicators for Wormhole cross-chain protocol to analyze transaction volumes, asset flows, and chain activity metrics.
Instructions
Fetch a list of KPIs for Wormhole from Wormholescan API.
Returns:
String representation of a pandas DataFrame containing Wormhole KPIs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:464-506 (handler)The handler function for the 'get_kpi_list' tool, decorated with @mcp.tool() which registers it with the MCP server. It fetches KPI data from the Wormholescan API, transforms it into a pandas DataFrame, and returns a markdown representation.# Define the get_kpi_list tool @mcp.tool() async def get_kpi_list() -> str: """ Fetch a list of KPIs for Wormhole from Wormholescan API. Returns: String representation of a pandas DataFrame containing Wormhole KPIs """ try: # Make API request async with httpx.AsyncClient() as client: response = await client.get( f"{API_BASE}/api/v1/scorecards" ) response.raise_for_status() # Parse JSON response data = response.json() # Transform data for DataFrame rows = [{ "24h_messages": data.get("24h_messages"), "total_messages": data.get("total_messages"), "total_tx_count": data.get("total_tx_count"), "total_volume": data.get("total_volume"), "tvl": data.get("tvl"), "24h_volume": data.get("24h_volume"), "7d_volume": data.get("7d_volume"), "30d_volume": data.get("30d_volume") }] # Create DataFrame df = pd.DataFrame(rows) # Convert numeric columns for col in df.columns: df[col] = pd.to_numeric(df[col], errors="coerce") return df.to_markdown(index=False) except Exception as e: return str(e)