get_pumpfun_graduates_by_marketcap
Retrieve the top Pump.fun token launches ranked by market capitalization within the last 24 hours. Provides a formatted table including rank, token name, mint address, market cap, and trade count for analysis.
Instructions
Retrieve Pump.fun token launches sorted by highest market capitalization in the last 24 hours.
Args:
limit (int): Maximum number of tokens to return. Defaults to 100.
Returns:
str: A formatted table of Pump.fun graduates including rank, token name, mint address,
market capitalization, and trade count, or an error message if the query fails.
Raises:
httpx.HTTPStatusError: If the Dune API request fails.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- main.py:97-126 (handler)The @mcp.tool()-decorated handler function that implements the 'get_pumpfun_graduates_by_marketcap' tool. It fetches data from Dune Analytics query ID 4124453, processes rows using helper functions like strip_a_tag, formats a table with tabulate, and returns a markdown-formatted string or error message.@mcp.tool() def get_pumpfun_graduates_by_marketcap(limit: int = 100) -> str: """Retrieve Pump.fun token launches sorted by highest market capitalization in the last 24 hours. Args: limit (int): Maximum number of tokens to return. Defaults to 100. Returns: str: A formatted table of Pump.fun graduates including rank, token name, mint address, market capitalization, and trade count, or an error message if the query fails. Raises: httpx.HTTPStatusError: If the Dune API request fails. """ try: data = get_latest_result(4124453, limit=limit) rows = [ [ row["rank"], strip_a_tag(row["asset_with_chart"]), row["token_address"], f'${row["market_cap"]:.2f}', row["trade_count"] ] for row in data ] headers = ["Rank", "Token", "Mint Address", "MarketCap", "Trade Count"] return f"# Top {limit} Pump.fun Graduates by MarketCap - Last 24 Hours\n\n" + tabulate(rows, headers=headers) except Exception as e: return str(e)