@finchagentic/mcp 4.0.0 → 4.2.0

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/dist/server.js CHANGED
@@ -61,7 +61,13 @@ const market_js_1 = require("./tools/market.js");
61
61
  const defi_js_1 = require("./tools/defi.js");
62
62
  const automation_js_1 = require("./tools/automation.js");
63
63
  const insight_js_1 = require("./tools/insight.js");
64
- const framework_js_1 = require("./tools/framework.js");
64
+ // tools/framework.ts removed - list_playbooks, run_playbook and
65
+ // get_finch_ledger called /framework/playbooks, /framework/playbook/run and
66
+ // /swarm/ledger, none of which are registered in app/convex/http.ts (only
67
+ // dangling section-header comments) and none of which have a backing data
68
+ // model (no playbook table, no Sentinel ledger table in schema.ts). All 3
69
+ // tools always 404'd. Re-add only alongside building the Noel Framework
70
+ // playbook/Sentinel backend for real.
65
71
  const wallet_js_1 = require("./tools/wallet.js");
66
72
  const vault_js_1 = require("./tools/vault.js");
67
73
  const miroshark_js_1 = require("./tools/miroshark.js");
@@ -86,6 +92,7 @@ const monitor_js_1 = require("./tools/monitor.js");
86
92
  const github_js_1 = require("./tools/github.js");
87
93
  const chronicle_js_1 = require("./tools/chronicle.js");
88
94
  const packets_js_1 = require("./tools/packets.js");
95
+ const stake_js_1 = require("./tools/stake.js");
89
96
  const token_gate_js_1 = require("./token-gate.js");
