FetchTool provides a simple interface to fetch content from URLs using various HTTP methods.
Constructor
No parameters required. Inherits fromBaseTool.
Methods
fetch_url
Fetch content from a URL using HTTP requests.The URL to fetch
HTTP method to use: GET, POST, PUT, DELETE, etc. (default: “GET”)
Optional headers to include in the request
Optional body content for POST/PUT requests
Usage
Basic GET request
GET request with headers
POST request with body
Other HTTP methods
Error handling
The tool returns error messages as strings:Use cases
- Fetching data from REST APIs
- Web scraping simple HTML pages
- Testing API endpoints
- Downloading content from URLs
- Webhook testing
Notes
FetchTool uses
httpx under the hood with a 30-second timeout for all requests.Source reference
src/agentor/tools/fetch.py:8