# HTTP GET

The **HTTP GET** tool gives AI agents direct access to raw HTTP `GET` and `HEAD` responses — including exact status codes, normalized response headers, raw HTML source, linked JavaScript or CSS bundles, and unparsed REST/JSON API endpoints.

Tool Identifier: `http-get` (exposes function `http_get`)

> Looking to summarize articles or read clean rendered web page text without HTML markup? See **[HTTP Text](fetch.md)** (`http-text`).

## Capabilities

While **[HTTP Text](fetch.md)** focuses on human-readable prose extraction, **HTTP GET** lets agents inspect web applications and APIs at the HTTP and source-code layer:

- **Raw HTML & Asset Inspection**: Retrieve unstripped HTML `<script src="...">`, `<link>`, and DOM markup, then follow up on linked JavaScript bundles or stylesheets.
- **Large Bundle Search & Pagination**: Locate API routes or tokens inside large minified JavaScript files using built-in `search` (substring or bounded regular expression matching with `context_chars`) and paginate with `offset` and `max_length`.
- **Direct REST API & Header Inspection**: Inspect exact HTTP status codes, `content_type`, `final_url` after redirects, and response headers (such as `Cache-Control`, `Content-Length`, or CORS headers), or issue lightweight `HEAD` checks.

## Parameters

Agents call `http_get` with structured arguments:

- `url` (required): Public `http://` or `https://` URL to request.
- `method` (optional, default `GET`): HTTP method (`GET` or `HEAD`).
- `accept` (optional): Custom read-only `Accept` request header (for example `application/json`).
- `offset` / `max_length` (optional): Character offset and maximum slice length for paginating through large responses.
- `search` / `context_chars` (optional): Pattern filter (case-insensitive substring or regex) and surrounding character context for finding matches inside large HTML or JS payloads.

## How to Enable

### In the UI

When configuring an agent in the [Agent Builder](/agents/new) or editing an existing agent, check the box for:
☑️ **HTTP GET 📡**

### In Agent YAML

Add `http-get` to the `tools` array:

```yaml
tools:
  - http-get
```

## Example Prompts & Use Cases

- **Discover an Undocumented Frontend API**: _"Fetch https://example.com/ with `http_get`, find the main JavaScript bundle URL in the HTML, search that bundle for `/api/`, and call the discovered JSON endpoint."_
- **Inspect HTTP Headers & Status**: _"Run a `HEAD` request on https://example.com/data.json and report the status code, `Content-Type`, and `Content-Length`."_
- **Combine Reading Docs & Querying APIs**: Enable both `http-text` and `http-get` so an agent can read human documentation with HTTP Text and verify live endpoints with HTTP GET.

## Related Tools

- 🌐 **[HTTP Text](fetch.md)**: Read clean, boilerplate-free prose and documentation from web pages.
- 📤 **[HTTP POST](http-post.md)**: Execute mutating `POST`/`PUT`/`PATCH`/`DELETE` calls once endpoints are discovered.
- 🔎 **[Google Search Grounding](search.md)**: Discover candidate URLs before fetching them directly.
- 💻 **[Code Execution](code.md)**: Analyze retrieved datasets in Python.
- 📖 **[Connected Tools Overview](index.md)**
- 🌐 **[User-Agent](../user-agent.md)**: How outbound `http_get` requests identify themselves to target servers.
