Skip to main content
Glama

explain_smart_contract

Read-only

Fetch a DERO smart contract and return its functions, state keys, pattern, and plain-language explanation with prioritized DVM docs. Use to understand what it does without parsing DVM-BASIC.

Instructions

Composite: fetch a DERO smart contract (code + variables + balances) and return its function surface, a classification of the contract pattern (tela_index | tela_doc | token | registry | minimal | generic), a plain-language narrative, and curated DVM docs citations re-ordered so the most relevant page is first. TELA contracts (apps/files) are detected first and cite the TELA spec; for a deep TELA parse use tela_inspect.

When to call: when the user wants to UNDERSTAND a smart contract — its functions, state shape, or which DVM concept to read about. PREFER this over chaining dero_get_sc with a docs lookup yourself: this composite already parses the DVM-BASIC source for function declarations, sorts stringkeys/uint64keys deterministically, and picks the right docs page from a heuristic so the agent does not have to learn DVM-BASIC syntax to summarize a contract.

Input Requirements:

  • scid is REQUIRED. Must be 64 hex chars (the smart contract id). Use 0000…0001 for the on-chain name registry as a known-good example.

  • topoheight is OPTIONAL. Provide to inspect the contract at a specific topo height; omit for latest tip.

Output: { scid, topoheight, kind, surface: { functions[], stringkeys[], uint64keys[], balances }, narrative, raw_code_length, has_code, related_docs }. kind is one of tela_index | tela_doc | token | registry | minimal | generic. surface.functions items are { name, args, returns }. has_code is false when the SCID is unknown or has no on-chain code; functions is then [] and the narrative explains the gap. raw_code_length is always present so the agent knows when to fall back to dero_get_sc for the full source.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scidYes64-char hex Smart Contract ID
topoheightNoOptional topo height; omit for latest tip
Install Server

TDQS

A4.9/5.0
Behavior5/5

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

The description goes far beyond the annotations' readOnlyHint=true: it explains the composite nature, deterministic key sorting, TELA-first detection, heuristic docs page selection, and important edge behavior like has_code=false for unknown SCIDs. It also tells the agent when to fall back to dero_get_sc based on raw_code_length. No contradiction with annotations exists.

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?

Although the description is long, it is tightly structured into purpose, when-to-call, input requirements, and output sections. Every sentence carries actionable information, and the most important usage guidance is front-loaded before parameter details.

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

Completeness5/5

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

With no output schema, the description compensates thoroughly by detailing the exact return shape, the kind enum values, the shape of surface.functions, and the fallback semantics of has_code and raw_code_length. Combined with clear input requirements and alternative routing, an agent has everything needed to invoke the tool correctly.

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?

Schema coverage is 100%, so a baseline of 3 applies, but the description adds real value by explicitly marking scid as REQUIRED with the 64-hex constraint, suggesting a known-good example, and clarifying that topoheight is optional and that omitting it uses the latest tip. This enriches the schema's terse descriptions.

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 uses a specific verb-resource pair ('fetch a DERO smart contract ... and return its function surface, classification ... narrative, and curated DVM docs citations') and clearly differentiates itself from raw retrieval tools like dero_get_sc and deeper tools like tela_inspect. An agent can confidently understand what this tool does and why it exists.

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

Usage Guidelines5/5

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

The description explicitly states when to call ('when the user wants to UNDERSTAND a smart contract'), tells the agent to PREFER this over chaining dero_get_sc with a docs lookup, and names tela_inspect as the alternative for deep TELA parsing. It even provides a known-good example SCID, leaving no ambiguity about invocation context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/DHEBP/dero-mcp-server'

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