Skip to content

feat(agents): allow WebSearch/WebFetch fallback for research agents#202

Open
darwin7381 wants to merge 1 commit into
anthropics:mainfrom
darwin7381:fix/agent-web-tools
Open

feat(agents): allow WebSearch/WebFetch fallback for research agents#202
darwin7381 wants to merge 1 commit into
anthropics:mainfrom
darwin7381:fix/agent-web-tools

Conversation

@darwin7381
Copy link
Copy Markdown

Summary

  • Adds WebSearch and WebFetch to the `tools` allowlist of 6 research/coverage agents (`market-researcher`, `earnings-reviewer`, `pitch-agent`, `model-builder`, `meeting-prep-agent`, `valuation-reviewer`).
  • These agents currently declare MCP-only tool allowlists (e.g. `mcp__capiq__`, `mcp__factset__`, `mcp__daloopa__*`). For deployments without those third-party subscriptions, the agent has no way to source live data and either fails or silently degrades to inline execution by the main session rather than the named subagent.
  • Intentionally NOT changed for ops agents that work on internal data (`kyc-screener`, `gl-reconciler`, `month-end-closer`, `statement-auditor`) where web search would be inappropriate or a compliance concern.

Problem reproduction

Fresh Claude Code install, no third-party MCP subscriptions configured. Invoke market-researcher via slash command:

```

Use the market-researcher agent for a sector primer on stablecoin issuers Q2 2026

market-researcher subagent loaded — but provisioned without
WebSearch/WebFetch, which made it unable to source live citations
and therefore unable to run competitive-analysis/comps-analysis
skills end-to-end. It correctly refused to fabricate URLs (no
fabrication red line). Workaround: produced the primer from the
main session with web tools.
```

The subagent did the right thing (refused to fabricate), but the named-subagent invocation path doesn't actually work without subscriptions — the user has to bail out to the main session, defeating the point of a packaged research agent.

After fix

Re-ran the same invocation in a fresh session:

  • ✅ Subagent loaded with WebSearch (agent ID a3a339b7bb9cf74eb)
  • ✅ 13 tool uses (WebSearch + Write), no fallback to main session
  • ✅ Produced a 76-line institutional-quality primer (`AI infrastructure hyperscaler capex 2026 H2 outlook`) with cited Q1 2026 prints, hyperscaler capex stack, order-book signals, and 2 investable ideas
  • ✅ Skill output flagged unsourced figures (`[UNSOURCED to primary filing]`) — guardrails intact

Design rationale

  • No regression for subscribed users: skills explicitly route to MCP first (`Use FactSet/Daloopa MCP for X`); WebSearch becomes the fallback when MCP is absent, not the primary source.
  • No-fabrication guardrails preserved: every skill in this PR continues to instruct "cite every number" / "`[UNSOURCED]` rather than estimate".
  • Scoped to research agents only: the ops agents (`kyc-screener`, `gl-reconciler`, etc.) deal with internal client data where web access is a compliance risk — those are deliberately left unchanged.

Changes

6 files, +6/-6 lines (just the `tools:` line in each agent's frontmatter):

Agent Before After
market-researcher `Read, Write, Edit, mcp__capiq__, mcp__factset__` `..., WebSearch, WebFetch`
earnings-reviewer `Read, Write, Edit, mcp__factset__, mcp__daloopa__` `..., WebSearch, WebFetch`
pitch-agent `Read, Write, Edit, mcp__capiq__*` `..., WebSearch, WebFetch`
model-builder `Read, Write, Edit, mcp__capiq__, mcp__daloopa__` `..., WebSearch, WebFetch`
meeting-prep-agent `Read, Write, mcp__crm__, mcp__capiq__` `..., WebSearch, WebFetch`
valuation-reviewer `Read, Grep, Glob, mcp__portfolio__*` `..., WebSearch, WebFetch`

Test plan

  • Verified market-researcher invocation as a true subagent (not main-session fallback) after the patch
  • Confirmed skills still cite sources and refuse to fabricate
  • Confirmed CMA cookbook `agent.yaml` files are unaffected (they declare `tools` via `agent_toolset_20260401` rather than the markdown frontmatter)

🤖 Generated with Claude Code

Six research/coverage agents declare their `tools` allowlist as MCP-only:

  market-researcher:    tools: Read, Write, Edit, mcp__capiq__*, mcp__factset__*
  earnings-reviewer:    tools: Read, Write, Edit, mcp__factset__*, mcp__daloopa__*
  pitch-agent:          tools: Read, Write, Edit, mcp__capiq__*
  model-builder:        tools: Read, Write, Edit, mcp__capiq__*, mcp__daloopa__*
  meeting-prep-agent:   tools: Read, Write, mcp__crm__*, mcp__capiq__*
  valuation-reviewer:   tools: Read, Grep, Glob, mcp__portfolio__*

For environments without the assumed third-party MCP subscriptions
(CapIQ / FactSet / Daloopa / CRM), the agent has no way to source live
data and fails or degrades to inline execution by the main session
rather than the named subagent. Reproduced today against a fresh
Claude Code install with no subscriptions:

  market-researcher subagent loaded — but provisioned without
  WebSearch/WebFetch, which made it unable to source live citations
  and therefore unable to run competitive-analysis/comps-analysis
  skills end-to-end. It correctly refused to fabricate URLs (no
  fabrication red line). Workaround: produced the primer from the
  main session with web tools.

Adding WebSearch and WebFetch to the six research-oriented agents:
- Restores the agent's ability to source primary public data
  (filings, press releases, news, regulatory documents) without
  proprietary subscriptions
- Preserves the no-fabrication guardrails — the agents still refuse
  to invent figures; they cite what they fetch
- Does not change behavior for subscribed users — MCP tools remain
  preferred where available (skills explicitly route to MCP first)

Intentionally NOT modified — ops agents that work on internal data
where web search would be inappropriate or a compliance risk:
- kyc-screener (works on internal onboarding docs + screening MCP)
- gl-reconciler (internal general ledger + subledger)
- month-end-closer (internal general ledger)
- statement-auditor (internal NAV pack)

After fix, the market-researcher subagent loads with WebSearch and
runs research end-to-end as a true subagent (verified with a fresh
session — agent ID issued, 13 tool uses including WebSearch + Write,
produced a 76-line cited primer).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant