Skip to main content
Glama
0xReisearch

REI Crypto MCP Server

by 0xReisearch

get_protocol_tvl

Retrieve the current Total Value Locked (TVL) for any DeFi protocol using its slug identifier. This tool provides real-time TVL data from DeFiLlama Pro to analyze protocol performance and market position.

Instructions

GET /api/tvl/{protocol}

Simplified endpoint to get current TVL of a protocol.

Parameters:
    protocol: protocol slug (e.g., 'uniswap')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protocolYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'get_protocol_tvl' tool. It is automatically registered as an MCP tool via the @mcp.tool() decorator. The function signature and docstring define the input schema (protocol: str) and output (str representing JSON response). It fetches the current TVL from DefiLlama API using the make_request helper.
    @mcp.tool()
    async def get_protocol_tvl(protocol: str) -> str:
        """GET /api/tvl/{protocol}
        
        Simplified endpoint to get current TVL of a protocol.
        
        Parameters:
            protocol: protocol slug (e.g., 'uniswap')
        """
        result = await make_request('GET', f'/api/tvl/{protocol}')
        return str(result)
  • Helper function used by get_protocol_tvl (and other tools) to make HTTP requests to the DefiLlama Pro API, handling errors and returning JSON or error string.
    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)}"
  • The @mcp.tool() decorator registers the get_protocol_tvl function as an MCP tool.
    @mcp.tool()
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 gets 'current TVL,' implying a read-only operation, but doesn't mention any behavioral traits like rate limits, authentication needs, data freshness, or error handling. For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

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: the first sentence states the core purpose, followed by a clear parameter explanation. There's no wasted text, and the structure is logical. It could be slightly more polished but efficiently conveys essential information.

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) and the presence of an output schema (which handles return values), the description is minimally adequate. However, with no annotations and a simple purpose, it lacks context on usage guidelines and behavioral traits, making it incomplete for optimal agent understanding.

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 semantics beyond the input schema. The schema has 0% description coverage (only a title 'Protocol'), but the description explains that the 'protocol' parameter is a 'protocol slug' and provides an example ('uniswap'). This clarifies the expected format and usage, compensating well for the low schema coverage.

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: 'Simplified endpoint to get current TVL of a protocol.' It specifies the verb ('get'), resource ('current TVL'), and target ('protocol'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_historical_chain_tvl' or 'get_protocol_details', which might offer overlapping or related data.

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 it's a 'simplified endpoint,' but doesn't clarify what that means in practice or when to choose it over other TVL-related tools in the sibling list. There are no explicit when/when-not instructions or named alternatives.

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

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