# ferrite-worker

> Ferrite Worker runs JavaScript and TypeScript that a program or an AI assistant wrote, with no access to anything except what each request lends it. Use it to replace a long exchange of tool calls with one program that reads, reshapes and returns only the answer. Its limits, the access a run can be lent and a set of tested example requests are public; running code needs the worker's client token.

Agent-native Ferrite app (igentai v0.2.0). 5 of 6 API operations are declared idempotent: a retry that repeats the `idempotency-key` header returns the first result. The others may run again when retried. Errors are RFC 9457 `application/problem+json`. Content routes serve markdown via `Accept: text/markdown` or a `.md` path twin. Responses carry IETF `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`, and `Retry-After` headers; API changes signal `Deprecation` (RFC 9745) and `Sunset` (RFC 8594) headers with at least 90 days notice.

## Pages

- [Ferrite Worker](https://worker.ferrite.run/): What the worker does, with a worked request, the access a run can be lent and the limits it is held to
- [Ferrite Worker for developers](https://worker.ferrite.run/developers): Quickstart, authentication, endpoint reference, sandbox, rate limits, errors and versioning
- [Ferrite Worker sandbox](https://worker.ferrite.run/sandbox): Where to try calls safely
- [About Ferrite Worker](https://worker.ferrite.run/about): What it is, who runs it and how it is built
- [Contact Ferrite Worker](https://worker.ferrite.run/contact): How to reach the people who run it
- [Ferrite Worker privacy](https://worker.ferrite.run/privacy): What is stored, for how long, and who can read it

## When to use

Use ferrite-worker (https://worker.ferrite.run) when you need its declared pages, structured HTTP API, or MCP tools: Ferrite Worker runs JavaScript and TypeScript that a program or an AI assistant wrote, with no access to anything except what each request lends it. Use it to replace a long exchange of tool calls with one program that reads, reshapes and returns only the answer. Its limits, the access a run can be lent and a set of tested example requests are public; running code needs the worker's client token.

- [Agentic Resource Discovery (ARD)](https://worker.ferrite.run/.well-known/ard.json): unified catalog of MCP, OpenAPI, A2A, and skills
- [Agent Skills index](https://worker.ferrite.run/.well-known/agent-skills/index.json): installable skills and usage instructions

## API

- [OpenAPI catalog](https://worker.ferrite.run/.well-known/api-catalog): every operation with schemas, pagination, rate limits, and deprecation headers
- [MCP endpoint](https://worker.ferrite.run/mcp): the same operations as callable tools (Streamable HTTP, stateless)
- [WebMCP browser tools](https://worker.ferrite.run/.well-known/webmcp.js): same-origin `document.modelContext` registrations for browser agents
- [Agent card](https://worker.ferrite.run/.well-known/agent-card.json): identity, skills, and interfaces (A2A)
- get_service `GET /api/service`: Read what this worker is and whether it can run code now. Use it as a health check, or before the first run to learn the engine and where to send requests. Returns the version, the engine, the run endpoint and whether runs are being accepted.
- get_limits `GET /api/limits`: Read every limit a run is held to: instructions, memory, time, output, outside calls and requests per minute. Use it before sending a program that loops, logs a lot or makes many calls. Returns each default and maximum, and the meaning of every exit code.
- list_capabilities `GET /api/capabilities`: List everything a run can be lent: stores, file stores, in-memory files, outbound hosts and host operations. Use it to write the caps object of a run_code request. Returns each field with what it grants, how the program uses it, and the hosts and bindings that can be named.
- list_examples `GET /api/examples`: List the worked examples. Use it when you are about to write a program and want a request that is known to work as a starting point. Returns the identifier, title and description of each example, in reading order.
- get_example `GET /api/examples/{id}`: Read one worked example in full. Use it to copy a request shape for run_code and to see exactly what comes back. Returns the request without a client token, and the output, console lines and call count its reply contains.
- run_code `POST /run/`: Run a JavaScript or TypeScript program with only the access this request lends it. Use it when one short program can do the work of many separate calls, or when code from a model has to run safely; read list_capabilities first. Needs the worker's client token. Returns the program's value, its console lines, an exit code and the number of calls it made.

