Adding function to fetch website#16
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new Exa-backed web_fetch tool (alongside the existing web_search) to allow fetching bounded Markdown content for a single approved HTTP/HTTPS URL, while refactoring Exa MCP client code into a shared provider module.
Changes:
- Introduces
WebFetchTool(web_fetch) with URL validation + explicit approval gating, and registers it by default when network tools are enabled. - Refactors Exa MCP client logic into a shared
_ExaMcpClient, addingExaFetchClientalongsideExaSearchClient. - Updates tests, registry behavior assertions, and documentation to cover both web tools and the network opt-out behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_web_search.py | Adds coverage for ExaFetchClient and WebFetchTool, and updates imports for the new module layout. |
| tests/test_tools.py | Verifies web_fetch is included in tool definitions and toggled by enable_network. |
| tests/test_agent.py | Verifies agents expose/disable both web tools via the network toggle. |
| README.md | Documents “Web access” (search + fetch) and the shared opt-out env var. |
| plain_agent/tools/web/search.py | Updates search tool to use the new shared Exa provider module. |
| plain_agent/tools/web/providers/exa.py | Refactors Exa MCP request/response handling and adds ExaFetchClient. |
| plain_agent/tools/web/providers/init.py | Exposes provider clients/errors for web tools. |
| plain_agent/tools/web/fetch.py | Implements the new model-facing web_fetch tool, including URL validation and approval gating. |
| plain_agent/tools/web/init.py | Exports the approved web tools (WebSearchTool, WebFetchTool). |
| plain_agent/tools/web_search/init.py | Removes the old web_search package export surface after the module move. |
| plain_agent/tools/registry.py | Registers both web_search and web_fetch when network tools are enabled. |
| .env.example | Updates the network-tools comment to mention both search and fetch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.