orxtra v0.13.0 /tool.src.orxtra.tool._http_tool
On this page

The http tool: GET/POST/PUT/DELETE/PATCH/HEAD requests with hostname allow-listing and a timeout ceiling; consult mode restricts it to GET/HEAD only and previews oversized response bodies.

#tool.src.orxtra.tool._http_tool

#tool.src.orxtra.tool._http_tool

HTTP tool constructor for the orxtra tool module.

#_execute_http_request

python
async def _execute_http_request(*, method: str, url: str, headers: dict[str, str] | None, body: str | None, requested_timeout: int | None, allowed_hosts: list[str] | str, timeout_ceiling: int, preview_threshold: int, preview_lines: int) -> ToolOutput[HttpResponse]

Shared HTTP execution logic for both full and consult mode tools.

#make_http_tool

python
def make_http_tool(allowed_hosts: list[str] | str, timeout_ceiling: int=30, preview_threshold: int=50000, preview_lines: int=50, consult_mode: bool=False) -> Tool

Construct the HTTP tool.

Args:

  • allowed_hosts: List of allowed hostnames, or "allow_all" to

permit any host.

  • timeout_ceiling: Maximum timeout in seconds. Agent-requested

timeouts are capped at this value.

  • preview_threshold: Byte threshold above which response body is

previewed.

  • preview_lines: Number of head/tail lines in a preview.
  • consult_mode: When True, restrict methods to GET and HEAD only.

Returns:

  • A Tool instance for HTTP requests.
Search