90
97
  const PRIVATE_KEY_RESPONSE = {
91
98
  content: [{
@@ -107,38 +114,44 @@ exports.ALL_TOOLS = [
107
114
  ...automation_js_1.AUTOMATION_TOOLS, // 6 - create, list, pause, delete, get_runs, run
108
115
  // SWARM_TOOLS removed v3.19 - multi-agent research is now built into
109
116
  // deep_research (depth=standard|deep). Handler fully removed v3.21.
110
- ...framework_js_1.FRAMEWORK_TOOLS, // 3 - list_playbooks, run_playbook, get_finch_ledger
111
- ...vault_js_1.VAULT_TOOLS, // 14 - save, read, list, search, history, diff, export, pin, tag, delete, link, related, store_credential, get_credential
117
+ // FRAMEWORK_TOOLS removed - list_playbooks/run_playbook/get_finch_ledger backend routes never existed, see tools/ import comment above.
118
+ ...vault_js_1.VAULT_TOOLS, // 15 - save, read, list, search, history, diff, export, pin, unpublish, tag, delete, link, related, store_credential, get_credential
112
119
  ...wallet_js_1.WALLET_TOOLS, // 3 - get_wallet_address, get_wallet_balance, wallet_sign_message
113
120
  ...miroshark_js_1.MIROSHARK_TOOLS, // 3 - simulate, status, stop
114
- ...agents_js_1.AGENT_TOOLS, // 12 - list_agents, hire_agent, agent_spawn, agent_recall, agent_update, agent_identity, agent_ledger + agent_schedule, agent_unschedule, agent_pause, agent_resume, agent_runs (v3.18 autonomous)
121
+ ...agents_js_1.AGENT_TOOLS, // 4 - agent_spawn, agent_recall, agent_update, agent_ledger (vault-backed, all working). list_agents/hire_agent and the autonomous-schedule tools (agent_identity/agent_schedule/agent_unschedule/agent_pause/agent_resume/agent_runs) removed - their backend routes were never implemented, see tools/agents.ts
115
122
  ...scanner_js_1.SCANNER_TOOLS, // 3 - score_token, check_token, scan_market (dips+momentum merged)
116
123
  ...equity_js_1.EQUITY_TOOLS, // 1 - stock_fundamentals (SEC EDGAR XBRL; no key)
117
124
  ...insider_js_1.INSIDER_TOOLS, // 1 - stock_insider (SEC Form 4; separates discretionary from automatic)
118
125
  ...events_js_1.EVENT_TOOLS, // 1 - stock_events (SEC 8-K item codes decoded)
119
126
  ...coder_js_1.CODER_TOOLS, // 1 - audit_contract (static Solidity scan; the client model does the reasoning)
120
- ...base_js_1.BASE_TOOLS, // 4 - query_vaults, list_markets, prepare_deposit, chain_stats
127
+ ...base_js_1.BASE_TOOLS, // 4 - base_mcp_yield_vaults, base_mcp_lending_rates, base_mcp_deposit_guide, base_mcp_network
121
128
  ...base_mcp_js_1.BASE_MCP_TOOLS, // 7 - base_mcp_{status,balance,send,swap,estimate,lend,resolve} (analyze removed v3.17.5 - dead backend route)
122
129
  ...rh_mcp_js_1.RH_MCP_TOOLS, // 8 - rh_mcp_{status,list_stocks,balance,estimate,swap} + rh_token_resolve, rh_analyze, rh_safety_check (RH Chain 4663 Uni V4: stocks + arbitrary crypto via DexScreener/Blockscout)
123
130
  ...rh_orders_js_1.RH_ORDER_TOOLS, // 5 - rh_dca_create, rh_bracket_create, rh_orders_list, rh_order_cancel, rh_orders_tick (RH automated DCA/TP/SL)
124
131
  ...rh_bridge_js_1.BRIDGE_TOOLS, // 1 - rh_stock_bridge (tokenized stock vs real equity)
125
- ...memory_js_1.MEMORY_TOOLS, // 10 - memory_add, memory_search, memory_context, memory_profile, memory_list, memory_delete, memory_insight, memory_extract, memory_consolidate, memory_publish
132
+ ...memory_js_1.MEMORY_TOOLS, // 9 - memory_add, memory_search, memory_context, memory_profile, memory_list, memory_delete, memory_insight, memory_extract, memory_consolidate. memory_publish removed - promised a "Memory Marketplace" that doesn't exist at any layer (no browse route, no query, no UI), see tools/memory.ts
126
133
  ...os_js_1.OS_TOOLS, // 3 - finch_status, finch_diagnostics, finch_shell_chat
127
134
  ...research_js_1.RESEARCH_TOOLS, // 2 - web_scrape, web_search
128
135
  ...deep_research_js_1.DEEP_RESEARCH_TOOLS, // 1 - deep_research (search → scrape → rank → cited evidence pack; caller synthesises)
129
136
  ...research_compare_js_1.RESEARCH_COMPARE_TOOLS, // 1 - research_compare (diff two reports across time)
130
137
  ...research_chain_js_1.RESEARCH_CHAIN_TOOLS, // 1 - research_chain (walk continueFrom evolution timeline)
131
- ...monitor_js_1.MONITOR_TOOLS, // 4 - schedule_research, create_monitor (alias), list_monitors, cancel_monitor
138
+ ...monitor_js_1.MONITOR_TOOLS, // 3 - schedule_research, list_monitors, cancel_monitor
132
139
  ...github_js_1.GITHUB_TOOLS, // 8 - list_repos, list_prs, get_pr, list_issues, get_issue, get_file, get_commits, search_code
133
140
  ...chronicle_js_1.CHRONICLE_TOOLS, // 4 - chronicle_add, chronicle_list, chronicle_search, chronicle_stats
134
141
  ...packets_js_1.PACKET_TOOLS, // 4 - packet_create, packet_run, packet_list, packet_share
135
- // total: 120 (refactor: −6 tools whose work the client model already does; v3.41.0: rh_mcp_balance now lists ALL held tokens via Blockscout (was blind to non-catalog crypto); v3.40.0: RH RPC relay fallback via Convex — works on networks that block robinhood.com; v3.39.1: fix — sell approval target now follows the route (Permit2 for V4, SwapRouter02 for V2/V3); v3.39.0: +Uniswap V2 routing — full V2/V3/V4 best-fill router; v3.38.0: Uniswap V3 routing + launchpad detection folded into rh_safety_check; v3.37.1: RH audit fixes — preview read-only, tx-hash extract, pending nonce, atomic store, crash isolation; v3.37.0: +rh_safety_check; v3.36.0: +RH DCA/TP/SL)
142
+ ...stake_js_1.STAKE_TOOLS, // 4 - stake_finch_status, stake_finch, unstake_finch, stake_auto_restake (custodial wallet; requires `finch login`)
143
+ // total: 113 tools as measured by ALL_TOOLS.length - do not hand-maintain a
144
+ // count in this comment (drifted stale multiple times already: before
145
+ // staking was added, after the P1 audit removed 9 dead framework/agent-
146
+ // schedule tools, after memory_publish was removed for promising a
147
+ // marketplace that doesn't exist, and after stake_auto_restake was added;
148
+ // ALL_TOOLS.length is the only number that can't lie). Per-category counts
149
+ // above are best-effort documentation, not load-bearing anywhere.
136
150
  ];
137
151
  exports.HANDLER_MAP = new Map([
138
152
  ...market_js_1.MARKET_TOOLS.map(t => [t.name, market_js_1.handleMarketTool]),
139
153
  ...defi_js_1.DEFI_TOOLS.map(t => [t.name, defi_js_1.handleDefiTool]),
140
154
  ...automation_js_1.AUTOMATION_TOOLS.map(t => [t.name, automation_js_1.handleAutomationTool]),
141
- ...framework_js_1.FRAMEWORK_TOOLS.map(t => [t.name, framework_js_1.handleFrameworkTool]),
142
155
  ...vault_js_1.VAULT_TOOLS.map(t => [t.name, vault_js_1.handleVaultTool]),
143
156
  ...wallet_js_1.WALLET_TOOLS.map(t => [t.name, wallet_js_1.handleWalletTool]),
144
157
  ...insight_js_1.INSIGHT_TOOLS.map(t => [t.name, insight_js_1.handleInsightTool]),
@@ -164,6 +177,7 @@ exports.HANDLER_MAP = new Map([
164
177
  ...github_js_1.GITHUB_TOOLS.map(t => [t.name, github_js_1.handleGithubTool]),
165
178
  ...chronicle_js_1.CHRONICLE_TOOLS.map(t => [t.name, (n, a) => (0, chronicle_js_1.handleChronicle)(n, a)]),
166
179
  ...packets_js_1.PACKET_TOOLS.map(t => [t.name, (n, a) => (0, packets_js_1.handlePacket)(n, a)]),
180
+ ...stake_js_1.STAKE_TOOLS.map(t => [t.name, stake_js_1.handleStakeTool]),
167
181
  ]);
168
182
  // `instructions` is returned in the initialize result - it tells the client
169
183
  // (and, through it, the model) what this server is and how to reach for it.
@@ -175,10 +189,10 @@ const SERVER_INSTRUCTIONS = [
175
189
  "research, DeFi on Base (base_mcp_*), and Robinhood Chain trading (rh_*).",
176
190
  "",
177
191
  "Tool annotations are set: read-only tools are safe to run without asking;",
178
- "tools with destructiveHint (deletes, cancels, memory_publish, and anything",
179
- "that moves funds - base_mcp_swap/send/lend, rh_mcp_swap, rh_dca_create,",
180
- "rh_bracket_create, run_playbook/automation, packet_run) should be confirmed",
181
- "with the user before running.",
192
+ "tools with destructiveHint (deletes, cancels, packet_share, and anything",
193
+ "that moves funds - base_mcp_swap/send, rh_mcp_swap, rh_dca_create,",
194
+ "rh_bracket_create, run_automation, packet_run, stake_finch,",
195
+ "unstake_finch) should be confirmed with the user before running.",
182
196
  "",
183
197
  "Vault entries are also exposed as resources (finch://vault/<key>); prefer",
184
198
  "reading those over a vault_read tool call when you only need the content.",
@@ -57,9 +57,9 @@ exports.PREMIUM_TOOLS = new Set([
57
57
  // Automations
58
58
  "create_automation", "run_automation", "pause_automation", "delete_automation", "get_automation_runs",
59
59
  // Autonomous monitors
60
- "schedule_research", "create_monitor",
60
+ "schedule_research",
61
61
  // Persistent agents
62
- "hire_agent", "agent_spawn", "agent_recall", "agent_update",
62
+ "agent_spawn", "agent_recall", "agent_update",
63
63
  ]);
64
64
  function tokenGateError(toolName) {
65
65
  return {
@@ -17,11 +17,20 @@ exports.filterTools = filterTools;
17
17
  // FINCH_TOOLS=all every registered tool
18
18
  //
19
19
  // Unknown presets fall back to all to avoid silently hiding tools.
20
+ // Each preset's regex is checked against every tool name in ALL_TOOLS by
21
+ // tools-registration.test.ts (see "every tool matches at least one preset")
22
+ // - a tool that matches no preset's regex is invisible under every FINCH_TOOLS
23
+ // setting except "all", which happened silently to 33/121 tools before that
24
+ // test existed (rh_* order-management tools, all *_automation tools, packets,
25
+ // playbooks, wallet balance/sign, miroshark, stock_* - a user on
26
+ // FINCH_TOOLS=defi couldn't even see rh_order_cancel for an order placed
27
+ // through that same preset). New tools MUST match a preset or the test fails
28
+ // the build, instead of quietly vanishing like these did.
20
29
  const PRESETS = {
21
- core: /^(memory_|vault_|agent_|list_agents|hire_agent|ask_finch|finch_status|get_wallet_address|chronicle_)/,
22
- defi: /^(get_market_data|get_token_data|compare_tokens|market_overview|token_history|market_thesis|trade_plan|base_mcp_|rh_mcp_|base_|get_defi_yields|score_token|check_token|scan_market|analyze_wallet)/,
23
- research: /^(memory_|vault_|deep_research|research_compare|research_chain|web_search|web_scrape|schedule_research|create_monitor|list_monitors|cancel_monitor|ask_finch)/,
24
- memory: /^(memory_|vault_|agent_|list_agents|hire_agent|chronicle_)/,
30
+ core: /^(memory_|vault_|agent_|ask_finch|finch_status|finch_diagnostics|finch_shell_chat|get_wallet_address|get_wallet_balance|wallet_sign_message|chronicle_|packet_)/,
31
+ defi: /^(get_market_data|get_token_data|compare_tokens|market_overview|token_history|get_base_token_data|stock_fundamentals|stock_insider|stock_events|market_thesis|trade_plan|base_mcp_|rh_|base_|get_defi_yields|score_token|check_token|scan_market|get_wallet_balance|wallet_sign_message|create_automation|list_automations|pause_automation|delete_automation|get_automation_runs|run_automation|miroshark_|stake_|unstake_finch)/,
32
+ research: /^(memory_|vault_|deep_research|research_compare|research_chain|web_search|web_scrape|schedule_research|list_monitors|cancel_monitor|ask_finch|stock_fundamentals|stock_insider|stock_events)/,
33
+ memory: /^(memory_|vault_|agent_|chronicle_)/,
25
34
  coder: /^(audit_contract|github_)/,
26
35
  };
27
36
  function filterTools(allTools) {