@oracle-agent/oracle 0.13.1 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +99 -0
- package/README.md +20 -14
- package/SECURITY.md +6 -8
- package/SETUP.md +25 -27
- package/bin/desk-server.mjs +473 -0
- package/bin/oracle-data-mcp.mjs +1252 -0
- package/bin/oracle-equities.mjs +168 -0
- package/bin/oracle-init.mjs +525 -0
- package/bin/oracle-public-server.mjs +36 -0
- package/bin/oracle-route.mjs +254 -0
- package/bin/oracle-scan.mjs +192 -0
- package/bin/oracle-upgrade.mjs +42 -0
- package/bin/oracle.mjs +34 -0
- package/docs/adding-a-chain.md +229 -0
- package/docs/architecture.md +139 -0
- package/docs/buzz-integration.md +115 -0
- package/docs/cli.md +143 -0
- package/docs/connectors.md +13 -0
- package/docs/hyperliquid-builder-code.md +50 -0
- package/docs/locals-only-fee-waiver.md +34 -0
- package/docs/oracle-pack-standard.md +29 -0
- package/docs/profiles.md +151 -0
- package/docs/public-surface.md +206 -0
- package/examples/add-a-chain.mjs +65 -0
- package/examples/oracle-pack-template.mjs +38 -0
- package/examples/research-a-token.mjs +70 -0
- package/package.json +78 -32
- package/plugins/oracle-owner-gate/__init__.py +288 -0
- package/plugins/oracle-owner-gate/plugin.yaml +9 -0
- package/{dist/assets/profiles → profiles}/oracle/SOUL.md +0 -14
- package/protocols/templates/safe-erc20/SECURITY.md +16 -0
- package/protocols/templates/safe-erc20/foundry.toml +12 -0
- package/protocols/templates/safe-erc20/remappings.txt +2 -0
- package/protocols/templates/safe-erc20/src/SafeERC20.sol +53 -0
- package/protocols/templates/safe-erc20/test/SafeERC20.t.sol +72 -0
- package/public/oracle-splash/_variants/ice.html +3 -3
- package/public/oracle-splash/_variants/ivory.html +3 -3
- package/public/oracle-splash/downloads/index.html +34 -223
- package/public/oracle-splash/index.html +11 -11
- package/scripts/adversarial-bench.mjs +114 -0
- package/scripts/build-dist.mjs +119 -0
- package/scripts/build-inscription.py +230 -0
- package/scripts/check-doc-drift.mjs +123 -0
- package/scripts/check-test-count.mjs +105 -0
- package/scripts/e2e-hl-markets.mjs +21 -0
- package/scripts/e2e-hl-perps.mjs +48 -0
- package/scripts/e2e-hypercore-staking.mjs +128 -0
- package/scripts/e2e-solana-bitcoin.mjs +183 -0
- package/scripts/guard-publish.mjs +22 -0
- package/scripts/protocol-template-gate.mjs +15 -0
- package/scripts/public-api-scan.mjs +23 -0
- package/scripts/publish-dist.mjs +67 -0
- package/scripts/record-hero-cli.sh +80 -0
- package/scripts/secret-scan.mjs +169 -0
- package/scripts/smoke-dist-bins.mjs +89 -0
- package/scripts/verify-dist.mjs +29 -0
- package/scripts/verify-v3-venues.mjs +233 -0
- package/skins/oracle.yaml +56 -0
- package/src/action-receipts.mjs +265 -0
- package/src/action-semantics.mjs +62 -0
- package/src/address-book.mjs +208 -0
- package/src/agent-auth.mjs +206 -0
- package/src/approval-guard.mjs +282 -0
- package/src/attestation-secret.mjs +94 -0
- package/src/audit-log.mjs +196 -0
- package/src/auth/oauth.mjs +672 -0
- package/src/auto-slippage.mjs +378 -0
- package/src/capability-posture.mjs +125 -0
- package/src/cards.mjs +422 -0
- package/src/chains.mjs +62 -0
- package/src/cli/chain-catalog.mjs +215 -0
- package/src/cli/chain-state.mjs +74 -0
- package/src/cli/commands/auth.mjs +193 -0
- package/src/cli/commands/bootstrap.mjs +87 -0
- package/src/cli/commands/chain.mjs +143 -0
- package/src/cli/commands/chat.mjs +465 -0
- package/src/cli/commands/credential.mjs +9 -0
- package/src/cli/commands/data-mcp.mjs +18 -0
- package/src/cli/commands/data.mjs +75 -0
- package/src/cli/commands/doctor.mjs +136 -0
- package/src/cli/commands/equities.mjs +41 -0
- package/src/cli/commands/farm.mjs +129 -0
- package/src/cli/commands/fees.mjs +109 -0
- package/src/cli/commands/follow.mjs +130 -0
- package/src/cli/commands/harness.mjs +63 -0
- package/src/cli/commands/help.mjs +7 -0
- package/src/cli/commands/init.mjs +27 -0
- package/src/cli/commands/mcp.mjs +154 -0
- package/src/cli/commands/model.mjs +106 -0
- package/src/cli/commands/plugins.mjs +275 -0
- package/src/cli/commands/prepare.mjs +12 -0
- package/src/cli/commands/public.mjs +20 -0
- package/src/cli/commands/resolve.mjs +64 -0
- package/src/cli/commands/route.mjs +12 -0
- package/src/cli/commands/runner.mjs +9 -0
- package/src/cli/commands/scan.mjs +12 -0
- package/src/cli/commands/setup.mjs +294 -0
- package/src/cli/commands/sign.mjs +21 -0
- package/src/cli/commands/signer.mjs +9 -0
- package/src/cli/commands/swap.mjs +102 -0
- package/src/cli/commands/upgrade.mjs +12 -0
- package/src/cli/commands/vault.mjs +9 -0
- package/src/cli/commands/version.mjs +22 -0
- package/src/cli/first-run.mjs +23 -0
- package/src/cli/kernel.mjs +262 -0
- package/src/cli/mcp-targets/chatgpt.mjs +51 -0
- package/src/cli/mcp-targets/claude-code.mjs +39 -0
- package/src/cli/mcp-targets/claude-desktop.mjs +24 -0
- package/src/cli/mcp-targets/codex.mjs +41 -0
- package/src/cli/mcp-targets/cursor.mjs +32 -0
- package/src/cli/mcp-targets/shared.mjs +71 -0
- package/src/cli/mcp-targets/vscode.mjs +39 -0
- package/src/cli/messaging-platforms.mjs +217 -0
- package/src/cli/model-config.mjs +78 -0
- package/src/cli/operator-dispatch.mjs +194 -0
- package/src/cli/oracle-harness.py +415 -0
- package/src/cli/paths.mjs +107 -0
- package/src/cli/runtime.mjs +351 -0
- package/src/cli/setup-state.mjs +168 -0
- package/src/cli/spawn-child.mjs +43 -0
- package/src/data/catalog.mjs +858 -0
- package/src/data/desk-data.mjs +877 -0
- package/src/data/http.mjs +253 -0
- package/src/data/names.mjs +188 -0
- package/src/data/provider-endpoint.mjs +94 -0
- package/src/data/providers/aave-v3.mjs +139 -0
- package/src/data/providers/across-bridge.mjs +41 -0
- package/src/data/providers/aerodrome.mjs +245 -0
- package/src/data/providers/aevo.mjs +33 -0
- package/src/data/providers/approval-indexer.mjs +133 -0
- package/src/data/providers/approvals.mjs +594 -0
- package/src/data/providers/babylon-staking.mjs +149 -0
- package/src/data/providers/balancer.mjs +209 -0
- package/src/data/providers/beefy-yields.mjs +45 -0
- package/src/data/providers/birdeye-tokens.mjs +33 -0
- package/src/data/providers/bisq-markets.mjs +145 -0
- package/src/data/providers/bitcoin-esplora.mjs +216 -0
- package/src/data/providers/bitcoin-meta.mjs +378 -0
- package/src/data/providers/blockscout.mjs +14 -0
- package/src/data/providers/bob-rootstock.mjs +198 -0
- package/src/data/providers/braiins-insights.mjs +103 -0
- package/src/data/providers/bridge-aggregator.mjs +259 -0
- package/src/data/providers/bridges.mjs +242 -0
- package/src/data/providers/bungee.mjs +29 -0
- package/src/data/providers/celestia-da.mjs +38 -0
- package/src/data/providers/changenow.mjs +135 -0
- package/src/data/providers/compound.mjs +32 -0
- package/src/data/providers/connext.mjs +28 -0
- package/src/data/providers/convex.mjs +30 -0
- package/src/data/providers/cow-protocol.mjs +110 -0
- package/src/data/providers/cowswap.mjs +415 -0
- package/src/data/providers/curve.mjs +201 -0
- package/src/data/providers/das-assets.mjs +59 -0
- package/src/data/providers/debridge.mjs +109 -0
- package/src/data/providers/defillama.mjs +88 -0
- package/src/data/providers/dexscreener.mjs +43 -0
- package/src/data/providers/drift.mjs +32 -0
- package/src/data/providers/dydx.mjs +41 -0
- package/src/data/providers/evm-rpc.mjs +225 -0
- package/src/data/providers/farming.mjs +291 -0
- package/src/data/providers/geckoterminal.mjs +34 -0
- package/src/data/providers/gmx.mjs +496 -0
- package/src/data/providers/hiro-stacks.mjs +150 -0
- package/src/data/providers/hl-assets.mjs +165 -0
- package/src/data/providers/hl-info.mjs +108 -0
- package/src/data/providers/hl-markets.mjs +210 -0
- package/src/data/providers/hl-outcome.mjs +61 -0
- package/src/data/providers/hl-perps.mjs +419 -0
- package/src/data/providers/hl-staking.mjs +353 -0
- package/src/data/providers/hl-ws.mjs +119 -0
- package/src/data/providers/hyperevm-dex.mjs +49 -0
- package/src/data/providers/jito-mev.mjs +117 -0
- package/src/data/providers/jupiter-venues.mjs +119 -0
- package/src/data/providers/jupiter.mjs +315 -0
- package/src/data/providers/kamino-strategies.mjs +143 -0
- package/src/data/providers/l2beat-tvl.mjs +42 -0
- package/src/data/providers/lifi.mjs +166 -0
- package/src/data/providers/liquid-esplora.mjs +152 -0
- package/src/data/providers/magiceden-ordinals.mjs +141 -0
- package/src/data/providers/magiceden-sol.mjs +406 -0
- package/src/data/providers/mempool-lightning.mjs +144 -0
- package/src/data/providers/mempool-mining.mjs +142 -0
- package/src/data/providers/meteora-dlmm.mjs +168 -0
- package/src/data/providers/morpho.mjs +177 -0
- package/src/data/providers/nft-gallery.mjs +163 -0
- package/src/data/providers/nft-portfolio.mjs +494 -0
- package/src/data/providers/odos.mjs +156 -0
- package/src/data/providers/ondo.mjs +31 -0
- package/src/data/providers/oneinch.mjs +174 -0
- package/src/data/providers/opensea-multichain.mjs +136 -0
- package/src/data/providers/opensea-nft.mjs +371 -0
- package/src/data/providers/orca.mjs +29 -0
- package/src/data/providers/ordinals-runes.mjs +180 -0
- package/src/data/providers/pancakeswap.mjs +28 -0
- package/src/data/providers/paraswap.mjs +125 -0
- package/src/data/providers/pendle.mjs +188 -0
- package/src/data/providers/poly-clob.mjs +283 -0
- package/src/data/providers/poly-public.mjs +96 -0
- package/src/data/providers/poly-ws.mjs +103 -0
- package/src/data/providers/polygon-staking.mjs +227 -0
- package/src/data/providers/portfolio-history.mjs +394 -0
- package/src/data/providers/portfolio.mjs +600 -0
- package/src/data/providers/pyth-price-feeds.mjs +172 -0
- package/src/data/providers/raydium.mjs +35 -0
- package/src/data/providers/relayscan-mev.mjs +72 -0
- package/src/data/providers/rfq.mjs +15 -0
- package/src/data/providers/rh-agent.mjs +59 -0
- package/src/data/providers/sanctum-lst.mjs +180 -0
- package/src/data/providers/satflow.mjs +341 -0
- package/src/data/providers/signed-material-guard.mjs +108 -0
- package/src/data/providers/solana-rpc.mjs +197 -0
- package/src/data/providers/solend-lending.mjs +166 -0
- package/src/data/providers/spark-lend.mjs +42 -0
- package/src/data/providers/squid-router.mjs +29 -0
- package/src/data/providers/stargate.mjs +29 -0
- package/src/data/providers/sushiswap.mjs +30 -0
- package/src/data/providers/symbiotic-restaking.mjs +41 -0
- package/src/data/providers/thorchain.mjs +36 -0
- package/src/data/providers/traderjoe.mjs +28 -0
- package/src/data/providers/twap.mjs +152 -0
- package/src/data/providers/uniswap-v3.mjs +457 -0
- package/src/data/providers/uniswap-v4.mjs +414 -0
- package/src/data/providers/vertex.mjs +41 -0
- package/src/data/providers/wallet-watch.mjs +264 -0
- package/src/data/providers/wormhole.mjs +28 -0
- package/src/data/providers/yearn.mjs +31 -0
- package/src/data/providers/zerox.mjs +167 -0
- package/src/data/public-api-scan.mjs +61 -0
- package/src/data/quote-placeholder.mjs +31 -0
- package/src/desk/swap-prepare.mjs +194 -0
- package/src/equities/bridge.mjs +388 -0
- package/src/equities/fixtures/bridge_routes.json +159 -0
- package/src/equities/fixtures/dst_transitions.json +29 -0
- package/src/equities/fixtures/equity_dex_pools.json +154 -0
- package/src/equities/fixtures/hip3_l2books.json +2711 -0
- package/src/equities/fixtures/nyse_holidays.json +1 -0
- package/src/equities/fixtures/oracles.json +100 -0
- package/src/equities/fixtures/rh_pool_state.json +244 -0
- package/src/equities/fixtures/solana_xstocks.json +704 -0
- package/src/equities/fixtures/ton_xstocks.json +35 -0
- package/src/equities/fixtures/universe.json +411 -0
- package/src/equities/fixtures/venues.json +3542 -0
- package/src/equities/fixtures.mjs +405 -0
- package/src/equities/funding.mjs +142 -0
- package/src/equities/index.mjs +166 -0
- package/src/equities/liveness.mjs +148 -0
- package/src/equities/marketHours.mjs +249 -0
- package/src/equities/normalize.mjs +295 -0
- package/src/equities/num.mjs +146 -0
- package/src/equities/prepare.mjs +95 -0
- package/src/equities/rank.mjs +260 -0
- package/src/equities/sourceNum.mjs +69 -0
- package/src/equities/types.mjs +220 -0
- package/src/equities/venues/arcus-perp.mjs +84 -0
- package/src/equities/venues/arcus-spot.mjs +105 -0
- package/src/equities/venues/hyperliquid-hip3.mjs +224 -0
- package/src/equities/venues/rh-uniswap.mjs +216 -0
- package/src/equities/venues/solana-xstocks.mjs +139 -0
- package/src/equities/venues/ton-stonfi.mjs +139 -0
- package/src/exact-integer.mjs +72 -0
- package/src/exec-policy.mjs +419 -0
- package/src/flags.mjs +15 -0
- package/src/fresh-window.mjs +76 -0
- package/src/gmx-attestation.mjs +176 -0
- package/src/index.mjs +107 -0
- package/src/licensing/locals-only.mjs +25 -0
- package/src/nft-gas-war-guard.mjs +139 -0
- package/src/onboarding/agent-keys.mjs +161 -0
- package/src/onboarding/harness-configs.mjs +102 -0
- package/src/onboarding/index.mjs +18 -0
- package/src/onboarding/tiers.mjs +139 -0
- package/src/oracle-env.mjs +55 -0
- package/src/package-manifest.mjs +42 -0
- package/src/plugins/agent-plugin-loader.mjs +225 -0
- package/src/portfolio-risk.mjs +170 -0
- package/src/prepare-envelope.mjs +204 -0
- package/src/profile-upgrade.mjs +277 -0
- package/src/protocol-execution.mjs +84 -0
- package/src/protocol-templates/gate.mjs +179 -0
- package/src/protocol-templates/prepare-deploy.mjs +81 -0
- package/src/public-api/agent-grants.mjs +57 -0
- package/src/public-api/buzz-integration.mjs +267 -0
- package/src/public-api/connect-agent.mjs +424 -0
- package/src/public-api/grants.mjs +142 -0
- package/src/public-api/http.mjs +707 -0
- package/src/public-api/metering.mjs +111 -0
- package/src/public-control/aa-adapter.mjs +402 -0
- package/src/public-control/build-registry.mjs +227 -0
- package/src/public-control/bundler-client.mjs +357 -0
- package/src/public-control/grant-indexer.mjs +296 -0
- package/src/public-control/policy-render.mjs +69 -0
- package/src/public-control/policy-schema.mjs +322 -0
- package/src/public-control/runtime-config.mjs +275 -0
- package/src/public-control/session-key-model.mjs +379 -0
- package/src/public-control/session-orchestrator.mjs +418 -0
- package/src/rfq/intent.mjs +180 -0
- package/src/rfq/sources.mjs +181 -0
- package/src/route-attestation.mjs +132 -0
- package/src/router/best-execution.mjs +326 -0
- package/src/router/index.mjs +250 -0
- package/src/router/integrator-fee.mjs +135 -0
- package/src/router/prepare-bridge.mjs +293 -0
- package/src/router/prepare-route.mjs +398 -0
- package/src/router/proposal.mjs +311 -0
- package/src/router/risk-classifier.mjs +119 -0
- package/src/router/route-sources.mjs +364 -0
- package/src/scanner/chains.config.mjs +543 -0
- package/src/scanner/contract.mjs +270 -0
- package/src/scanner/evm-scanner.mjs +394 -0
- package/src/scanner/index.mjs +9 -0
- package/src/scanner/v2-venue.mjs +351 -0
- package/src/scanner/v3-venue.mjs +308 -0
- package/src/scopes.mjs +44 -0
- package/src/sell-simulation.mjs +167 -0
- package/src/signals/engine.mjs +146 -0
- package/src/signals/index.mjs +1 -0
- package/src/token-transfer-guard.mjs +188 -0
- package/src/tui/app.mjs +438 -0
- package/src/tui/backend.mjs +215 -0
- package/src/tui/format.mjs +272 -0
- package/src/tui/gateway-client.mjs +177 -0
- package/src/tui/input.mjs +501 -0
- package/src/tui/memory.mjs +105 -0
- package/src/tui/meta-learn.mjs +85 -0
- package/src/tui/renderer.mjs +443 -0
- package/src/tui/scheduler.mjs +205 -0
- package/src/tui/skills-loader.mjs +140 -0
- package/src/tui/standalone-client.mjs +752 -0
- package/src/tui/theme.mjs +81 -0
- package/src/vault-attestation.mjs +146 -0
- package/src/venues.mjs +206 -0
- package/src/watch-preferences.mjs +85 -0
- package/dist/action-receipts.mjs +0 -1
- package/dist/action-semantics.mjs +0 -1
- package/dist/address-book.mjs +0 -2
- package/dist/bin/desk-server.mjs +0 -59
- package/dist/bin/oracle-data-mcp.mjs +0 -8
- package/dist/bin/oracle-equities.mjs +0 -20
- package/dist/bin/oracle-init.mjs +0 -24
- package/dist/bin/oracle-public-server.mjs +0 -5
- package/dist/bin/oracle-route.mjs +0 -22
- package/dist/bin/oracle-scan.mjs +0 -18
- package/dist/bin/oracle-upgrade.mjs +0 -21
- package/dist/bin/oracle.mjs +0 -76
- package/dist/chains.mjs +0 -1
- package/dist/cli/commands/auth.mjs +0 -16
- package/dist/cli/commands/bootstrap.mjs +0 -18
- package/dist/cli/commands/chain.mjs +0 -21
- package/dist/cli/commands/chat.mjs +0 -45
- package/dist/cli/commands/credential.mjs +0 -1
- package/dist/cli/commands/data-mcp.mjs +0 -2
- package/dist/cli/commands/data.mjs +0 -12
- package/dist/cli/commands/doctor.mjs +0 -5
- package/dist/cli/commands/equities.mjs +0 -15
- package/dist/cli/commands/farm.mjs +0 -59
- package/dist/cli/commands/follow.mjs +0 -28
- package/dist/cli/commands/gate.mjs +0 -13
- package/dist/cli/commands/harness.mjs +0 -15
- package/dist/cli/commands/help.mjs +0 -1
- package/dist/cli/commands/init.mjs +0 -3
- package/dist/cli/commands/mcp.mjs +0 -60
- package/dist/cli/commands/model.mjs +0 -54
- package/dist/cli/commands/plugins.mjs +0 -38
- package/dist/cli/commands/prepare.mjs +0 -2
- package/dist/cli/commands/public.mjs +0 -3
- package/dist/cli/commands/resolve.mjs +0 -23
- package/dist/cli/commands/route.mjs +0 -2
- package/dist/cli/commands/runner.mjs +0 -1
- package/dist/cli/commands/scan.mjs +0 -2
- package/dist/cli/commands/setup.mjs +0 -34
- package/dist/cli/commands/sign.mjs +0 -21
- package/dist/cli/commands/signer.mjs +0 -1
- package/dist/cli/commands/swap.mjs +0 -36
- package/dist/cli/commands/upgrade.mjs +0 -2
- package/dist/cli/commands/vault.mjs +0 -1
- package/dist/cli/commands/version.mjs +0 -2
- package/dist/data/desk-data.mjs +0 -55
- package/dist/data/names.mjs +0 -2
- package/dist/data/providers/farming.mjs +0 -2
- package/dist/equities/index.mjs +0 -1
- package/dist/index.mjs +0 -60
- package/dist/nft-gas-war-guard.mjs +0 -1
- package/dist/onboarding/harness-configs.mjs +0 -4
- package/dist/portfolio-risk.mjs +0 -1
- package/dist/prepare-envelope.mjs +0 -1
- package/dist/public-api/agent-grants.mjs +0 -3
- package/dist/public-control/policy-schema.mjs +0 -1
- package/dist/router/index.mjs +0 -2
- package/dist/scanner/index.mjs +0 -4
- package/dist/signals/index.mjs +0 -1
- package/dist/watch-preferences.mjs +0 -1
- /package/{dist/assets/profiles → profiles}/_template/SOUL.md +0 -0
- /package/{dist/assets/profiles → profiles}/_template/profile.json +0 -0
- /package/{dist/assets/profiles → profiles}/bitcoin-agent/SOUL.md +0 -0
- /package/{dist/assets/profiles → profiles}/bitcoin-agent/profile.json +0 -0
- /package/{dist/assets/profiles → profiles}/hyperliquid-agent/SOUL.md +0 -0
- /package/{dist/assets/profiles → profiles}/hyperliquid-agent/profile.json +0 -0
- /package/{dist/assets/profiles → profiles}/oracle/profile.json +0 -0
- /package/{dist/assets/profiles → profiles}/polymarket-agent/SOUL.md +0 -0
- /package/{dist/assets/profiles → profiles}/polymarket-agent/profile.json +0 -0
- /package/{dist/assets/profiles → profiles}/profile.schema.json +0 -0
- /package/{dist/assets/profiles → profiles}/protocol-builder/SOUL.md +0 -0
- /package/{dist/assets/profiles → profiles}/protocol-builder/profile.json +0 -0
- /package/{dist/assets/profiles → profiles}/robinhood-agent/SOUL.md +0 -0
- /package/{dist/assets/profiles → profiles}/robinhood-agent/profile.json +0 -0
- /package/{dist/assets/profiles → profiles}/solana-agent/SOUL.md +0 -0
- /package/{dist/assets/profiles → profiles}/solana-agent/profile.json +0 -0
- /package/{dist/assets/profiles → profiles}/stable-agent/SOUL.md +0 -0
- /package/{dist/assets/profiles → profiles}/stable-agent/profile.json +0 -0
- /package/{dist/assets/skills → skills}/balance/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/bitcoin-l1.md +0 -0
- /package/{dist/assets/skills → skills}/chain-defi-ecosystem-profiling.md +0 -0
- /package/{dist/assets/skills → skills}/evm-contract-research.md +0 -0
- /package/{dist/assets/skills → skills}/hyperliquid.md +0 -0
- /package/{dist/assets/skills → skills}/multichain-exec-desk.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-action-semantics/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-best-execution/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-best-execution.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-bitcoin/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-chain-graphs-telegram-cards/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-chat/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-chat/chain.SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-chat/setup.SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-circuit-breaker/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-contract-research/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-desk/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-desk.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-dex-launch/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-equities/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-grants/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-hypercore-staking/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-hyperliquid/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-meme-token-sniper/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-multichain-nft-launch/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-multichain-token-launch/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-nft-gacha-launch/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-nft-mint-gas-war/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-polymarket/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-protocol-builder/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-protocol-security/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-public-product/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-receipts/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-receipts.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-rfq-tokenized-assets/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-smart-wallet-scanner/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-solana/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-solana-nft/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/oracle-token-research/SKILL.md +0 -0
- /package/{dist/assets/skills → skills}/solana.md +0 -0
|
@@ -0,0 +1,1252 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Oracle data MCP — read-only multichain market/discovery plane.
|
|
3
|
+
// Loaded by an Oracle/Hermes profile. Never expose signing or broadcast here.
|
|
4
|
+
//
|
|
5
|
+
// Every tool is a READ or a prepared unsigned action. No key handling, signing,
|
|
6
|
+
// or broadcast. Routes to the Oracle data server read/prepare plane (/data/call),
|
|
7
|
+
// which is unauthenticated on loopback.
|
|
8
|
+
// This is the "scan all public APIs" surface: DeFiLlama protocol TVL, DexScreener
|
|
9
|
+
// token/search, LI.FI + Uniswap quotes, multi-chain RPC balances/blocks.
|
|
10
|
+
//
|
|
11
|
+
// Mirrors the Oracle exec MCP stdio JSON-RPC shape.
|
|
12
|
+
|
|
13
|
+
import fs from "node:fs";
|
|
14
|
+
import process from "node:process";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
import { env } from "../src/oracle-env.mjs";
|
|
17
|
+
import { listAddresses, lookupAddress, rememberAddress, forgetAddress } from "../src/address-book.mjs";
|
|
18
|
+
|
|
19
|
+
const DATA_URL = (env("ORACLE_DATA_URL", "MAD_DESK_URL", "http://127.0.0.1:8787")).replace(/\/$/, "");
|
|
20
|
+
|
|
21
|
+
const tools = [
|
|
22
|
+
{
|
|
23
|
+
name: "data_catalog",
|
|
24
|
+
description:
|
|
25
|
+
"List every read-plane provider the desk exposes (id, venue, chainIds, ops). Use this to discover what public APIs are available before calling data_call. Read-only.",
|
|
26
|
+
inputSchema: { type: "object", properties: {} },
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "data_health",
|
|
30
|
+
description:
|
|
31
|
+
"Health of every read-plane provider (which public APIs are up / configured). Read-only.",
|
|
32
|
+
inputSchema: { type: "object", properties: {} },
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "data_call",
|
|
36
|
+
description:
|
|
37
|
+
"Generic escape hatch: call any provider/op from the catalog. provider+op are required; args is a free-form object matching that op. Read-only. Use data_catalog first to see valid provider/op pairs.",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
required: ["provider", "op"],
|
|
41
|
+
properties: {
|
|
42
|
+
provider: { type: "string", description: "provider id, e.g. defillama, dexscreener, lifi, evm-rpc" },
|
|
43
|
+
op: { type: "string", description: "op name for that provider, e.g. protocols, search, quote" },
|
|
44
|
+
args: { type: "object", description: "op arguments (free-form)" },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "llama_protocols",
|
|
50
|
+
description:
|
|
51
|
+
"DeFiLlama: full protocol list with TVL, chain(s), category, 1d/7d change. The primary cross-chain protocol scanner. Read-only. Large payload — filter client-side.",
|
|
52
|
+
inputSchema: { type: "object", properties: {} },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "llama_prices",
|
|
56
|
+
description:
|
|
57
|
+
"DeFiLlama current prices for coins keyed 'chain:address' or 'coingecko:id' (comma-joined or array). Read-only.",
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: "object",
|
|
60
|
+
required: ["coins"],
|
|
61
|
+
properties: {
|
|
62
|
+
coins: { type: "string", description: "comma-joined coin keys, e.g. 'ethereum:0x...,coingecko:bitcoin'" },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "dex_search",
|
|
68
|
+
description:
|
|
69
|
+
"DexScreener search across all chains by symbol/name/address. Returns matching pairs with price, liquidity, volume, chain. Read-only.",
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: "object",
|
|
72
|
+
required: ["q"],
|
|
73
|
+
properties: { q: { type: "string", description: "query: symbol, name, or token address" } },
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "dex_token",
|
|
78
|
+
description:
|
|
79
|
+
"DexScreener pairs for a specific token address (any chain). Price, liquidity, volume, pair addresses. Read-only.",
|
|
80
|
+
inputSchema: {
|
|
81
|
+
type: "object",
|
|
82
|
+
required: ["address"],
|
|
83
|
+
properties: { address: { type: "string" } },
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "lifi_quote",
|
|
88
|
+
description:
|
|
89
|
+
"LI.FI cross-chain / DEX aggregator quote (no key). Best route + expected out for a swap or bridge. Read-only.",
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: "object",
|
|
92
|
+
required: ["fromChain", "toChain", "fromToken", "toToken", "fromAmount"],
|
|
93
|
+
properties: {
|
|
94
|
+
fromChain: { type: "number" },
|
|
95
|
+
toChain: { type: "number" },
|
|
96
|
+
fromToken: { type: "string" },
|
|
97
|
+
toToken: { type: "string" },
|
|
98
|
+
fromAmount: { type: "string", description: "raw integer amount (wei-scale)" },
|
|
99
|
+
fromAddress: { type: "string", description: "optional; defaults to operator wallet" },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "portfolio_balance",
|
|
105
|
+
description:
|
|
106
|
+
"Read-only balance aggregation across every configured EVM chain plus Solana, Bitcoin, and Hyperliquid. Reports native assets, supported token/collectible reads, failed or missing providers, unverified assets, timestamps, and known priced value without pretending it is a complete total. Public addresses only; never signs or broadcasts.",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: {
|
|
110
|
+
addresses: {
|
|
111
|
+
type: "object",
|
|
112
|
+
description: "Optional public wallet addresses by family. Omit configured families to use ORACLE_*_ADDRESS defaults.",
|
|
113
|
+
properties: {
|
|
114
|
+
evm: { type: "string" },
|
|
115
|
+
solana: { type: "string" },
|
|
116
|
+
bitcoin: { type: "string" },
|
|
117
|
+
hyperliquid: { type: "string" },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
evmChainIds: {
|
|
121
|
+
type: "array",
|
|
122
|
+
items: { type: "number" },
|
|
123
|
+
description: "Optional EVM chain subset. Default is every configured EVM chain.",
|
|
124
|
+
},
|
|
125
|
+
includeTokens: { type: "boolean", description: "Include supported token reads. Default true." },
|
|
126
|
+
includeCollectibles: { type: "boolean", description: "Include supported collectible reads. Default true." },
|
|
127
|
+
includePrices: { type: "boolean", description: "Fetch current DeFiLlama native prices. Default true." },
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "portfolio_snapshot",
|
|
133
|
+
description:
|
|
134
|
+
"Query the current multichain balance and NFT inventory, then append one compact profile-local observation for historical tracking. Stores public-address fingerprint, coverage, breakdown, and known priced value only; no keys, signatures, executable payloads, or raw NFT metadata. Returns the live balance, NFT result, and recorded snapshot.",
|
|
135
|
+
inputSchema: {
|
|
136
|
+
type: "object",
|
|
137
|
+
properties: {
|
|
138
|
+
addresses: {
|
|
139
|
+
type: "object",
|
|
140
|
+
properties: {
|
|
141
|
+
evm: { type: "string" },
|
|
142
|
+
solana: { type: "string" },
|
|
143
|
+
bitcoin: { type: "string" },
|
|
144
|
+
hyperliquid: { type: "string" },
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
evmChainIds: { type: "array", items: { type: "number" } },
|
|
148
|
+
includeTokens: { type: "boolean" },
|
|
149
|
+
includeCollectibles: { type: "boolean" },
|
|
150
|
+
includePrices: { type: "boolean" },
|
|
151
|
+
includeNfts: { type: "boolean", description: "Include provider-estimated NFT value. Default true." },
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "portfolio_history",
|
|
157
|
+
description:
|
|
158
|
+
"Read profile-local portfolio observations in a time range. Unknown or unavailable values remain null and are never converted to zero. Defaults to the configured public-address portfolio fingerprint.",
|
|
159
|
+
inputSchema: {
|
|
160
|
+
type: "object",
|
|
161
|
+
properties: {
|
|
162
|
+
addresses: {
|
|
163
|
+
type: "object",
|
|
164
|
+
properties: {
|
|
165
|
+
evm: { type: "string" },
|
|
166
|
+
solana: { type: "string" },
|
|
167
|
+
bitcoin: { type: "string" },
|
|
168
|
+
hyperliquid: { type: "string" },
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
portfolioId: { type: "string" },
|
|
172
|
+
allPortfolios: { type: "boolean", description: "Return observations for every public-address fingerprint in this profile." },
|
|
173
|
+
since: { type: "string", description: "Inclusive ISO 8601 lower bound." },
|
|
174
|
+
until: { type: "string", description: "Inclusive ISO 8601 upper bound." },
|
|
175
|
+
limit: { type: "number", description: "1-1000, default 100." },
|
|
176
|
+
order: { type: "string", enum: ["asc", "desc"] },
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "portfolio_value_graph",
|
|
182
|
+
description:
|
|
183
|
+
"Render a static SVG line graph from profile-local portfolio snapshots. Plots known priced value only, labels incomplete coverage, includes provider-estimated NFT values when recorded, and omits unavailable observations instead of plotting fake zeroes.",
|
|
184
|
+
inputSchema: {
|
|
185
|
+
type: "object",
|
|
186
|
+
properties: {
|
|
187
|
+
addresses: {
|
|
188
|
+
type: "object",
|
|
189
|
+
properties: {
|
|
190
|
+
evm: { type: "string" },
|
|
191
|
+
solana: { type: "string" },
|
|
192
|
+
bitcoin: { type: "string" },
|
|
193
|
+
hyperliquid: { type: "string" },
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
portfolioId: { type: "string" },
|
|
197
|
+
allPortfolios: { type: "boolean" },
|
|
198
|
+
since: { type: "string" },
|
|
199
|
+
until: { type: "string" },
|
|
200
|
+
limit: { type: "number", description: "Historical observations to consider, max 1000." },
|
|
201
|
+
maxPoints: { type: "number", description: "Rendered point cap, 2-500, default 200." },
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "nft_inventory",
|
|
207
|
+
description:
|
|
208
|
+
"Read all discoverable NFTs for configured EVM, Solana, and Bitcoin addresses. Returns normalized assets, image URLs, estimated values, per-chain partial failures, flagged/NSFW items separated from visible items, listing coverage, and explicit unsupported chains. Read-only.",
|
|
209
|
+
inputSchema: {
|
|
210
|
+
type: "object",
|
|
211
|
+
properties: {
|
|
212
|
+
addresses: {
|
|
213
|
+
type: "object",
|
|
214
|
+
properties: {
|
|
215
|
+
evm: { type: "string" },
|
|
216
|
+
solana: { type: "string" },
|
|
217
|
+
bitcoin: { type: "string" },
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
chains: { type: "array", items: { type: "string" }, description: "Optional chain slug subset." },
|
|
221
|
+
pageSize: { type: "number", description: "OpenSea items per page, max 200." },
|
|
222
|
+
maxPages: { type: "number", description: "Maximum pages per chain, max 25." },
|
|
223
|
+
bitcoinLimit: { type: "number" },
|
|
224
|
+
includePnl: { type: "boolean", description: "Include OpenSea-indexed account PnL when available. Default true." },
|
|
225
|
+
costBasis: { type: "object", description: "Optional user-supplied assetKey -> {costUsd,feesUsd,acquiredAt,source}. Missing basis stays unavailable, never zero." },
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: "nft_gallery",
|
|
231
|
+
description:
|
|
232
|
+
"Generate one static NFT contact-sheet image page from wallet inventory or supplied normalized items. External metadata is never rendered as HTML; only allowlisted JPEG/PNG/WebP bytes are embedded and unsafe or missing media becomes a placeholder.",
|
|
233
|
+
inputSchema: {
|
|
234
|
+
type: "object",
|
|
235
|
+
properties: {
|
|
236
|
+
addresses: {
|
|
237
|
+
type: "object",
|
|
238
|
+
properties: { evm: { type: "string" }, solana: { type: "string" }, bitcoin: { type: "string" } },
|
|
239
|
+
},
|
|
240
|
+
chains: { type: "array", items: { type: "string" } },
|
|
241
|
+
items: { type: "array", items: { type: "object" }, description: "Optional normalized inventory items. Omit to scan configured wallets." },
|
|
242
|
+
page: { type: "number", description: "1-based gallery page." },
|
|
243
|
+
pageSize: { type: "number", description: "1-12 items per page." },
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: "nft_pnl",
|
|
249
|
+
description:
|
|
250
|
+
"NFT PnL with explicit methodology. Returns OpenSea-indexed account-level PnL where available plus per-item unrealized estimates only when both user-supplied acquisition cost and provider estimated current value exist. Missing history is unavailable, never zero.",
|
|
251
|
+
inputSchema: {
|
|
252
|
+
type: "object",
|
|
253
|
+
properties: {
|
|
254
|
+
addresses: {
|
|
255
|
+
type: "object",
|
|
256
|
+
properties: { evm: { type: "string" }, solana: { type: "string" }, bitcoin: { type: "string" } },
|
|
257
|
+
},
|
|
258
|
+
chains: { type: "array", items: { type: "string" } },
|
|
259
|
+
costBasis: { type: "object" },
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "nft_prepare_list",
|
|
265
|
+
description:
|
|
266
|
+
"Prepare an NFT listing for OpenSea EVM, Magic Eden Solana, or Satflow Bitcoin after explicit user review. Requires userConfirmed=true plus asset, marketplace, price, currency where applicable, and future expiry. Magic Eden Solana also requires confirmation exactly: list <tokenMint> on magiceden-sol for <priceSol> SOL until <expiry>. Returns approval/signing actions, an unsigned Solana transaction, or an unsigned Bitcoin PSBT. Never signs, submits, or broadcasts.",
|
|
267
|
+
inputSchema: {
|
|
268
|
+
type: "object",
|
|
269
|
+
required: ["marketplace", "userConfirmed"],
|
|
270
|
+
properties: {
|
|
271
|
+
marketplace: { type: "string", enum: ["opensea", "magiceden", "magiceden-sol", "satflow"] },
|
|
272
|
+
userConfirmed: { type: "boolean" },
|
|
273
|
+
chain: { type: "string" },
|
|
274
|
+
seller: { type: "string" },
|
|
275
|
+
contract: { type: "string" },
|
|
276
|
+
tokenId: { type: "string" },
|
|
277
|
+
quantity: { type: "number" },
|
|
278
|
+
priceAmount: { type: "string" },
|
|
279
|
+
currency: { type: "string" },
|
|
280
|
+
endTime: { type: "string" },
|
|
281
|
+
useCreatorFee: { type: "boolean" },
|
|
282
|
+
taker: { type: "string" },
|
|
283
|
+
tokenMint: { type: "string" },
|
|
284
|
+
tokenATA: { type: "string" },
|
|
285
|
+
auctionHouse: { type: "string" },
|
|
286
|
+
priceSol: { type: "string" },
|
|
287
|
+
expiry: { description: "Future ISO 8601 timestamp or Unix seconds. Magic Eden Solana listings require finite future expiry; no-expiry is refused." },
|
|
288
|
+
confirmation: { type: "string", description: "Required for Magic Eden Solana listings. Exact phrase: list <tokenMint> on magiceden-sol for <priceSol> SOL until <expiry>." },
|
|
289
|
+
inscriptionId: { type: "string" },
|
|
290
|
+
runesOutput: { type: "string" },
|
|
291
|
+
ordAddress: { type: "string" },
|
|
292
|
+
receiveAddress: { type: "string" },
|
|
293
|
+
priceSats: { type: "string" },
|
|
294
|
+
tapKey: { type: "string" },
|
|
295
|
+
collectionSlug: { type: "string" },
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: "rpc_balance",
|
|
301
|
+
description:
|
|
302
|
+
"Native token balance of an address on a chain via public RPC. Read-only. Omit address to read the operator wallet.",
|
|
303
|
+
inputSchema: {
|
|
304
|
+
type: "object",
|
|
305
|
+
required: ["chainId"],
|
|
306
|
+
properties: {
|
|
307
|
+
chainId: { type: "number" },
|
|
308
|
+
address: { type: "string" },
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: "rpc_block",
|
|
314
|
+
description: "Latest block number on a chain via public RPC. Read-only.",
|
|
315
|
+
inputSchema: {
|
|
316
|
+
type: "object",
|
|
317
|
+
required: ["chainId"],
|
|
318
|
+
properties: { chainId: { type: "number" } },
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
name: "solana_balance",
|
|
323
|
+
description: "Solana mainnet SOL balance for a base58 public key. Read-only; no signing or broadcast.",
|
|
324
|
+
inputSchema: {
|
|
325
|
+
type: "object",
|
|
326
|
+
required: ["address"],
|
|
327
|
+
properties: { address: { type: "string" }, commitment: { type: "string" } },
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
name: "solana_token_accounts",
|
|
332
|
+
description: "Solana SPL token accounts for an owner, optionally filtered by mint. Read-only.",
|
|
333
|
+
inputSchema: {
|
|
334
|
+
type: "object",
|
|
335
|
+
required: ["owner"],
|
|
336
|
+
properties: { owner: { type: "string" }, mint: { type: "string" }, commitment: { type: "string" } },
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: "solana_simulate",
|
|
341
|
+
description: "Simulate a base64 Solana transaction through RPC. Read-only; never signs or broadcasts.",
|
|
342
|
+
inputSchema: {
|
|
343
|
+
type: "object",
|
|
344
|
+
required: ["transaction"],
|
|
345
|
+
properties: { transaction: { type: "string" }, sigVerify: { type: "boolean" }, replaceRecentBlockhash: { type: "boolean" } },
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: "jupiter_venues",
|
|
350
|
+
description: "Jupiter Solana venue map, optionally verified on-chain against executable BPF loader ownership. Read-only.",
|
|
351
|
+
inputSchema: {
|
|
352
|
+
type: "object",
|
|
353
|
+
properties: { verify: { type: "boolean" }, rpc: { type: "string" } },
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
name: "jupiter_quote",
|
|
358
|
+
description: "Jupiter Solana Swap API quote with a hard <=100 bps slippage cap. Read-only.",
|
|
359
|
+
inputSchema: {
|
|
360
|
+
type: "object",
|
|
361
|
+
required: ["inputMint", "outputMint", "amount"],
|
|
362
|
+
properties: { inputMint: { type: "string" }, outputMint: { type: "string" }, amount: { type: "string" }, slippageBps: { type: "number" } },
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
name: "jupiter_prepare",
|
|
367
|
+
description: "Prepare an unsigned Jupiter swap transaction for the user's Solana wallet to sign. No local signer, no broadcast.",
|
|
368
|
+
inputSchema: {
|
|
369
|
+
type: "object",
|
|
370
|
+
required: ["userPublicKey"],
|
|
371
|
+
properties: { userPublicKey: { type: "string" }, quoteResponse: { type: "object" }, inputMint: { type: "string" }, outputMint: { type: "string" }, amount: { type: "string" }, slippageBps: { type: "number" } },
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
name: "btc_health",
|
|
376
|
+
description: "Bitcoin L1 Esplora health + tip height (mempool.space by default). No Core RPC, no keys. Read-only.",
|
|
377
|
+
inputSchema: { type: "object", properties: {} },
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
name: "btc_fees",
|
|
381
|
+
description: "Recommended Bitcoin fee rates (sats/vB). Read-only.",
|
|
382
|
+
inputSchema: { type: "object", properties: {} },
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: "btc_balance",
|
|
386
|
+
description: "Bitcoin address balance in sats via Esplora. Read-only.",
|
|
387
|
+
inputSchema: {
|
|
388
|
+
type: "object",
|
|
389
|
+
required: ["address"],
|
|
390
|
+
properties: { address: { type: "string", description: "bc1…/1…/3… address" } },
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: "btc_utxos",
|
|
395
|
+
description: "UTXOs for a Bitcoin address via Esplora. Read-only.",
|
|
396
|
+
inputSchema: {
|
|
397
|
+
type: "object",
|
|
398
|
+
required: ["address"],
|
|
399
|
+
properties: { address: { type: "string" } },
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: "btc_tx",
|
|
404
|
+
description: "Lookup a Bitcoin transaction by txid via Esplora. Read-only.",
|
|
405
|
+
inputSchema: {
|
|
406
|
+
type: "object",
|
|
407
|
+
required: ["txid"],
|
|
408
|
+
properties: { txid: { type: "string" } },
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
name: "btc_meta_health",
|
|
413
|
+
description:
|
|
414
|
+
"Ordinals/runes indexer health. Reports whether BTC_META_API_URL / vendor API keys are configured. Read-only.",
|
|
415
|
+
inputSchema: { type: "object", properties: {} },
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
name: "btc_rune_balance",
|
|
419
|
+
description:
|
|
420
|
+
"Rune balances for a Bitcoin address (requires configured indexer + optional API key). Read-only.",
|
|
421
|
+
inputSchema: {
|
|
422
|
+
type: "object",
|
|
423
|
+
required: ["address"],
|
|
424
|
+
properties: { address: { type: "string" } },
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: "btc_inscriptions",
|
|
429
|
+
description:
|
|
430
|
+
"Inscriptions controlled by an address. REQUIRES a keyed indexer (ordinals.com has no address index). Returns unknownNotEmpty:true when unconfigured — that means UNKNOWN, never 'wallet holds none'. Protect these UTXOs from fee spends.",
|
|
431
|
+
inputSchema: {
|
|
432
|
+
type: "object",
|
|
433
|
+
required: ["address"],
|
|
434
|
+
properties: { address: { type: "string" }, limit: { type: "number" } },
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
name: "btc_inscription_info",
|
|
439
|
+
description:
|
|
440
|
+
"Inscription metadata by inscription id (content type/length, height, sat, fee). KEYLESS via ordinals.com recursive. Read-only.",
|
|
441
|
+
inputSchema: {
|
|
442
|
+
type: "object",
|
|
443
|
+
required: ["inscriptionId"],
|
|
444
|
+
properties: {
|
|
445
|
+
inscriptionId: { type: "string", description: "<64-hex-txid>i<index>" },
|
|
446
|
+
},
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: "btc_inscription_children",
|
|
451
|
+
description:
|
|
452
|
+
"Child inscriptions of a parent (collections). KEYLESS via ordinals.com recursive. Read-only.",
|
|
453
|
+
inputSchema: {
|
|
454
|
+
type: "object",
|
|
455
|
+
required: ["inscriptionId"],
|
|
456
|
+
properties: {
|
|
457
|
+
inscriptionId: { type: "string", description: "<64-hex-txid>i<index>" },
|
|
458
|
+
page: { type: "number" },
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
name: "btc_ord_block_info",
|
|
464
|
+
description:
|
|
465
|
+
"Ord node block info / indexer tip. KEYLESS. Use to confirm the ordinals indexer is at the same tip as Esplora before trusting metaprotocol reads.",
|
|
466
|
+
inputSchema: {
|
|
467
|
+
type: "object",
|
|
468
|
+
properties: { height: { type: "number", description: "omit for current tip" } },
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "satflow_health",
|
|
473
|
+
description:
|
|
474
|
+
"Satflow marketplace health (primary BTC ordinals/runes market after Magic Eden BTC sunset). Needs SATFLOW_API_KEY. Read-only.",
|
|
475
|
+
inputSchema: { type: "object", properties: {} },
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
name: "satflow_floors",
|
|
479
|
+
description: "Satflow collection floor prices. type=ordinals|runes. Read-only.",
|
|
480
|
+
inputSchema: {
|
|
481
|
+
type: "object",
|
|
482
|
+
properties: {
|
|
483
|
+
type: { type: "string", description: "ordinals or runes" },
|
|
484
|
+
ids: { type: "string", description: "optional comma-separated collection ids" },
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
name: "satflow_wallet",
|
|
490
|
+
description: "Satflow wallet contents (ordinals/runes) for an address. Read-only.",
|
|
491
|
+
inputSchema: {
|
|
492
|
+
type: "object",
|
|
493
|
+
required: ["address"],
|
|
494
|
+
properties: { address: { type: "string" }, type: { type: "string" }, limit: { type: "number" } },
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
name: "satflow_item",
|
|
499
|
+
description: "Satflow item detail for an inscription id (listing + bids + meta). Read-only.",
|
|
500
|
+
inputSchema: {
|
|
501
|
+
type: "object",
|
|
502
|
+
required: ["inscriptionId"],
|
|
503
|
+
properties: { inscriptionId: { type: "string" } },
|
|
504
|
+
},
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
name: "satflow_floor_listings",
|
|
508
|
+
description: "Satflow floor listings for collection id(s). Read-only.",
|
|
509
|
+
inputSchema: {
|
|
510
|
+
type: "object",
|
|
511
|
+
required: ["collectionIds"],
|
|
512
|
+
properties: { collectionIds: { type: "string" }, limit: { type: "number" } },
|
|
513
|
+
},
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
name: "scanner_coverage",
|
|
517
|
+
description:
|
|
518
|
+
"Which chains the on-chain scanner supports and which capabilities each one has " +
|
|
519
|
+
"(blockNumber, nativeBalance, tokenBalance, resolveToken, resolvePools, scanBlocks, " +
|
|
520
|
+
"scoreRisk, quote, sellSimulation, prepareUnsignedTx). Read-only.",
|
|
521
|
+
inputSchema: { type: "object", properties: {} },
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
name: "scan_token",
|
|
525
|
+
description:
|
|
526
|
+
"Resolve a token on an EVM chain: metadata, its pools, and a risk score. Works on " +
|
|
527
|
+
"chains no indexer covers because it reads the chain directly. Read-only.",
|
|
528
|
+
inputSchema: {
|
|
529
|
+
type: "object",
|
|
530
|
+
properties: {
|
|
531
|
+
chainId: { type: "number", description: "EVM chain id, e.g. 4663 for Robinhood Chain" },
|
|
532
|
+
token: { type: "string", description: "token contract address" },
|
|
533
|
+
},
|
|
534
|
+
required: ["chainId", "token"],
|
|
535
|
+
},
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
name: "wallet_balances",
|
|
539
|
+
description:
|
|
540
|
+
"Native balance for an address on an EVM chain, plus one token balance when a token " +
|
|
541
|
+
"address is supplied. Read-only; never signs.",
|
|
542
|
+
inputSchema: {
|
|
543
|
+
type: "object",
|
|
544
|
+
properties: {
|
|
545
|
+
chainId: { type: "number" },
|
|
546
|
+
address: { type: "string", description: "wallet address to inspect" },
|
|
547
|
+
token: { type: "string", description: "optional token contract for a token balance" },
|
|
548
|
+
},
|
|
549
|
+
required: ["chainId", "address"],
|
|
550
|
+
},
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
name: "address_book_remember",
|
|
554
|
+
description:
|
|
555
|
+
"Remember a wallet address with a label. Call this whenever someone states their address " +
|
|
556
|
+
"or an agent/counterparty wallet is discovered, so it survives the conversation. " +
|
|
557
|
+
"Stores labels only — never private keys, seeds, or passphrases.",
|
|
558
|
+
inputSchema: {
|
|
559
|
+
type: "object",
|
|
560
|
+
required: ["address", "label"],
|
|
561
|
+
properties: {
|
|
562
|
+
address: { type: "string", description: "0x address" },
|
|
563
|
+
label: { type: "string", description: "short name, e.g. research-agent" },
|
|
564
|
+
who: { type: "string", description: "person or entity the wallet belongs to" },
|
|
565
|
+
role: { type: "string", description: "agent | owner | person | counterparty | venue" },
|
|
566
|
+
chainIds: { type: "array", items: { type: "number" } },
|
|
567
|
+
notes: { type: "string" },
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: "address_book_list",
|
|
573
|
+
description:
|
|
574
|
+
"List remembered wallets (owner, agent, people, counterparties). Read-only. " +
|
|
575
|
+
"Check this before sending or bridging to a person.",
|
|
576
|
+
inputSchema: {
|
|
577
|
+
type: "object",
|
|
578
|
+
properties: {
|
|
579
|
+
q: { type: "string", description: "search across label, who, address, notes" },
|
|
580
|
+
role: { type: "string" },
|
|
581
|
+
who: { type: "string" },
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
name: "address_book_lookup",
|
|
587
|
+
description: "Look up one 0x address in the durable address book. Read-only.",
|
|
588
|
+
inputSchema: {
|
|
589
|
+
type: "object",
|
|
590
|
+
required: ["address"],
|
|
591
|
+
properties: { address: { type: "string" } },
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
name: "address_book_forget",
|
|
596
|
+
description: "Remove a remembered address, optionally only one label for it.",
|
|
597
|
+
inputSchema: {
|
|
598
|
+
type: "object",
|
|
599
|
+
required: ["address"],
|
|
600
|
+
properties: { address: { type: "string" }, label: { type: "string" } },
|
|
601
|
+
},
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
name: "rfq_quote",
|
|
605
|
+
description:
|
|
606
|
+
"Create a cross-chain RFQ intent and fan it out to reviewed solver or venue sources. " +
|
|
607
|
+
"Returns firm quote objects with intentHash, firmQuoteHash, expiry, min receive, " +
|
|
608
|
+
"and unsigned executable artifacts. Never signs or broadcasts.",
|
|
609
|
+
inputSchema: {
|
|
610
|
+
type: "object",
|
|
611
|
+
required: ["fromChainId", "toChainId", "sellToken", "buyToken", "sellAmount", "receiver", "deadlineMs"],
|
|
612
|
+
properties: {
|
|
613
|
+
fromChainId: { type: "number" },
|
|
614
|
+
toChainId: { type: "number" },
|
|
615
|
+
sellToken: { type: "string" },
|
|
616
|
+
buyToken: { type: "string" },
|
|
617
|
+
sellAmount: { type: "string" },
|
|
618
|
+
receiver: { type: "string" },
|
|
619
|
+
deadlineMs: { type: "number" },
|
|
620
|
+
minBuyAmount: { type: "string" },
|
|
621
|
+
allowedSources: { type: "array", items: { type: "string" } },
|
|
622
|
+
allowedRouters: { type: "array", items: { type: "string" } },
|
|
623
|
+
slippageBps: { type: "number" },
|
|
624
|
+
decimalsIn: { type: "number" },
|
|
625
|
+
decimalsOut: { type: "number" },
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
name: "best_swap_route",
|
|
631
|
+
description:
|
|
632
|
+
"Compare swap routes across every available aggregator and rank by NET output " +
|
|
633
|
+
"(after gas and fees), not headline quote. Returns the winner plus all " +
|
|
634
|
+
"runners-up so the ranking can be checked rather than trusted.",
|
|
635
|
+
inputSchema: {
|
|
636
|
+
type: "object",
|
|
637
|
+
properties: {
|
|
638
|
+
chainId: { type: "number", description: "EVM chain id, e.g. 8453 for Base" },
|
|
639
|
+
tokenIn: { type: "string", description: "sell token address" },
|
|
640
|
+
tokenOut: { type: "string", description: "buy token address" },
|
|
641
|
+
amountIn: { type: "string", description: "raw units of tokenIn (wei-scale)" },
|
|
642
|
+
taker: { type: "string", description: "address used for quoting only; nothing is signed" },
|
|
643
|
+
decimalsIn: { type: "number" },
|
|
644
|
+
decimalsOut: { type: "number" },
|
|
645
|
+
},
|
|
646
|
+
required: ["chainId", "tokenIn", "tokenOut", "amountIn"],
|
|
647
|
+
},
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
name: "best_bridge_route",
|
|
651
|
+
description:
|
|
652
|
+
"Compare cross-chain bridge routes and rank by NET output. Also reports each " +
|
|
653
|
+
"route's expected duration, which is NOT folded into the score -- a route that " +
|
|
654
|
+
"saves $2 but takes 30 minutes is a trade-off for the caller to make.",
|
|
655
|
+
inputSchema: {
|
|
656
|
+
type: "object",
|
|
657
|
+
properties: {
|
|
658
|
+
fromChainId: { type: "number" },
|
|
659
|
+
toChainId: { type: "number" },
|
|
660
|
+
tokenIn: { type: "string", description: "token on the origin chain" },
|
|
661
|
+
tokenOut: { type: "string", description: "token on the destination chain" },
|
|
662
|
+
amountIn: { type: "string", description: "raw units of tokenIn" },
|
|
663
|
+
taker: { type: "string", description: "address used for quoting only" },
|
|
664
|
+
decimalsOut: { type: "number" },
|
|
665
|
+
},
|
|
666
|
+
required: ["fromChainId", "toChainId", "tokenIn", "tokenOut", "amountIn"],
|
|
667
|
+
},
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
name: "prepare_best_route",
|
|
671
|
+
description:
|
|
672
|
+
"Compare routes, then build the SIGNABLE artifact for the winner. Returns an " +
|
|
673
|
+
"unsigned transaction (LI.FI/ParaSwap/0x) or EIP-712 typed data for an " +
|
|
674
|
+
"off-chain order (CoW) -- the artifactKind field says which, and they require " +
|
|
675
|
+
"different wallet actions. Re-quotes before preparing and reports drift " +
|
|
676
|
+
"against the comparison. Never signs or broadcasts.",
|
|
677
|
+
inputSchema: {
|
|
678
|
+
type: "object",
|
|
679
|
+
properties: {
|
|
680
|
+
chainId: { type: "number" },
|
|
681
|
+
tokenIn: { type: "string" },
|
|
682
|
+
tokenOut: { type: "string" },
|
|
683
|
+
amountIn: { type: "string", description: "raw units of tokenIn" },
|
|
684
|
+
taker: {
|
|
685
|
+
type: "string",
|
|
686
|
+
description:
|
|
687
|
+
"the REAL wallet that will sign. Placeholder/burn addresses are rejected: " +
|
|
688
|
+
"quoting is anonymous, preparing is not.",
|
|
689
|
+
},
|
|
690
|
+
decimalsIn: { type: "number" },
|
|
691
|
+
decimalsOut: { type: "number" },
|
|
692
|
+
source: {
|
|
693
|
+
type: "string",
|
|
694
|
+
description: "force a specific source instead of the winner (flagged in the result)",
|
|
695
|
+
},
|
|
696
|
+
driftToleranceBps: { type: "number", description: "default 100" },
|
|
697
|
+
},
|
|
698
|
+
required: ["chainId", "tokenIn", "tokenOut", "amountIn", "taker"],
|
|
699
|
+
},
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: "prepare_best_bridge_route",
|
|
703
|
+
description:
|
|
704
|
+
"Compare cross-chain bridge routes, then build the signable transaction " +
|
|
705
|
+
"sequence for the winner. Returns a LIST of unsigned transactions -- some " +
|
|
706
|
+
"routes need an approval and a deposit signed in order, and signing only the " +
|
|
707
|
+
"first leaves funds approved but not bridged. Reports the destination chain " +
|
|
708
|
+
"and expected credit time. Bridging is not atomic. Never signs or broadcasts.",
|
|
709
|
+
inputSchema: {
|
|
710
|
+
type: "object",
|
|
711
|
+
properties: {
|
|
712
|
+
fromChainId: { type: "number" },
|
|
713
|
+
toChainId: { type: "number" },
|
|
714
|
+
tokenIn: { type: "string", description: "token on the origin chain" },
|
|
715
|
+
tokenOut: { type: "string", description: "token on the destination chain" },
|
|
716
|
+
amountIn: { type: "string", description: "raw units of tokenIn" },
|
|
717
|
+
taker: { type: "string", description: "the REAL wallet that will sign; placeholders rejected" },
|
|
718
|
+
source: { type: "string", description: "force a source instead of the winner" },
|
|
719
|
+
driftToleranceBps: { type: "number", description: "default 100" },
|
|
720
|
+
},
|
|
721
|
+
required: ["fromChainId", "toChainId", "tokenIn", "tokenOut", "amountIn", "taker"],
|
|
722
|
+
},
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
name: "equity_venues",
|
|
726
|
+
description:
|
|
727
|
+
"Inventory of on-chain equities venues (HIP-3 builder DEXes, Arcus perps/spot on " +
|
|
728
|
+
"Robinhood 4663, RH Uniswap prepare tier, Solana xStocks, TON ston.fi) with tiers " +
|
|
729
|
+
"and a liveness snapshot. Offline fixtures by default. Read-only / prepare-only.",
|
|
730
|
+
inputSchema: { type: "object", properties: {} },
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
name: "equity_quote",
|
|
734
|
+
description:
|
|
735
|
+
"Cross-chain best-execution comparison for a tokenized equity ticker (NVDA, SPY, " +
|
|
736
|
+
"TSLA, ...). Ranks HIP-3, Arcus, RH Uniswap, Solana xStocks, and TON. Returns " +
|
|
737
|
+
"winner + runners-up + bestPreparable (only rh_uniswap is preparable in v1). " +
|
|
738
|
+
"rankedOn is usually gross because fees/gas are unmeasured - say so. Never signs.",
|
|
739
|
+
inputSchema: {
|
|
740
|
+
type: "object",
|
|
741
|
+
required: ["ticker"],
|
|
742
|
+
properties: {
|
|
743
|
+
ticker: { type: "string", description: "equity ticker, e.g. NVDA, SPY, TSLA" },
|
|
744
|
+
sizeUsd: { type: "string", description: "optional notional USD size for impact model" },
|
|
745
|
+
horizonHours: {
|
|
746
|
+
type: "number",
|
|
747
|
+
description: "optional holding horizon; enables funding-adjusted spot-vs-perp ranking",
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
},
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
name: "equity_prepare",
|
|
754
|
+
description:
|
|
755
|
+
"Prepare an UNSIGNED Robinhood-chain Uniswap artifact for a tokenized equity. " +
|
|
756
|
+
"Only the prepare-tier venue (rh_uniswap / chain 4663). Requires the real wallet " +
|
|
757
|
+
"as recipient. requiresWalletSignature=true, backendSigner=false. Never signs or broadcasts.",
|
|
758
|
+
inputSchema: {
|
|
759
|
+
type: "object",
|
|
760
|
+
required: ["ticker", "recipient"],
|
|
761
|
+
properties: {
|
|
762
|
+
ticker: { type: "string" },
|
|
763
|
+
recipient: {
|
|
764
|
+
type: "string",
|
|
765
|
+
description: "the REAL 0x wallet that will sign; placeholders rejected",
|
|
766
|
+
},
|
|
767
|
+
sizeUsd: { type: "string", description: "optional notional USD size" },
|
|
768
|
+
},
|
|
769
|
+
},
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
name: "twap_simulate",
|
|
773
|
+
description:
|
|
774
|
+
"Simulate a TWAP (time-weighted average price) DCA order. Splits a large " +
|
|
775
|
+
"order into equal-sized chunks over a configurable window, quotes every chunk " +
|
|
776
|
+
"at current prices, and returns the schedule + estimated average price. " +
|
|
777
|
+
"Read-only. Never signs or broadcasts. Use before committing to a TWAP.",
|
|
778
|
+
inputSchema: {
|
|
779
|
+
type: "object",
|
|
780
|
+
required: ["chainId", "tokenIn", "tokenOut", "amount", "taker"],
|
|
781
|
+
properties: {
|
|
782
|
+
chainId: { type: "number" },
|
|
783
|
+
tokenIn: { type: "string" },
|
|
784
|
+
tokenOut: { type: "string" },
|
|
785
|
+
amount: { type: "string", description: "raw base units of tokenIn" },
|
|
786
|
+
taker: { type: "string", description: "the REAL wallet that will sign" },
|
|
787
|
+
splits: { type: "number", description: "number of chunks (default 10, max 100)" },
|
|
788
|
+
windowHours: { type: "number", description: "total window in hours (default 6)" },
|
|
789
|
+
slippageBps: { type: "number", description: "slippage cap in bps (default 100)" },
|
|
790
|
+
},
|
|
791
|
+
},
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
name: "bridge_aggregator_scan",
|
|
795
|
+
description:
|
|
796
|
+
"Scan ALL cross-chain bridge routes: deBridge DLN + LI.FI/Relay + ChangeNOW. " +
|
|
797
|
+
"Ranks every route by net output, checks for existing token approvals that " +
|
|
798
|
+
"should be revoked before bridging, and returns the winner + runners-up. " +
|
|
799
|
+
"Read-only. Never signs or broadcasts. ChangeNOW requires ticker symbols.",
|
|
800
|
+
inputSchema: {
|
|
801
|
+
type: "object",
|
|
802
|
+
required: ["fromChainId", "toChainId", "tokenIn", "tokenOut", "amount", "taker"],
|
|
803
|
+
properties: {
|
|
804
|
+
fromChainId: { type: "number" },
|
|
805
|
+
toChainId: { type: "number" },
|
|
806
|
+
tokenIn: { type: "string" },
|
|
807
|
+
tokenOut: { type: "string" },
|
|
808
|
+
amount: { type: "string", description: "raw base units of tokenIn" },
|
|
809
|
+
taker: { type: "string" },
|
|
810
|
+
fromSymbol: { type: "string", description: "ticker for ChangeNOW (e.g. ETH, USDC)" },
|
|
811
|
+
toSymbol: { type: "string", description: "ticker for ChangeNOW" },
|
|
812
|
+
fromDecimals: { type: "number", description: "default 18" },
|
|
813
|
+
toDecimals: { type: "number", description: "default 18" },
|
|
814
|
+
},
|
|
815
|
+
},
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
name: "perps_markets",
|
|
819
|
+
description:
|
|
820
|
+
"Scan perps markets across dYdX (standalone chain), Drift (Solana), and Vertex " +
|
|
821
|
+
"(Arbitrum). Returns ticker, oracle price, funding rate, open interest, and " +
|
|
822
|
+
"24h volume. Read-only. Never signs.",
|
|
823
|
+
inputSchema: {
|
|
824
|
+
type: "object",
|
|
825
|
+
properties: {
|
|
826
|
+
venue: { type: "string", description: "dydx, drift, or vertex (default: all)" },
|
|
827
|
+
},
|
|
828
|
+
},
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
name: "dex_quote",
|
|
832
|
+
description:
|
|
833
|
+
"Quote a swap across PancakeSwap (BSC+), SushiSwap (30+ chains), or Raydium " +
|
|
834
|
+
"(Solana via Jupiter). Specify the DEX and chain. Read-only.",
|
|
835
|
+
inputSchema: {
|
|
836
|
+
type: "object",
|
|
837
|
+
required: ["dex", "chainId", "tokenIn", "tokenOut", "amountIn"],
|
|
838
|
+
properties: {
|
|
839
|
+
dex: { type: "string", description: "pancakeswap, sushiswap, or raydium" },
|
|
840
|
+
chainId: { type: "number" },
|
|
841
|
+
tokenIn: { type: "string" },
|
|
842
|
+
tokenOut: { type: "string" },
|
|
843
|
+
amountIn: { type: "string", description: "raw base units" },
|
|
844
|
+
},
|
|
845
|
+
},
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
name: "options_markets",
|
|
849
|
+
description:
|
|
850
|
+
"Scan on-chain options markets (calls/puts). Currently Aevo. " +
|
|
851
|
+
"Returns instruments, mark prices, funding, open interest. Read-only.",
|
|
852
|
+
inputSchema: { type: "object", properties: {} },
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
name: "lending_markets",
|
|
856
|
+
description:
|
|
857
|
+
"Scan lending protocol markets across Compound ($2B+ TVL). " +
|
|
858
|
+
"Returns supply/borrow APYs, total supply, collateral factors. Read-only.",
|
|
859
|
+
inputSchema: { type: "object", properties: {} },
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
name: "yield_vaults",
|
|
863
|
+
description:
|
|
864
|
+
"Scan yield aggregator vaults across Yearn + Convex. " +
|
|
865
|
+
"Returns vault APYs, TVLs, boosted status. Read-only.",
|
|
866
|
+
inputSchema: { type: "object", properties: {} },
|
|
867
|
+
},
|
|
868
|
+
];
|
|
869
|
+
|
|
870
|
+
// Named tool -> { provider, op, argMap(args) }
|
|
871
|
+
//
|
|
872
|
+
// A default address for read tools (rpc_balance, lifi fromAddress) is read from env
|
|
873
|
+
// and is entirely optional. When unset, those tools require an explicit address --
|
|
874
|
+
// which is the correct default for a public tool: silently substituting SOMEONE'S
|
|
875
|
+
// wallet would both leak whose it is and quote routes against the wrong balances.
|
|
876
|
+
const DEFAULT_ADDRESS = String(
|
|
877
|
+
process.env.ORACLE_DEFAULT_ADDRESS || process.env.MAD_OPERATOR_ADDRESS || "",
|
|
878
|
+
).trim();
|
|
879
|
+
const ROUTES = {
|
|
880
|
+
llama_protocols: () => ({ provider: "defillama", op: "protocols", args: {} }),
|
|
881
|
+
llama_prices: (a) => ({ provider: "defillama", op: "prices", args: { coins: a.coins } }),
|
|
882
|
+
dex_search: (a) => ({ provider: "dexscreener", op: "search", args: { q: a.q } }),
|
|
883
|
+
dex_token: (a) => ({ provider: "dexscreener", op: "token", args: { address: a.address } }),
|
|
884
|
+
lifi_quote: (a) => ({
|
|
885
|
+
provider: "lifi",
|
|
886
|
+
op: "quote",
|
|
887
|
+
args: {
|
|
888
|
+
fromChain: a.fromChain,
|
|
889
|
+
toChain: a.toChain,
|
|
890
|
+
fromToken: a.fromToken,
|
|
891
|
+
toToken: a.toToken,
|
|
892
|
+
fromAmount: a.fromAmount,
|
|
893
|
+
fromAddress: a.fromAddress || DEFAULT_ADDRESS || undefined,
|
|
894
|
+
},
|
|
895
|
+
}),
|
|
896
|
+
portfolio_balance: (a) => ({
|
|
897
|
+
provider: "portfolio",
|
|
898
|
+
op: "balances",
|
|
899
|
+
args: {
|
|
900
|
+
addresses: a.addresses,
|
|
901
|
+
evmChainIds: a.evmChainIds,
|
|
902
|
+
includeTokens: a.includeTokens,
|
|
903
|
+
includeCollectibles: a.includeCollectibles,
|
|
904
|
+
includePrices: a.includePrices,
|
|
905
|
+
},
|
|
906
|
+
}),
|
|
907
|
+
portfolio_snapshot: (a) => ({ provider: "portfolio", op: "snapshot", args: a }),
|
|
908
|
+
portfolio_history: (a) => ({ provider: "portfolio", op: "history", args: a }),
|
|
909
|
+
portfolio_value_graph: (a) => ({ provider: "portfolio", op: "valueGraph", args: a }),
|
|
910
|
+
nft_inventory: (a) => ({ provider: "nft-portfolio", op: "inventory", args: a }),
|
|
911
|
+
nft_gallery: (a) => ({ provider: "nft-portfolio", op: "gallery", args: a }),
|
|
912
|
+
nft_pnl: (a) => ({ provider: "nft-portfolio", op: "pnl", args: a }),
|
|
913
|
+
nft_prepare_list: (a) => ({ provider: "nft-portfolio", op: "prepareList", args: a }),
|
|
914
|
+
rpc_balance: (a) => {
|
|
915
|
+
const addr = a.address || DEFAULT_ADDRESS;
|
|
916
|
+
if (!addr) throw new Error("address required (set ORACLE_DEFAULT_ADDRESS to supply a default)");
|
|
917
|
+
return { provider: "evm-rpc", op: "getBalance", args: { chainId: a.chainId, address: addr } };
|
|
918
|
+
},
|
|
919
|
+
rpc_block: (a) => ({ provider: "evm-rpc", op: "blockNumber", args: { chainId: a.chainId } }),
|
|
920
|
+
solana_balance: (a) => ({ provider: "solana-rpc", op: "getBalance", args: { address: a.address, commitment: a.commitment } }),
|
|
921
|
+
solana_token_accounts: (a) => ({ provider: "solana-rpc", op: "tokenAccounts", args: { owner: a.owner, mint: a.mint, commitment: a.commitment } }),
|
|
922
|
+
solana_simulate: (a) => ({ provider: "solana-rpc", op: "simulate", args: { transaction: a.transaction, sigVerify: a.sigVerify, replaceRecentBlockhash: a.replaceRecentBlockhash } }),
|
|
923
|
+
jupiter_venues: (a) => ({ provider: "jupiter", op: "venues", args: { verify: a.verify, rpc: a.rpc } }),
|
|
924
|
+
jupiter_quote: (a) => ({ provider: "jupiter", op: "quote", args: { inputMint: a.inputMint, outputMint: a.outputMint, amount: a.amount, slippageBps: a.slippageBps } }),
|
|
925
|
+
jupiter_prepare: (a) => ({ provider: "jupiter", op: "prepare", args: { userPublicKey: a.userPublicKey, quoteResponse: a.quoteResponse, inputMint: a.inputMint, outputMint: a.outputMint, amount: a.amount, slippageBps: a.slippageBps } }),
|
|
926
|
+
btc_health: () => ({ provider: "bitcoin-esplora", op: "health", args: {} }),
|
|
927
|
+
btc_fees: () => ({ provider: "bitcoin-esplora", op: "fees", args: {} }),
|
|
928
|
+
btc_balance: (a) => ({ provider: "bitcoin-esplora", op: "address", args: { address: a.address } }),
|
|
929
|
+
btc_utxos: (a) => ({ provider: "bitcoin-esplora", op: "utxos", args: { address: a.address } }),
|
|
930
|
+
btc_tx: (a) => ({ provider: "bitcoin-esplora", op: "tx", args: { txid: a.txid } }),
|
|
931
|
+
btc_meta_health: () => ({ provider: "bitcoin-meta", op: "health", args: {} }),
|
|
932
|
+
btc_rune_balance: (a) => ({ provider: "bitcoin-meta", op: "runeBalances", args: { address: a.address } }),
|
|
933
|
+
btc_inscriptions: (a) => ({
|
|
934
|
+
provider: "bitcoin-meta",
|
|
935
|
+
op: "inscriptions",
|
|
936
|
+
args: { address: a.address, limit: a.limit },
|
|
937
|
+
}),
|
|
938
|
+
btc_inscription_info: (a) => ({
|
|
939
|
+
provider: "bitcoin-meta",
|
|
940
|
+
op: "inscriptionInfo",
|
|
941
|
+
args: { inscriptionId: a.inscriptionId },
|
|
942
|
+
}),
|
|
943
|
+
btc_inscription_children: (a) => ({
|
|
944
|
+
provider: "bitcoin-meta",
|
|
945
|
+
op: "inscriptionChildren",
|
|
946
|
+
args: { inscriptionId: a.inscriptionId, page: a.page },
|
|
947
|
+
}),
|
|
948
|
+
btc_ord_block_info: (a) => ({
|
|
949
|
+
provider: "bitcoin-meta",
|
|
950
|
+
op: "ordBlockInfo",
|
|
951
|
+
args: { height: a.height },
|
|
952
|
+
}),
|
|
953
|
+
satflow_health: () => ({ provider: "satflow", op: "health", args: {} }),
|
|
954
|
+
satflow_floors: (a) => ({
|
|
955
|
+
provider: "satflow",
|
|
956
|
+
op: "collectionFloors",
|
|
957
|
+
args: { type: a.type, ids: a.ids },
|
|
958
|
+
}),
|
|
959
|
+
satflow_wallet: (a) => ({
|
|
960
|
+
provider: "satflow",
|
|
961
|
+
op: "walletContents",
|
|
962
|
+
args: { address: a.address, type: a.type, limit: a.limit },
|
|
963
|
+
}),
|
|
964
|
+
satflow_item: (a) => ({
|
|
965
|
+
provider: "satflow",
|
|
966
|
+
op: "item",
|
|
967
|
+
args: { inscriptionId: a.inscriptionId || a.id },
|
|
968
|
+
}),
|
|
969
|
+
satflow_floor_listings: (a) => ({
|
|
970
|
+
provider: "satflow",
|
|
971
|
+
op: "floorListings",
|
|
972
|
+
args: { collectionIds: a.collectionIds || a.ids, limit: a.limit },
|
|
973
|
+
}),
|
|
974
|
+
};
|
|
975
|
+
|
|
976
|
+
function send(message) {
|
|
977
|
+
process.stdout.write(`${JSON.stringify(message)}\n`);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
function error(id, code, message) {
|
|
981
|
+
send({ jsonrpc: "2.0", id, error: { code, message } });
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
async function httpJson(url, { method = "GET", body } = {}) {
|
|
985
|
+
const res = await fetch(url, {
|
|
986
|
+
method,
|
|
987
|
+
headers: { "content-type": "application/json" },
|
|
988
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
989
|
+
});
|
|
990
|
+
const data = await res.json().catch(() => ({}));
|
|
991
|
+
if (!res.ok) throw new Error(data.error || `HTTP ${res.status}`);
|
|
992
|
+
return data;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
async function deskCall(provider, op, args = {}) {
|
|
996
|
+
return httpJson(`${DATA_URL}/data/call`, {
|
|
997
|
+
method: "POST",
|
|
998
|
+
body: { provider, op, args },
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
async function callTool(name, args = {}) {
|
|
1003
|
+
if (name === "rfq_quote") {
|
|
1004
|
+
const { normalizeRfqIntent } = await import("../src/rfq/intent.mjs");
|
|
1005
|
+
const { requestRfqQuotes } = await import("../src/rfq/sources.mjs");
|
|
1006
|
+
const intent = normalizeRfqIntent({ ...args, sources: args.sources ?? args.allowedSources });
|
|
1007
|
+
return requestRfqQuotes(intent, { decimalsIn: args.decimalsIn, decimalsOut: args.decimalsOut });
|
|
1008
|
+
}
|
|
1009
|
+
// Routing runs IN-PROCESS rather than through the desk HTTP server. The router
|
|
1010
|
+
// fans out to several aggregators itself, so proxying it through /data/call would
|
|
1011
|
+
// add a hop and a second timeout budget for no benefit -- and it means routing
|
|
1012
|
+
// works without a desk server running at all.
|
|
1013
|
+
if (name === "best_swap_route" || name === "best_bridge_route") {
|
|
1014
|
+
const { bestSwapRoute, bestBridgeRoute } = await import("../src/router/index.mjs");
|
|
1015
|
+
return name === "best_swap_route" ? bestSwapRoute(args) : bestBridgeRoute(args);
|
|
1016
|
+
}
|
|
1017
|
+
if (name === "prepare_best_route") {
|
|
1018
|
+
const { prepareBestRoute } = await import("../src/router/prepare-route.mjs");
|
|
1019
|
+
return prepareBestRoute(args);
|
|
1020
|
+
}
|
|
1021
|
+
if (name === "prepare_best_bridge_route") {
|
|
1022
|
+
const { prepareBestBridgeRoute } = await import("../src/router/prepare-bridge.mjs");
|
|
1023
|
+
return prepareBestBridgeRoute(args);
|
|
1024
|
+
}
|
|
1025
|
+
// TWAP (time-weighted average price) DCA simulation.
|
|
1026
|
+
if (name === "twap_simulate") {
|
|
1027
|
+
const { simulateTwap } = await import("../src/data/providers/twap.mjs");
|
|
1028
|
+
return simulateTwap(args);
|
|
1029
|
+
}
|
|
1030
|
+
// Bridge aggregator: deBridge + Squid + Stargate + THORChain + LI.FI + ChangeNOW + revoke.
|
|
1031
|
+
if (name === "bridge_aggregator_scan") {
|
|
1032
|
+
const { scanBridgeRoutes } = await import("../src/data/providers/bridge-aggregator.mjs");
|
|
1033
|
+
return scanBridgeRoutes(args);
|
|
1034
|
+
}
|
|
1035
|
+
// Perps markets: dYdX, Drift, Vertex.
|
|
1036
|
+
if (name === "perps_markets") {
|
|
1037
|
+
const venue = String(args.venue || "all").toLowerCase();
|
|
1038
|
+
const results = {};
|
|
1039
|
+
if (venue === "all" || venue === "dydx") {
|
|
1040
|
+
const { dydxMarkets } = await import("../src/data/providers/dydx.mjs");
|
|
1041
|
+
results.dydx = await dydxMarkets();
|
|
1042
|
+
}
|
|
1043
|
+
if (venue === "all" || venue === "drift") {
|
|
1044
|
+
const { driftMarkets } = await import("../src/data/providers/drift.mjs");
|
|
1045
|
+
results.drift = await driftMarkets();
|
|
1046
|
+
}
|
|
1047
|
+
if (venue === "all" || venue === "vertex") {
|
|
1048
|
+
const { vertexMarkets } = await import("../src/data/providers/vertex.mjs");
|
|
1049
|
+
results.vertex = await vertexMarkets();
|
|
1050
|
+
}
|
|
1051
|
+
return results;
|
|
1052
|
+
}
|
|
1053
|
+
// DEX quotes: PancakeSwap, SushiSwap, Raydium.
|
|
1054
|
+
if (name === "dex_quote") {
|
|
1055
|
+
const dex = String(args.dex || "").toLowerCase();
|
|
1056
|
+
if (dex === "pancakeswap") {
|
|
1057
|
+
const { pancakeQuote } = await import("../src/data/providers/pancakeswap.mjs");
|
|
1058
|
+
return pancakeQuote(args);
|
|
1059
|
+
}
|
|
1060
|
+
if (dex === "sushiswap") {
|
|
1061
|
+
const { sushiQuote } = await import("../src/data/providers/sushiswap.mjs");
|
|
1062
|
+
return sushiQuote(args);
|
|
1063
|
+
}
|
|
1064
|
+
if (dex === "raydium") {
|
|
1065
|
+
const { raydiumQuote } = await import("../src/data/providers/raydium.mjs");
|
|
1066
|
+
return raydiumQuote(args);
|
|
1067
|
+
}
|
|
1068
|
+
return { error: `unknown dex: ${dex} — use pancakeswap, sushiswap, or raydium` };
|
|
1069
|
+
}
|
|
1070
|
+
// Options markets.
|
|
1071
|
+
if (name === "options_markets") {
|
|
1072
|
+
const { aevoMarkets } = await import("../src/data/providers/aevo.mjs");
|
|
1073
|
+
return { aevo: await aevoMarkets() };
|
|
1074
|
+
}
|
|
1075
|
+
// Lending markets.
|
|
1076
|
+
if (name === "lending_markets") {
|
|
1077
|
+
const { compoundMarkets } = await import("../src/data/providers/compound.mjs");
|
|
1078
|
+
return { compound: await compoundMarkets() };
|
|
1079
|
+
}
|
|
1080
|
+
// Yield vaults.
|
|
1081
|
+
if (name === "yield_vaults") {
|
|
1082
|
+
const [{ yearnVaults }, { convexPools }] = await Promise.all([
|
|
1083
|
+
import("../src/data/providers/yearn.mjs"),
|
|
1084
|
+
import("../src/data/providers/convex.mjs"),
|
|
1085
|
+
]);
|
|
1086
|
+
return { yearn: await yearnVaults(), convex: await convexPools() };
|
|
1087
|
+
}
|
|
1088
|
+
// On-chain equities best-ex (HIP-3 / Arcus / RH / Solana / TON). In-process,
|
|
1089
|
+
// fixtures-backed offline, prepare-only. No desk hop required.
|
|
1090
|
+
if (name === "equity_venues") {
|
|
1091
|
+
const { equityVenues, toJsonSafe } = await import("../src/equities/index.mjs");
|
|
1092
|
+
return toJsonSafe(equityVenues());
|
|
1093
|
+
}
|
|
1094
|
+
if (name === "equity_quote") {
|
|
1095
|
+
const { bestEquityRoute, toJsonSafe } = await import("../src/equities/index.mjs");
|
|
1096
|
+
return toJsonSafe(
|
|
1097
|
+
bestEquityRoute({
|
|
1098
|
+
ticker: args.ticker,
|
|
1099
|
+
sizeUsd: args.sizeUsd,
|
|
1100
|
+
horizonHours: args.horizonHours,
|
|
1101
|
+
}),
|
|
1102
|
+
);
|
|
1103
|
+
}
|
|
1104
|
+
if (name === "equity_prepare") {
|
|
1105
|
+
const { prepareEquityRoute, toJsonSafe } = await import("../src/equities/index.mjs");
|
|
1106
|
+
return toJsonSafe(
|
|
1107
|
+
prepareEquityRoute({
|
|
1108
|
+
ticker: args.ticker,
|
|
1109
|
+
recipient: args.recipient || args.taker,
|
|
1110
|
+
sizeUsd: args.sizeUsd,
|
|
1111
|
+
}),
|
|
1112
|
+
);
|
|
1113
|
+
}
|
|
1114
|
+
// Smart-wallet / token scanner surface.
|
|
1115
|
+
//
|
|
1116
|
+
// The scanner engine already covered 11 chains and every capability below, but no
|
|
1117
|
+
// MCP tool exposed it -- so an agent could scan nothing on EVM while the code sat
|
|
1118
|
+
// there working. Same class of gap as a route source with no preparer: the
|
|
1119
|
+
// capability existed, the handle did not.
|
|
1120
|
+
//
|
|
1121
|
+
// In-process for the same reason routing is: no desk server required.
|
|
1122
|
+
// Read-only. scoreRisk and sellSimulation inspect; they never sign.
|
|
1123
|
+
if (name === "scanner_coverage") {
|
|
1124
|
+
const s = await import("../src/scanner/index.mjs");
|
|
1125
|
+
s.registerBuiltinScanners?.();
|
|
1126
|
+
return s.scannerCoverage();
|
|
1127
|
+
}
|
|
1128
|
+
if (name === "scan_token") {
|
|
1129
|
+
const s = await import("../src/scanner/index.mjs");
|
|
1130
|
+
s.registerBuiltinScanners?.();
|
|
1131
|
+
const sc = s.getScanner(Number(args.chainId));
|
|
1132
|
+
if (!sc) throw new Error(`no scanner registered for chainId ${args.chainId}`);
|
|
1133
|
+
const token = await sc.resolveToken(args.token);
|
|
1134
|
+
const pools = sc.supports?.("resolvePools") ? await sc.resolvePools(args.token).catch(() => null) : null;
|
|
1135
|
+
const risk = sc.supports?.("scoreRisk") ? await sc.scoreRisk({ token: args.token }).catch(() => null) : null;
|
|
1136
|
+
return { chainId: Number(args.chainId), token, pools, risk };
|
|
1137
|
+
}
|
|
1138
|
+
if (name === "wallet_balances") {
|
|
1139
|
+
const s = await import("../src/scanner/index.mjs");
|
|
1140
|
+
s.registerBuiltinScanners?.();
|
|
1141
|
+
const sc = s.getScanner(Number(args.chainId));
|
|
1142
|
+
if (!sc) throw new Error(`no scanner registered for chainId ${args.chainId}`);
|
|
1143
|
+
const native = await sc.nativeBalance(args.address);
|
|
1144
|
+
const token = args.token ? await sc.tokenBalance(args.address, args.token).catch(() => null) : null;
|
|
1145
|
+
return { chainId: Number(args.chainId), address: args.address, native, token };
|
|
1146
|
+
}
|
|
1147
|
+
if (name === "address_book_remember") {
|
|
1148
|
+
return rememberAddress({
|
|
1149
|
+
address: args.address, label: args.label, who: args.who,
|
|
1150
|
+
role: args.role, chainIds: args.chainIds, notes: args.notes, source: "oracle-data-mcp",
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
if (name === "address_book_list") return listAddresses({ q: args.q, role: args.role, who: args.who });
|
|
1154
|
+
if (name === "address_book_lookup") return lookupAddress(args.address);
|
|
1155
|
+
if (name === "address_book_forget") return forgetAddress(args.address, args.label || null);
|
|
1156
|
+
if (name === "data_catalog") return httpJson(`${DATA_URL}/data/catalog`);
|
|
1157
|
+
if (name === "data_health") return httpJson(`${DATA_URL}/data/health`);
|
|
1158
|
+
if (name === "data_call") {
|
|
1159
|
+
if (!args.provider || !args.op) throw new Error("provider and op are required");
|
|
1160
|
+
return deskCall(args.provider, args.op, args.args || {});
|
|
1161
|
+
}
|
|
1162
|
+
const route = ROUTES[name];
|
|
1163
|
+
if (route) {
|
|
1164
|
+
const { provider, op, args: mapped } = route(args);
|
|
1165
|
+
return deskCall(provider, op, mapped);
|
|
1166
|
+
}
|
|
1167
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
async function handle(request) {
|
|
1171
|
+
const { id, method, params } = request;
|
|
1172
|
+
if (method === "initialize") {
|
|
1173
|
+
send({
|
|
1174
|
+
jsonrpc: "2.0",
|
|
1175
|
+
id,
|
|
1176
|
+
result: {
|
|
1177
|
+
protocolVersion: params?.protocolVersion || "2024-11-05",
|
|
1178
|
+
capabilities: { tools: {} },
|
|
1179
|
+
serverInfo: { name: "oracle-data-mcp", version: "0.1.0" },
|
|
1180
|
+
},
|
|
1181
|
+
});
|
|
1182
|
+
return;
|
|
1183
|
+
}
|
|
1184
|
+
if (method === "notifications/initialized") return;
|
|
1185
|
+
if (method === "tools/list") {
|
|
1186
|
+
send({ jsonrpc: "2.0", id, result: { tools } });
|
|
1187
|
+
return;
|
|
1188
|
+
}
|
|
1189
|
+
if (method === "tools/call") {
|
|
1190
|
+
try {
|
|
1191
|
+
const result = await callTool(params?.name, params?.arguments || {});
|
|
1192
|
+
if (result?.dataBase64 && /^image\/(?:svg\+xml|png|jpeg|webp)$/.test(String(result.mimeType || ""))) {
|
|
1193
|
+
const { dataBase64, ...metadata } = result;
|
|
1194
|
+
send({
|
|
1195
|
+
jsonrpc: "2.0",
|
|
1196
|
+
id,
|
|
1197
|
+
result: {
|
|
1198
|
+
content: [
|
|
1199
|
+
{ type: "image", data: dataBase64, mimeType: result.mimeType },
|
|
1200
|
+
{ type: "text", text: JSON.stringify(metadata, null, 2) },
|
|
1201
|
+
],
|
|
1202
|
+
},
|
|
1203
|
+
});
|
|
1204
|
+
} else {
|
|
1205
|
+
send({ jsonrpc: "2.0", id, result: { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] } });
|
|
1206
|
+
}
|
|
1207
|
+
} catch (err) {
|
|
1208
|
+
send({ jsonrpc: "2.0", id, result: { isError: true, content: [{ type: "text", text: err.message }] } });
|
|
1209
|
+
}
|
|
1210
|
+
return;
|
|
1211
|
+
}
|
|
1212
|
+
if (id !== undefined) error(id, -32601, `Method not found: ${method}`);
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
let buffer = "";
|
|
1216
|
+
|
|
1217
|
+
function startStdioLoop() {
|
|
1218
|
+
process.stdin.setEncoding("utf8");
|
|
1219
|
+
process.stdin.on("data", (chunk) => {
|
|
1220
|
+
buffer += chunk;
|
|
1221
|
+
let index;
|
|
1222
|
+
while ((index = buffer.indexOf("\n")) >= 0) {
|
|
1223
|
+
const line = buffer.slice(0, index).trim();
|
|
1224
|
+
buffer = buffer.slice(index + 1);
|
|
1225
|
+
if (!line) continue;
|
|
1226
|
+
try {
|
|
1227
|
+
void handle(JSON.parse(line));
|
|
1228
|
+
} catch (err) {
|
|
1229
|
+
error(null, -32700, err.message);
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
// npm bin wrappers are symlinks. Comparing import.meta.url to argv[1] as strings
|
|
1236
|
+
// fails for `npx oracle-data-mcp` / node_modules/.bin/oracle-data-mcp and the
|
|
1237
|
+
// process exits without ever starting the stdio loop (Hermes sees Connection closed).
|
|
1238
|
+
function isMainModule() {
|
|
1239
|
+
const entry = process.argv[1];
|
|
1240
|
+
if (!entry) return false;
|
|
1241
|
+
try {
|
|
1242
|
+
return fs.realpathSync(entry) === fs.realpathSync(fileURLToPath(import.meta.url));
|
|
1243
|
+
} catch {
|
|
1244
|
+
return false;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
if (isMainModule()) {
|
|
1249
|
+
startStdioLoop();
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
export { tools, callTool, handle };
|