Skip to main content
Glama

explain_smart_contract

Read-only

Analyzes a DERO smart contract by fetching its code, variables, and balances, then returns a function surface, contract pattern type, narrative, and curated documentation to help understand its purpose and usage.

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
Behavior5/5

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

Annotations indicate readOnlyHint=true. Description reveals composite nature (parses source, sorts keys, picks docs page), behavior for unknown SCIDs (has_code false, empty functions), and that it returns raw_code_length for fallback. No contradictions.

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?

Description is long but well-structured into sections (purpose, when to call, input requirements, output). Could be slightly more concise but remains clear and informative.

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?

Despite no output schema and minimal annotations, description covers purpose, usage, inputs, output structure, and edge cases (unknown SCID). Ensures agent can confidently use the tool.

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

Parameters5/5

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

Schema coverage is 100%. Description adds significant meaning: scid required (64 hex chars, example given), topoheight optional (omit for latest tip), and explains output fields including kind enums and surface structure.

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?

Description clearly states it fetches a DERO smart contract and returns function surface, classification, narrative, and docs citations. It distinguishes from siblings by mentioning tela_inspect for deep TELA parse and notes this composite avoids chaining dero_get_sc.

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?

Explicit when-to-call: when user wants to understand a smart contract. Also states when-not-to: for deep TELA parse use tela_inspect. Provides alternative tool name.

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

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