Skip to main content
Glama

get_etf_tokens

Retrieve available ETF tokens and their details for a specific blockchain chain ID to support cross-chain trading decisions on Paloma DEX.

Instructions

Get available ETF tokens on a specific chain.

Args:
    chain_id: Chain ID (1, 10, 56, 100, 137, 8453, 42161)

Returns:
    JSON string with available ETF tokens and their information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chain_idYes

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the get_etf_tokens tool. It fetches ETF token data from the PalomaDEX API for the specified chain, filters and enriches the data, and returns a formatted JSON response.
    async def get_etf_tokens(ctx: Context, chain_id: str) -> str:
        """Get available ETF tokens on a specific chain.
        
        Args:
            chain_id: Chain ID (1, 10, 56, 100, 137, 8453, 42161)
        
        Returns:
            JSON string with available ETF tokens and their information.
        """
        try:
            paloma_ctx = ctx.request_context.lifespan_context
            
            if chain_id not in CHAIN_CONFIGS:
                return f"Error: Unsupported chain ID {chain_id}"
            
            config = CHAIN_CONFIGS[chain_id]
            
            chain_name = get_chain_name_for_api(chain_id)
            if not chain_name:
                return f"Error: Chain name mapping not found for chain ID {chain_id}"
            
            # Call Paloma DEX API to get ETF tokens
            api_url = f"https://api.palomadex.com/etfapi/v1/etf?chain_id={chain_name}"
            
            response = await paloma_ctx.http_client.get(api_url)
            if response.status_code == 200:
                etf_data = response.json()
                
                # Filter to only show ETF tokens that have EVM deployments
                deployed_etfs = []
                for etf in etf_data:
                    if etf.get("evm") and len(etf["evm"]) > 0:
                        # Has EVM deployments
                        deployed_etfs.append(etf)
                    else:
                        # No EVM deployment yet - only exists on Paloma
                        etf["status"] = "paloma_only"
                        etf["note"] = "ETF exists on Paloma but not yet deployed to EVM chains"
                        deployed_etfs.append(etf)
                
                result = {
                    "chain": config.name,
                    "chain_id": config.chain_id,
                    "etf_connector": config.etf_connector or "Not configured",
                    "total_etfs": len(etf_data),
                    "evm_deployed_etfs": len([etf for etf in etf_data if etf.get("evm") and len(etf["evm"]) > 0]),
                    "paloma_only_etfs": len([etf for etf in etf_data if not etf.get("evm") or len(etf["evm"]) == 0]),
                    "etf_tokens": deployed_etfs,
                    "trading_note": "ETF trading currently requires EVM token deployment. Most ETFs are Paloma-native only."
                }
                
                return json.dumps(result, indent=2)
            else:
                return f"Error: Failed to fetch ETF tokens. Status: {response.status_code}"
                    
        except Exception as e:
            logger.error(f"Error getting ETF tokens: {e}")
            return f"Error getting ETF tokens: {str(e)}"
  • Helper function used by get_etf_tokens to map chain ID to the chain name required by the PalomaDEX API endpoint.
    def get_chain_name_for_api(chain_id: str) -> Optional[str]:
        """Map chain ID to chain name for Paloma DEX API calls."""
        chain_name_mapping = {
            "1": "ethereum",
            "10": "optimism", 
            "56": "bsc",
            "100": "gnosis",
            "137": "polygon",
            "8453": "base",
            "42161": "arbitrum"
        }
        return chain_name_mapping.get(chain_id)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns 'JSON string with available ETF tokens and their information,' which is helpful, but lacks details on permissions, rate limits, error handling, or whether it's a read-only operation. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 with the core purpose in the first sentence. The 'Args' and 'Returns' sections are structured clearly, though the formatting could be more streamlined. Every sentence adds value, with no wasted words.

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 low complexity (1 parameter, no output schema, no annotations), the description is minimally adequate. It covers the purpose and parameter semantics well but lacks behavioral details and usage guidelines. Without annotations or output schema, it should provide more context on what the JSON return includes and how to interpret it.

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 meaningful context for the single parameter 'chain_id' by listing specific values (1, 10, 56, 100, 137, 8453, 42161), which compensates for the 0% schema description coverage. This goes beyond the schema's basic 'string' type and provides practical usage information, though it doesn't explain what these IDs represent (e.g., Ethereum, Polygon).

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 as 'Get available ETF tokens on a specific chain,' which includes a specific verb ('Get') and resource ('ETF tokens') with scope ('on a specific chain'). However, it doesn't explicitly differentiate from sibling tools like 'get_available_trading_tokens' or 'get_chain_info,' which could cause confusion about when to use this specific tool versus others.

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 'on a specific chain' but doesn't clarify if this is for ETF tokens only versus other token types or how it differs from similar tools like 'get_available_trading_tokens.' No exclusions, prerequisites, or explicit alternatives are stated.

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/VolumeFi/mcpPADEX'

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