claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Update `Fetch` tool docstring to indicate that it cannot open `localhost` URLs

Open tcdent opened this issue 3 months ago • 2 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude often defaults to its internal Fetch tool when loading URLs, but when the URLs are served on localhost, it fails every time. Update the documentation that is passed to the agent's context to notify it that it cannot load URLs from localhost and should instead use an alternate bash command like curl.

What Should Happen?

Claude should know to not attempt to load local URLs using the fetch tool.

Error Messages/Logs


Steps to Reproduce

Ask Claude to load a URL served on localhost.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

1.0.115 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

tcdent avatar Sep 16 '25 21:09 tcdent

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 05 '25 10:12 github-actions[bot]

FWIW, I have the same issue on macOS when using Dash MCP. In a nutshell, the MCP returns URLs to 127.0.0.1 that Claude should read. I had to instruct Claude to use curl instead of Fetch, which is less than convenient.

> /doctor

 Diagnostics
 └ Currently running: package-manager (2.0.58)
 └ Package manager: homebrew
 └ Path: /opt/homebrew/bin/claude
 └ Invoked: /opt/homebrew/Caskroom/claude-code/2.0.58/claude
 └ Config install method: local
 └ Auto-updates: Managed by package manager
 └ Search: OK (bundled)

╭─── Claude Code v2.0.58 ──────────────────────────────────────────────────────╮
│                                    │ Tips for getting started                │
│            Welcome back!           │ Run /init to create a CLAUDE.md file w… │
│                                    │ ─────────────────────────────────────── │
│               ▐▛███▜▌              │ Recent activity                         │
│              ▝▜█████▛▘             │ No recent activity                      │
│                ▘▘ ▝▝               │                                         │
│                                    │                                         │
│   Sonnet 4.5 · API Usage Billing   │                                         │
│   ~/projects/cfamily/claude-chat   │                                         │
╰──────────────────────────────────────────────────────────────────────────────╯

  /model to try Opus 4.5

> /clear 
  ⎿  (no content)

> Using Dash, give me a bullet-point summary of C++ std::string methods 
introduced in C++23 

⏺ I'll use Dash to find information about C++ std::string methods introduced
   in C++23.
  ⎿  {                              
       "docsets": [
         {
     … +297 lines (ctrl+o to expand)

⏺ dash-api - search_documentation (MCP)(query: "std::string C++23",
                                       docset_identifiers: "nrmujfpv,ycltfwoo",
                                       search_snippets: true, max_results: 50)
  ⎿ {                                                                      
      "results": [],
      "error": "Search failed: 'name'. Please ensure Dash is running and th
    … +2 lines (ctrl+o to expand)


⏺ dash-api - search_documentation (MCP)(query: "string contains",
                                       docset_identifiers: "nrmujfpv",
                                       search_snippets: true, max_results: 50)
  ⎿  {                              
       "results": [
         {
     … +118 lines (ctrl+o to expand)

⏺ Fetch(http://127.0.0.1:53462/Dash/nmtxiabl/en.cppreference.com/w/cpp/string/ba
       sic_string/contains.html)
  ⎿  Error: canceled

⏺ Fetch(http://127.0.0.1:53462/Dash/nmtxiabl/en.cppreference.com/w/cpp/23.html)
  ⎿  Error: canceled

(I've cancelled the query after 6 minutes in this case.)

The results are objects like this one:

{
  "name": "contains",
  "type": "Method",
  "platform": "cpp",
  "load_url": "http://127.0.0.1:53462/Dash/nmtxiabl/en.cppreference.com/w/cpp/string/basic_string_view/contains.html",
  "docset": "C++",
  "description": "std::basic_string_view<CharT, Traits>",
  "language": null,
  "tags": null
}