Web Toolset#
Generated byAIThis toolset provides tools for interacting with web resources via HTTP requests.
http_get_text_tool#
Makes an HTTP GET request to a given URL that returns text content, and returns the content type and content.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
url |
String | Yes | The URL to GET text from. |
user_agent |
String | No | Optional user agent header; default is Firefox for macOS. |
preserve_html |
Boolean | No | Optional flag to preserve all the HTML content; default is false. |
accept |
String | No | Optionally specify an acceptable content type (e.g. text/markdown) to ask the server for specific format. Default is none. |
Success Case Examples#
Input:
{
"url": "https://example.com",
"user_agent": "MyCustomAgent/1.0",
"preserve_html": false,
"accept": "text/html"
}Output:
{
"content_type": "text/html",
"body": "<html>...reduced HTML content...</html>"
}Error Case Examples#
-
Missing URL:
{ "error": "The required URL was not specified" } -
Non-text Content:
{ "error": "HTTP request did not return text content; it's content type was: image/png" } -
HTTP Request Failed:
{ "error": "HTTP request failed with status: 404" } -
Content Too Large:
{ "error": "Received content > 256000. Response is too big." } -
Network Error:
{ "error": "An error occurred while making the HTTP request: Connection refused" }
Notes#
- The tool strips line indents and coalesces line breaks for HTML, JSON, and XML content.
- Unless
preserve_htmlis set to true, it removes thehead,script, andstyleelements as well as allclassattributes from HTML content. - The maximum allowed content size is 256KB. Larger responses will result in an error.