Skip to main content
FetchTool provides a simple interface to fetch content from URLs using various HTTP methods.

Constructor

No parameters required. Inherits from BaseTool.

Methods

fetch_url

Fetch content from a URL using HTTP requests.
url
str
required
The URL to fetch
method
str
HTTP method to use: GET, POST, PUT, DELETE, etc. (default: “GET”)
headers
Dict[str, str]
Optional headers to include in the request
body
str
Optional body content for POST/PUT requests
Returns: Response text or error message Timeout: 30 seconds

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.
This tool makes actual HTTP requests. Be careful when using it with untrusted URLs or in production environments with rate limits.

Source reference

src/agentor/tools/fetch.py:8
Last modified on May 5, 2026