Skip to main content
Glama

explain_smart_contract

Read-only

Analyze any DERO smart contract: decode functions, state variables, and balances, then get a plain-language explanation and relevant documentation references.

Instructions

Composite: fetch a DERO smart contract (code + variables + balances) and return its function surface, a classification of the contract pattern (token | registry | minimal | generic), a plain-language narrative, and curated DVM docs citations re-ordered so the most relevant page is first.

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 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?

Matches readOnlyHint=true and destructiveHint=false annotations by describing a read-only fetch-and-analyze operation. Discloses edge cases (e.g., unknown SCID results in empty functions) and output structure, fully informing the agent.

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 front-loaded with a concise summary, then delves into usage guidelines and output details. While thorough, it could be slightly more concise; however, every sentence adds value, making it effective.

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?

Given no output schema, the description thoroughly explains the output structure (kind, surface, narrative, etc.) and handles edge cases (missing SCID). Annotations and schema cover safety and parameters, so description completes the picture.

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?

The input schema covers both parameters (100%), and the description adds valuable context: scid is required, must be 64 hex chars, gives an example (0000…0001), and clarifies topoheight is optional. This goes beyond the schema's pattern and description.

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 fetches and returns a smart contract's function surface, classification, narrative, and docs citations. It distinguishes from siblings like dero_get_sc by emphasizing the composite analysis and avoiding manual chaining.

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?

Explicitly states when to call (when user wants to UNDERSTAND a smart contract) and recommends preferring this over chaining dero_get_sc with docs lookup. Provides input requirements and output format, guiding the agent's decision.

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