Skip to main content
Glama
BrainDAO

DefiLlama MCP Server

by BrainDAO

execute

Run async JavaScript code with a pre-wired DefiLlama client to query protocols, DEX volumes, yields, prices, and more. Returns JSON output and console logs.

Instructions

Run async JavaScript against a pre-wired DefiLlama client. Define async function run(defillama) { ... }; the JSON-serializable return value is sent back plus console.log output. The defillama client mirrors the services: defillama.protocol, defillama.dex, defillama.fees, defillama.options, defillama.stablecoin, defillama.price, defillama.yield, defillama.blockchain, plus defillama.resolveChain / defillama.resolveProtocol / defillama.resolveStablecoin helpers. JavaScript only (no type annotations); variables don't persist between calls; no fs, no network outside the client.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
intentNo
Behavior5/5

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

Beyond the minimal readOnlyHint=false annotation, the description thoroughly discloses behavioral traits: the execution model (async function, JSON-serializable return), console.log output capture, the full client service surface, and sandbox constraints. This provides rich context for predicting tool behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured: a front-loaded purpose, a usage template, a compact list of client services, and a set of constraints. Each sentence adds value, and the length is appropriate for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers core functionality, client capabilities, return format, and limitations, but it omits behavior on errors/timeouts and does not explain the 'intent' parameter. Given the tool's complexity and lack of output schema, these gaps make it not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no descriptions for 'code' or 'intent' (0% coverage). The description explains the expected content of 'code' via the `async function run(defillama)` template, but it never clarifies the optional 'intent' parameter. This partial compensation for the schema gap earns a mid score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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 with a specific verb and resource: 'Run async JavaScript against a pre-wired DefiLlama client.' It provides a concrete usage template and lists the client's services, making it easy to distinguish from the sibling search_docs tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context on how to use the tool, including the required async function signature and constraints like 'no fs, no network outside the client' and 'variables don't persist between calls.' However, it does not explicitly mention when to use this tool over search_docs or any exclusions, so it falls short of full guidance.

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/BrainDAO/mcp-defillama'

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