Standalone MCP server for DefiLlama data access, providing tools to query DeFi protocol TVL, DEX volumes, fees, options, stablecoins, prices, yields, and blockchain data.
Server has 6 well-structured tools with mostly complete schemas and descriptions. Tool names follow verb_noun convention (execute, search_docs, defillama_resolve, list_endpoints, get_endpoint_schema, invoke_endpoint). Descriptions are detailed and context-aware, ranging 150 - 400+ chars. All tools have input schemas with type definitions and parameter descriptions. However, output schemas are documented only in metadata (response-schemas.ts), not returned to the agent in tool definitions. Error handling is present but generic. The 'execute' tool is high-risk (arbitrary JS execution) but mitigated by sandboxing. Parameter naming is consistent and descriptive.
Resolve a human-readable entity name to its DefiLlama identifier. For kind='chain' returns { resolved: { name, slug } }; for kind='protocol' returns { resolved: '<slug>' }; for kind='stablecoin' returns { resolved: '<id>' }. On a miss returns { resolved: null, error: '...' } (not an error).
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.
Return the full schema for one endpoint: parameters (JSON Schema), response shape (JSON Schema), description, and an example agent call. Use before `invoke_endpoint` to construct correct params and a useful `jq_filter`.
Invoke one DefiLlama endpoint by qualified name. Returns the JSON response, optionally projected through a jq filter. **When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.** Only omit if you're sure you don't need the data. Workflow: 1. Call `get_endpoint_schema` to see params + response shape. 2. Construct `params` matching the schema. 3. Provide `jq_filter` to project only the fields you need. For multi-call workflows (joining, looping, conditional logic), prefer `execute` (sandboxed JS) which gives full programmatic control.
Output schemas documented in tool-metadata.ts but not exposed to agents in tool definitions. Agents cannot see response structure before calling tools, forcing trial-and-error or reliance on descriptions.
execute tool accepts arbitrary JavaScript code with minimal validation. While sandboxed, error messages from failed code execution are generic. No guidance on how to fix invalid code or what APIs are available.
invoke_endpoint description emphasizes jq_filter but does not explain what happens if filter is omitted or malformed. No validation error guidance for agents.
list_endpoints filter parameter is optional and case-insensitive, but description does not specify behavior when filter matches zero endpoints or how partial matches are ranked.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 64 | <=2025-11-25 | v2 |
List DefiLlama API endpoints available via `invoke_endpoint`. Returns an array of `{ qualified, description }` objects. Use the `filter` parameter to narrow by keyword (e.g. "tvl", "fees", "price", "yield"). Typical workflow: 1. list_endpoints({ filter: "tvl" }) to discover relevant endpoints. 2. get_endpoint_schema({ name: "defillama.protocol.getProtocols" }) to see params + response shape. 3. invoke_endpoint({ name: "...", params: {...}, jq_filter: "..." }) to call it. For multi-step workflows (loops, joins, conditional logic), prefer `execute`.
Search DefiLlama SDK docs to find the right methods, parameters, and example code. Use before writing execute() code when you're unsure of the API.
No pagination support documented for tools that return large result sets (e.g., getProtocols returns ~3k entries). Description warns against returning raw catalog but does not offer pagination parameters.