Skip to main content
Glama

ROOTSTOCK / ORCHARD Agent Tools

BASED NUT's official agent toolchain — read + guarded execution — for the ROOTSTOCK DEX and the Orchard ecosystem on Base (chain 8453) and Base Sepolia (84532).

One tested domain core, five surfaces:

  • CLI: rootstock (JSON in, JSON out)

  • MCP stdio server: rootstock-mcp (37 tools: read by default, execute opt-in)

  • Python SDK: rootstock_tools.Toolchain

  • Node/TypeScript bridge: sdk-ts/

  • Loopback HTTP API + OpenAPI: rootstock-api (127.0.0.1 only)

Plus 20 installable Agent Skills (rootstock skills install).

Two operating modes, structurally separated:

  • Default = read-only. No signer env key set = no signing code reachable. The read client cannot broadcast (method allowlist, structural).

  • Opt-in guarded execution. Set ROOTSTOCK_SIGNER_KEY + ROOTSTOCK_EXECUTE_CHAINS to enable: EIP-1559 signing (key never in any output), chain allowlist, router allowlist from the pinned registry, per-tx + daily wei caps, mandatory simulate-first, kill switch (ROOTSTOCK_EXECUTE_KILL=1). pip install '.[execute]' for eth-account.

Install

python3 -m pip install .            # core runtime is stdlib-only
python3 -m pip install .[tools]     # + audit script deps (pyyaml, jsonschema)

Related MCP server: Base Intel MCP

Quick start

rootstock networks
rootstock setup registries          # explicit, pinned-source download (BASEDNUT/rootstock-monorepo)
rootstock resolve --chain 8453 --name Vault
rootstock capabilities
rootstock skills list

Set custom RPC endpoints via ROOTSTOCK_RPC_BASE and ROOTSTOCK_RPC_BASE_SEPOLIA (e.g. an archive gateway for deep block ranges — public endpoints wall archive reads).

Live-verified examples (BASED NUT deployments, 2026-10-27)

# All 22 ROOTSTOCK mainnet pools discovered live via Vault PoolRegistered events
ROOTSTOCK_RPC_BASE=https://base.gateway.tenderly.co   rootstock pools list --chain 8453 --from-block 52707735 --to-block 52707830

# Rootstock WETH/BAL Pool on Base Sepolia (block 47265032)
rootstock pools list --chain 84532 --from-block 47265020 --to-block 47265052

# Real pool state: balances, fee, token metadata — no fabricated USD
rootstock call pools.inspect --args '{"chain_id":84532,"pool":"0x1aba4e89fd64e41fe3081fabf6ce33cb613977c7"}'

# Receipt status for the pool-create transaction
rootstock call transactions.status --args '{"chain_id":84532,"hash":"0x8ac424c53e1bd26802d47f7014349c9b19315acd14d8c247ee25d16ea44df4c9"}'

# Multi-token balances (pinned to one block, cross-checked vs raw eth_call oracle)
rootstock call accounts.balances --args '{"chain_id":8453,"wallet":"0x135b208ac2480B0d876944416De16E7a3B9A1F65","tokens":["0xb8de15fb529d98c93c749de63c749d48d25a30df","0xAC130701aa31c284c36609E2489f150F419AD7AD"]}'

Full live end-to-end evidence: docs/E2E_EVIDENCE_2026-10-27.md.

Python SDK

from rootstock_tools import Toolchain
kit = Toolchain()
print(kit.run('rpc.get_health', {'chain_id': 8453}))
print(kit.run('registry.resolve_deployment', {'chain_id': 8453, 'name': 'Vault'}))

MCP

rootstock-mcp   # stdio; 2025-11-25 legacy handshake + 2026-07-28 stateless era

Boundaries

  • Read mode signs nothing. Execute mode broadcasts ONLY through the policy executor: sim-first mandatory, caps structural, kill switch absolute.

  • eth_call and unsigned envelopes are not authorization to move funds.

  • Payments/x402 features are excluded by user direction; do not add them back without a new request.

  • The optional policy file restricts tools inside a trusted process; it is not a sandbox for arbitrary local code.

  • The HTTP API binds 127.0.0.1 only and must not be exposed publicly.

  • The pinned registry is provenance data. Resolution is not approval.

  • Superseded S113-fix deployments (11 addresses) are refused at load and resolve time — hardcoded blocklist + registry superseded map enforcement. Four contracts superseded by the S113-fix redeployment remain listed upstream and must never be used.

Status

v0.9.0 — read + guarded-execute toolchain, live-proven on Base Sepolia: zero-value and funded transfers, ERC20 approve, and a real swap on the Rootstock WETH/BAL pool — all policy-gated, simulated, receipt-verified. Over-cap and kill-switch refusals live-proven. See docs/E2E_EVIDENCE_2026-10-27.md for the full battery.

