New Your team’s decisions, in one playbook every coding agent works from. Never answer your agent twice

read_contract_state

Read the current on-chain value of a view/pure function. Fetches from the chain (cached 60s) and returns the decoded output. Accepts slug or chain+address.

SERVERSmarts Md SOURCEdefi-io/smartcontract
Low RISK CLASS
Category Read
Parameters 50 required
Recommended Allowedsee the rule below
Registry record Grade B, identity unverified Pull the record →

This record as markdown: /tools/defi-io-smartcontract/read-contract-state.md

What read_contract_state does on Smarts Md

AI agents call read_contract_state to retrieve information from Smarts Md without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

ParameterTypeRequiredDescription
args array Positional arguments for the function, in ABI order. Addresses as 0x hex strings, integers as integers. Default: []
slug string Curated slug like 'uni-eth'. Alternative to chain+address.
chain string Chain slug: eth, base, arbitrum, optimism, or polygon. Required unless `slug` is given.
address string The 0x-prefixed contract address. Required unless `slug` is given.
function_name string ABI function name, e.g. 'totalSupply' or 'balanceOf'.

Parameters from the server's own tool schema.

Why read_contract_state is rated Low

This tool retrieves data from smart contracts without any capability to modify, execute transactions, or trigger state changes. View and pure functions are read-only by definition in Solidity. The 60-second caching and decoding of outputs are standard for blockchain data queries. No financial transactions, code execution, or data destruction are possible.

From the tool's definition Tool description explicitly states "Read the current on-chain value" and "returns the decoded output". The name "read_contract_state" and function signature indicate query-only access to view/pure functions with no state modification.

Questions about read_contract_state

What does the read_contract_state tool do? +

Read the current on-chain value of a view/pure function. Fetches from the chain (cached 60s) and returns the decoded output. Accepts slug or chain+address. It is categorised as a Read tool in the Smarts Md MCP Server, which means it retrieves data without modifying state.

What parameters does read_contract_state accept? +

read_contract_state accepts 5 parameters: args, slug, chain, address, function_name. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on read_contract_state? +

Register the Smarts Md MCP server in PolicyLayer and add a rule for read_contract_state: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Smarts Md. Nothing to install.

What risk level is read_contract_state? +

read_contract_state is a Read tool with low risk. Read-only tools are generally safe to allow by default.

Can I rate-limit read_contract_state? +

Yes. Add a rate_limit block to the read_contract_state rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block read_contract_state completely? +

Set action: deny in the PolicyLayer policy for read_contract_state. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides read_contract_state? +

read_contract_state is provided by the Smarts Md MCP server (defi-io/smartcontract). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

More on Smarts Md, and thousands of servers like it.

// THE MCP REGISTRY

PolicyLayer tracks 44,603 MCP servers and 515,000+ tools.

Every server has a live record: who publishes it, whether it answers without auth, its risk grade, every tool classified, the recommended policy. This page is one line of Smarts Md's. Pull the full record:

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.