Skip to main content
Glama
0xReisearch

REI Crypto MCP Server

by 0xReisearch

get_token_protocols

Retrieve token distribution across protocols by specifying a token symbol (e.g., 'usdt') to analyze its allocation within DeFi ecosystems.

Instructions

GET /api/tokenProtocols/{symbol}

Lists the amount of a certain token within all protocols. Parameters: symbol: token slug (e.g., 'usdt')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes

Implementation Reference

  • The handler function implementing the get_token_protocols tool. It takes a token symbol, calls the DefiLlama API endpoint /api/tokenProtocols/{symbol}, and returns the result as a string.
    async def get_token_protocols(symbol: str) -> str: """GET /api/tokenProtocols/{symbol} Lists the amount of a certain token within all protocols. Parameters: symbol: token slug (e.g., 'usdt') """ result = await make_request('GET', f'/api/tokenProtocols/{symbol}') return str(result)
  • The @mcp.tool() decorator registers the get_token_protocols function as an MCP tool.
    @mcp.tool()
  • Input schema defined by function parameter symbol: str and docstring description.
    symbol: token slug (e.g., 'usdt') """
  • Helper function used by the tool to make HTTP requests to the DefiLlama API.
    async def make_request(method: str, endpoint: str, params: Optional[Dict[str, Any]] = None) -> Any: """Make a request to the DefiLlama API.""" try: response = await client.request(method, endpoint, params=params) response.raise_for_status() return response.json() except Exception as e: return f"Error: {str(e)}"

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/0xReisearch/crypto-mcp-beta'

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