License

MIT — see LICENSE.

Contact

BASED NUT — https://basednut.com — security contact in the monorepo .well-known/security.txt.

Available Tools

37 tools
accounts.balancesaccounts / balancesA
Read-onlyIdempotent

Read up to 32 explicitly provided token balances at one pinned chain block (no automatic portfolio discovery).

Inputs: tokens (required), wallet (required), chain_id (required).

accounts.eligibilityaccounts / eligibilityC
Read-onlyIdempotent

Check on-chain balances against explicitly configured Orchard root/LP rules; not an access grant.

Inputs: wallet (required), chain_id (required).

accounts.positionsaccounts / positionsB
Read-onlyIdempotent

Read wallet balance of explicitly named ERC20 or LP token, not full portfolio.

Inputs: token (required), wallet (required), chain_id (required).

analytics.rankingsanalytics / rankingsB
Read-onlyIdempotent

Rank pools by observed indexed swap count, not wallet ELO or APY.

Inputs: chain_id (required), limit.

analytics.turnoveranalytics / turnoverC
Read-onlyIdempotent

Report turnover only with known, matching volume and TVL denominator.

Inputs: chain_id (required), pool.

analytics.tvlanalytics / tvlC
Read-onlyIdempotent

Explain TVL availability based on verified price/reserve inputs; never fabricate USD estimates.

Inputs: chain_id (required), pool.

analytics.volume_feesanalytics / volume_feesC
Read-onlyIdempotent

Aggregate available indexed swap input and fee amounts in raw token units; never presume complete coverage.

Inputs: chain_id (required), pool, since_timestamp.

assets.lookupassets / lookupB
Read-onlyIdempotent

Read explicit ERC20 contract metadata directly from chain.

Inputs: address (required), chain_id (required).

assets.wrapper_underlyingassets / wrapper_underlyingB
Read-onlyIdempotent

Probe ERC4626 asset() directly; unsupported wrappers remain unknown.

Inputs: address (required), chain_id (required).

capabilities.listcapabilities / listB
Read-onlyIdempotent

List the implemented read-only capabilities and their schemas.

Inputs: no named parameters.

history.eventshistory / eventsC
Read-onlyIdempotent

Query locally indexed Vault swap, pool and liquidity events.

Inputs: chain_id (required), kind, pool, limit, +1 more.

history.statushistory / statusC
Read-onlyIdempotent

Describe event-index checkpoints and local data coverage.

Inputs: chain_id (required).

observations.statusobservations / statusC
Read-onlyIdempotent

Report which indexed observations exist and which analytics are missing.

Inputs: chain_id (required).

policy.evaluatepolicy / evaluateC
Read-onlyIdempotent

Fail-closed policy demonstration: reads allowed, writes denied; not signer authorization.

Inputs: action (required), chain_id (required).

pools.inspectpools / inspectC
Read-onlyIdempotent

Read actual pool token addresses via Rootstock Vault; no guessed reserve/TVL.

Inputs: pool (required), chain_id (required).

pools.listpools / listB
Read-onlyIdempotent

Read Vault PoolRegistered events for an explicitly bounded inclusive block window, with block provenance.

Inputs: chain_id (required), to_block (required), from_block (required), limit.

pools.observepools / observeB
Read-onlyIdempotent

Read pool onchain data plus local indexed registration evidence.

Inputs: pool (required), chain_id (required).

quotes.swapquotes / swapD
Read-onlyIdempotent

Return explicit routing prerequisites; quote unavailable without audited Rootstock SOR.

Inputs: chain_id (required), token_in (required), token_out (required), amount_raw (required), +2 more.

registry.abi_catalogregistry / abi_catalogA
Read-onlyIdempotent

Return reviewed partial read-only ABI signatures and verified Vault event topics; not a full exact build ABI.

Inputs: no named parameters.

registry.abi_selectorregistry / abi_selectorC
Read-onlyIdempotent

Return an exact selector for a reviewed read ABI function, not a deploy/transaction authorization.

Inputs: interface (required), signature (required).

registry.list_contractsregistry / list_contractsC
Read-onlyIdempotent

List Rootstock registry deployments, preserving task identity and deprecated records.

Inputs: chain_id (required).

registry.list_networksregistry / list_networksA
Read-onlyIdempotent

List Rootstock network identities and available local source provenance.

Inputs: no named parameters.

registry.resolve_deploymentregistry / resolve_deploymentB
Read-onlyIdempotent

Resolve a Rootstock deployment against a pinned canonical local registry; ambiguous names require task.

Inputs: name (required), chain_id (required), task.

registry.verify_contractregistry / verify_contractB
Read-onlyIdempotent

Check pinned Rootstock contract code exists on the selected chain; not a bytecode audit.

