# @elyracode/http-tools

HTTP tools for Elyra -- API testing, live documentation fetching, and OpenAPI spec parsing.

## Install

```
elyra install npm:@elyracode/http-tools
```

## Tools

| Tool | Description |
|------|-------------|
| `execute_http_request` | Send HTTP requests (GET, POST, PUT, PATCH, DELETE) with headers, body, and auth. Returns status, headers, and body. |
| `read_url_content` | Fetch a URL and convert HTML to readable text. Perfect for reading live documentation. |
| `inspect_openapi` | Fetch and parse OpenAPI/Swagger specs. Returns structured endpoint summaries. |

## Commands

- `/http` -- Interactive selector for all HTTP tools

## Usage

### API Testing
```
> Test POST localhost:8000/api/login with email and password
> Send a GET to /api/users with Bearer token authentication
> Test all CRUD endpoints for the products API
```

The agent sends the request, reads the response, and if something fails, it can check your logs and fix the code.

### Live Documentation
```
> Read the Laravel Reverb docs and show me how to set it up
> Fetch the latest React 19 changelog
> What's new in Tailwind CSS 4?
```

The agent fetches live documentation, so it always has current information -- even for features released after its training cutoff.

### OpenAPI / Swagger
```
> Parse this OpenAPI spec and generate a PHP client with Guzzle
> Show me all user-related endpoints from the GitHub API
> Build TypeScript types from this Swagger spec
```

The agent reads the entire API definition and generates integration code based on the actual schema.

## Security

- Requests include a `User-Agent: elyra-http-tools` header
- 30-second timeout by default (configurable)
- Large responses are truncated at 50KB (HTTP) or 80KB (URL content)
- No credentials are stored -- auth headers are passed per-request
