Web Toolset Documentation
Generated byAIThis toolset provides tools for making HTTP GET requests to retrieve web content.
Tool settings: host policies New in 0.9.14 Updated in 0.9.15
Both tools support host policies that control which servers they may be used to access. Configure them per tool under tool_settings::
allowed_hosts:an array of host names that are always allowed without asking; when empty (default) no host is always allowed, so you will be asked before each access.denied_hosts:an array of host names to always refuse to connect to; when empty (default) no host is always denied.allow_private_hosts:set totrueto allow access to private/local hosts; the default isfalse.
Behavior change As of 0.9.15 an unset allowed_hosts no longer means all hosts are allowed. A host that is neither allowed nor denied now triggers an interactive permission prompt (see below). With the approval prompts, the old allow-all-by-default (unsafe) fallback is gone — nothing is reachable without either a list entry or your explicit approval.
tool_settings:
http_get_web_page_as_markdown:
# always refused, no prompt
denied_hosts: ["google.com"]
http_get_web_page:
# allowed without being asked
allowed_hosts: ["google.com"]
# any other host is neither allowed nor denied, so you'll be asked
# each time before the request goes outPermission prompts for unknown hosts New in 0.9.15
When a web tool fetches a host that appears in neither its allowed_hosts nor its denied_hosts list, Enkaidu asks for permission at each occurrence. In the terminal UI you get a four-letter choice:
a— allow this one requestd— deny this one requestA— allow alwaysD— deny always
Choosing allow-always or deny-always persists the host into that tool’s own allowed_hosts / denied_hosts list. Each tool keeps separate lists, so always-allowing a host for http_get_web_page_as_markdown has no effect on http_get_web_page (and vice versa). See Web UI security confirmations for the equivalent prompts in the web UI.
http_get_web_page
Makes an HTTP GET request to a given URL that returns text and returns the content type and content. It strips line indents and coalesces line breaks for HTML, JSON, and XML. Unless asked not to, it removes the head, script, and style elements as well as all class attributes from HTML content. Content size of response must be less than 32K.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url |
String | Yes | The URL to GET the web page from. |
user_agent |
String | No | Optional user agent header; default is Firefox for macOS. |
accept |
String | No | Optionally specify an acceptable content type (e.g., text/markdown) to ask the server for a specific format. Default is none. |
preserve_source |
Boolean | No | Optional flag to ask to preserve the content from the server without any attempts to condense the text; default is false. |
Notes
- Strips line indents and coalesces line breaks for HTML, JSON, and XML.
- Removes
head,script, andstyleelements from HTML content unlesspreserve_sourceis set to true. - Content size must be less than 32K.
- Follows redirects (301, 307, 308) up to a maximum of three times New in 0.9.16.
http_get_web_page_as_markdown
Makes an HTTP GET request to a given web site URL that returns the content as markdown, either because the website returns markdown directly, or by parsing the incoming HTML and converting it to markdown. If the text content from the web site is neither HTML nor markdown, the tool returns a markdown document with the web page content within a code block.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url |
String | Yes | The URL to GET the web page from. |
user_agent |
String | No | Optional user agent header; default is Firefox for macOS. |
save_as_file |
String | No | Optionally save the entire converted web page as Markdown to the given file path (must resolve within the session’s working directory; parent directories are created as needed). The response then carries saved_as_file with the path instead of inline markdown. |
overwrite |
Boolean | No | Only relevant with save_as_file; set to true to overwrite an existing file (default false, in which case an existing target file is an error). |
Notes
- Returns content as markdown when the website supports it.
- Converts HTML to markdown by properly parsing the HTML.
- When the resulting content is too big (>32K), the markdown is truncated; the tool returns the URL plus a
truncated: true | falseproperty alongside the (possibly truncated) markdown New in 0.9.14. - With
save_as_file, the full page is written to the file — the >32K truncation does not apply to the saved file. This is the intended remedy for pages that would otherwise be truncated; the tool returnssaved_as_filepointing at the written file New in 0.9.16. - Content that is neither HTML nor markdown is wrapped in a code block with appropriate content type tagging where possible.
- Follows redirects (301, 307, 308) up to a maximum of three times New in 0.9.16.