Inputs: name (required), chain_id (required), task.

rpc.get_healthrpc / get_healthB
Read-onlyIdempotent

Read the configured Base RPC chain ID, latest block and hash.

Inputs: chain_id (required).

skills.listskills / listA
Read-onlyIdempotent

List bundled Rootstock and Orchard agent skills; no third-party skill installation.

Inputs: no named parameters.

skills.readskills / readA
Read-onlyIdempotent

Read one bundled SKILL.md by its exact, validated skill name.

Inputs: name (required).

topology.exploretopology / exploreC
Read-onlyIdempotent

Construct token-pool graph from indexed pools and RPC token lists, labeling missing tokens.

Inputs: chain_id (required), limit.

topology.rootedtopology / rootedC
Read-onlyIdempotent

Provisional rooted Branch/Graft/Whorl classification from observed pools and configured root; not canonical Orchard ranks.

Inputs: chain_id (required), limit.

transactions.approve_routertransactions / approve_routerB
Read-onlyIdempotent

ERC20 approve whose spender must be an allowlisted Rootstock router. Arbitrary spenders refused. Sim-first, policy-gated.

Inputs: token (required), router (required), chain_id (required), amount_wei (required).

transactions.call_routertransactions / call_routerC
Read-onlyIdempotent

Broadcast a raw contract call to an allowlisted Rootstock router only. Arbitrary targets refused. Sim-first, policy-gated.

Inputs: data (required), router (required), chain_id (required), value_wei.

transactions.preparetransactions / prepareB
Read-onlyIdempotent

Return an unsigned policy-unapproved transaction envelope, only for pinned Rootstock targets.

Inputs: chain_id (required), transaction_json (required).

transactions.sendtransactions / sendB
Read-onlyIdempotent

Sign and broadcast an ETH value transfer through the policy-gated executor (env signer key, chain+value caps, simulation-first). Caps are structural; no bypass.

Inputs: to (required), chain_id (required), value_wei (required).

transactions.simulatetransactions / simulateB
Read-onlyIdempotent

Explicit eth_call on a pinned Rootstock target; no signing or policy approval.

Inputs: chain_id (required), transaction_json (required).

transactions.statustransactions / statusB
Read-onlyIdempotent

Read transaction receipt and unverified finality from RPC.

Inputs: hash (required), chain_id (required).

watch.cursorwatch / cursorB
Read-onlyIdempotent

Query indexed Vault events after a specific block and log index, preserving intra-block updates.

Inputs: chain_id (required), since_block (required), since_log_index (required), limit.

watch.pollwatch / pollB
Read-onlyIdempotent

Check locally indexed events newer than a given block; caller schedules repeated polls.

Inputs: chain_id (required), since_block (required), limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 37 tools

    Disambiguation3/5

    Most tools are namespaced and clearly distinct, but several read/status/event tools overlap: accounts.balances vs accounts.positions, history.events vs watch.poll/watch.cursor, history.status vs observations.status, and pools.inspect/list/observe. The verbose descriptions help clarify boundaries, but an agent could still misselect among these closely related read-only tools.

    Naming Consistency5/5

    The entire set follows a consistent namespace.action pattern (e.g. accounts.balances, pools.list, registry.resolve_deployment, transactions.simulate). Multiword actions consistently use snake_case after the namespace dot, with no mixed camelCase or vague verb styles.

    Tool Count2/5

    37 tools is heavy for the apparent scope, especially since many are niche read-only observability/status/watch tools that could be consolidated. While the server spans multiple domains, the count exceeds the typical well-scoped 3-15 range by a wide margin.

    Completeness4/5

    The surface covers a broad lifecycle across accounts, analytics, pools, registry, transactions, policy, and indexing. However, quotes.swap is a deliberate dead end without an audited SOR, and some transaction paths are restricted to allowlisted routers rather than general ERC20 operations, leaving minor gaps.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides real Bitcoin full node data via 17 tools, with pay-per-call in USDC on Base mainnet. Free tools include blockchain info, fees, and mempool; paid tools enable transaction tracking, address analysis, and more.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Read-only on-chain intelligence for AI agents on Base, providing tools to read balances, token metadata, gas, and transaction status live from chain without API keys.
      5
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to fetch crypto market and on-chain data, including prices across venues, token facts, OHLC candles, market overview, DeFi TVL, and wallet balances, with two free tools and the rest paid per call in USDC on Base via x402.
      8
      48 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Exposes real-time Hyperliquid explorer and analytics data from flowscan.xyz as 44 read-only tools, letting AI agents answer questions about protocol revenue, perp market positioning, individual open positions, wallet activity, and staking without an API key. It runs over stdio against Hyperliquid mainnet only, using the same API routes the Flowscan frontend calls.
      44
      MIT