Skip to content

feat: add URL fetching so Claude can read shared links#2

Open
pdsullivan wants to merge 1 commit into
mainfrom
pdsullivan/pricing-and-links
Open

feat: add URL fetching so Claude can read shared links#2
pdsullivan wants to merge 1 commit into
mainfrom
pdsullivan/pricing-and-links

Conversation

@pdsullivan

Copy link
Copy Markdown
Contributor

Summary

  • Adds a fetch_url tool that lets Claude fetch and read webpage content when users share links in chat
  • Uses jsdom + @mozilla/readability (Firefox Reader Mode) to parse HTML and extract clean article text
  • Adds a tool-use loop to chat() so tools that need results can send content back to Claude for a follow-up response
  • Updates the system prompt to tell Claude about the capability and its limitations (JS-heavy pages like X/Twitter may not work)

Test plan

  • Send a link to an article/blog post and verify Claude reads and summarizes it
  • Send a link to a JS-heavy page (e.g. X/Twitter post) and verify Claude gracefully tells the user it couldn't read it
  • Send a non-HTML URL (e.g. a PDF or image link) and verify Claude handles it cleanly
  • Verify existing functionality (reactions, effects, image gen, web search) still works after the tool-use loop change
  • Test that the 10s timeout works for slow pages

🤖 Generated with Claude Code

Adds a fetch_url tool that lets Claude fetch and read webpage content
when users share links. Uses jsdom + @mozilla/readability (Firefox's
Reader Mode algorithm) to extract clean article text from HTML.

Also adds a tool-use loop to the chat() function so tools that need
results (like fetch_url) can send content back to Claude for analysis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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