Skip to content

Feature: Add web_fetch server tool for Anthropic#514

Merged
mikehostetler merged 3 commits intoagentjido:mainfrom
Tonyhaenn:feature/server-tool-passthrough
Mar 22, 2026
Merged

Feature: Add web_fetch server tool for Anthropic#514
mikehostetler merged 3 commits intoagentjido:mainfrom
Tonyhaenn:feature/server-tool-passthrough

Conversation

@Tonyhaenn
Copy link
Copy Markdown
Contributor

@Tonyhaenn Tonyhaenn commented Mar 17, 2026

Description

Add web_fetch: option for the Anthropic provider, enabling Claude's server-side web_fetch_20260209 tool with dynamic filtering. Follows the same pattern as the existing web_search: option.

ReqLLM.generate_text("anthropic:claude-sonnet-4-6", "Fetch https://example.com and summarize it.",
  provider_options: [
    web_fetch: %{max_uses: 3, allowed_domains: ["example.com"]}
  ]
)

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Changes

  • Added web_fetch: provider option to maybe_add_tools and build_web_fetch_tool in the Anthropic provider
  • Renamed maybe_put_web_search/3 and get_web_search_option/2 to maybe_put_server_tool_opt/3 and get_server_tool_opt/2 since they're now shared between web_search and web_fetch
  • Added web_fetch to the provider options schema with documentation
  • Added provider tests (encode_body with mocked requests)
  • Added coverage test with cached fixture

Breaking Changes

N/A

Testing

  • Tests pass (mix test)
  • Quality checks pass (mix quality)

Checklist

  • My code follows the project's style guidelines
  • I have updated the documentation accordingly
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass
  • My commits follow conventional commit format
  • I have NOT edited CHANGELOG.md (it is auto-generated by git_ops)

Related Issues

Closes #

Tonyhaenn and others added 2 commits March 16, 2026 21:00
Add `web_fetch:` option for Anthropic provider, following the same pattern
as the existing `web_search:` option. This enables Claude's server-side
web_fetch_20260209 tool with dynamic filtering.

Usage:
  ReqLLM.generate_text(model, messages,
    web_fetch: %{max_uses: 3, allowed_domains: ["example.com"]}
  )

Supported options: max_uses, allowed_domains, blocked_domains,
max_content_tokens, citations.

Can be combined with regular tools and web_search.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a coverage test that verifies web_fetch tool integration through
the high-level ReqLLM.generate_text API, with a cached fixture recorded
against claude-sonnet-4-5.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mikehostetler mikehostetler merged commit b2ae79b into agentjido:main Mar 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants