# MCP tools reference

> All 154 tools in Cloak Proxy's MCP server, grouped by area, with every argument and whether it is read-only or destructive, plus its 7 resources and 6 prompts.

Source: https://docs.subcloak.com/cloak-proxy/automation/mcp-tools-reference/

This is the complete list of what an AI assistant can do through Cloak Proxy's [MCP server](https://docs.subcloak.com/cloak-proxy/automation/mcp-server/): 154 tools in twenty groups, 7 resources and 6 prompts. Use it to know what to ask for, to decide which tools to auto-approve in your assistant, and to call the tools from your own MCP client.

*[Screenshot: The MCP page of the API client, listing the 151 tools Cloak Proxy offers by group, starting with Model calls, AI security, Captured traffic, Queries and extract rules, Live sharing, Browser extension, Capture and settings, and Debugging tools. The API client's MCP page lists every tool by area. This reference adds each tool's arguments.]*

## How to read this page

Each tool lists its arguments with their JSON type and whether they're required. Your assistant fills them in from what you ask; you rarely type them yourself.

| Kind | Meaning |
|---|---|
| **Read-only** | Only reads. Safe to auto-approve. |
| **Makes changes** | Changes the app, a setting, a rule, a file or the workspace, or sends a request. |
| **Destructive** | Deletes something. The server marks these so clients can ask you to confirm. |

Every tool is marked as not reaching the open internet on its own (`openWorldHint: false`). Tools that send requests, such as `replay_request`, `run_saved_request` and `send_http_request`, still contact the servers those requests go to.

Where a tool takes a request id, use the number from the traffic list's **#** column or from `list_requests`. Where it takes a collection or request, use its name or id; requests can also be given as a `Folder / Name` path.

> **Note:**
> Errors come back as a text message with `isError: true`, for example `upsert_rule needs "rule"` or `No captured request #12`, so the assistant can correct itself.

> **Redacted results:**
> With **Redact sensitive data before sending to AI** on (the default), credentials in known formats show as `REDACTED` in every result (common formats, not every one), and tools that change something refuse arguments containing `REDACTED`. See [Agent skills and setup tools](https://docs.subcloak.com/cloak-proxy/automation/agent-skills/#redact-sensitive-data-before-sending-to-ai).

> **The assistant scope:**
> (added in Cloak Proxy 0.5.1) If you've [limited what assistants can see](https://docs.subcloak.com/cloak-proxy/automation/assistant-scope/), every tool keeps to it: lists and reports leave the rest out, tools refuse request ids outside it (*Request #12 is outside the assistant scope…*), and with metadata only, bodies are withheld. `assistant_scope_status` says what applies.

## Captured traffic

Read, search, trace, replay, repeat, compare, annotate, export and import captured requests, generate types from their JSON, build replayable flows, and map where an app's users' data goes. `list_requests`, `get_request`, `get_request_curl` and `replay_request` read the proxy directly, so they also work with `cloakctl run`; `proxy_status` falls back to the basic status there. The rest, including `get_stream_events`, need the app (or the Linux headless app).

| Tool | Kind |
|---|---|
| [`assistant_scope_status`](#assistant_scope_status) (added in Cloak Proxy 0.5.1) | Read-only |
| [`proxy_status`](#proxy_status) | Read-only |
| [`list_requests`](#list_requests) | Read-only |
| [`get_request`](#get_request) | Read-only |
| [`get_stream_events`](#get_stream_events) (added in Cloak Proxy 0.4.0) | Read-only |
| [`get_protobuf`](#get_protobuf) (added in Cloak Proxy 0.4.0) | Read-only |
| [`get_request_curl`](#get_request_curl) | Read-only |
| [`replay_request`](#replay_request) | Makes changes |
| [`edit_and_replay`](#edit_and_replay) | Makes changes |
| [`compare_requests`](#compare_requests) | Read-only |
| [`repeat_request_many`](#repeat_request_many) (added in Cloak Proxy 0.2.0) | Makes changes |
| [`generate_types`](#generate_types) (added in Cloak Proxy 0.2.0) | Read-only |
| [`annotate_request`](#annotate_request) | Makes changes |
| [`search_requests`](#search_requests) (added in Cloak Proxy 0.2.1) | Read-only |
| [`trace_value`](#trace_value) (added in Cloak Proxy 0.2.1) | Read-only |
| [`build_replay_flow`](#build_replay_flow) (added in Cloak Proxy 0.2.1) | Makes changes |
| [`privacy_map`](#privacy_map) (added in Cloak Proxy 0.2.1) | Read-only |
| [`list_apps`](#list_apps) | Read-only |
| [`list_domains`](#list_domains) | Read-only |
| [`export_session`](#export_session) | Makes changes |
| [`import_session`](#import_session) | Makes changes |

### assistant_scope_status

(added in Cloak Proxy 0.5.1)

What you may see of the captured traffic. The user can limit AI assistants to some apps, hosts, a typed query or the requests they highlight, with full bodies or metadata only (method, URL, status, timing, sizes, redacted headers), and hide everything else or show it as metadata; cloakctl mcp flags can narrow it further for this connection. Returns each scope, who set it, and how many requests are visible, metadata only or hidden. Only the user changes it, in Cloak Proxy; tools refuse ids outside it.

**Read-only.** Does not change anything.

No arguments.

### proxy_status

Cloak Proxy's state: port, recording, whether macOS traffic is captured, request count, active debugging tools, SSL proxying hosts/apps, paused breakpoints, captured domains and apps bypassing the proxy. (added in Cloak Proxy 0.5.1) Under an [assistant scope](https://docs.subcloak.com/cloak-proxy/automation/assistant-scope/), `requests` counts what's visible, and `hiddenByAssistantScope` and `assistantScope` say how many are hidden and why.

**Read-only.** Does not change anything.

No arguments.

### list_requests

Captured HTTP/HTTPS requests (newest last): id, method, URL, status, app, timing, and the GraphQL operation and errors for GraphQL calls. Filter by text, host, app, method, status, GraphQL operation, errors, or only requests newer than an id. (added in Cloak Proxy 0.5.1) Under an [assistant scope](https://docs.subcloak.com/cloak-proxy/automation/assistant-scope/), only requests in it, followed by a line saying how many are hidden.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `search` | string | No | URL or app name contains this |
| `host` | string | No | Host contains this |
| `app` | string | No | App name contains this |
| `method` | string | No | HTTP method |
| `status` | integer | No | Exact status code |
| `graphql_operation` (added in Cloak Proxy 0.4.0) | string | No | Only GraphQL requests whose operation contains this, for example `CreateOrder` or `mutation` (empty: any GraphQL request) |
| `query` (added in Cloak Proxy 0.4.1) | string | No | A [typed query](https://docs.subcloak.com/cloak-proxy/inspect/query-language/), for example `status:5xx app:ShopApp dur:>500ms -host:cdn.*`. A query with a problem is an error that says what's wrong. |
| `errors_only` | boolean | No | Only failures, 4xx/5xx, and 2xx GraphQL responses with errors |
| `since_id` | integer | No | Only requests with a larger id (new since then) |
| `limit` | integer | No | Maximum results (default 50) |

### get_request

One captured request in full: request and response headers and bodies, timing, app, WebSocket messages. (added in Cloak Proxy 0.5.1) Native gRPC responses include their trailers as `response.trailers`, and a WebSocket message cut at 1 MB has `"truncated": true` and `originalSize`.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | Request id from `list_requests` |

### get_stream_events

(added in Cloak Proxy 0.4.0)

A streamed response event by event (SSE, JSON lines such as Ollama, multipart GraphQL `@defer`, or any body forwarded as it arrived): each event's type, id, data and when it arrived (ms after the request, and since the previous event), plus time to first event and the longest gap. GraphQL subscriptions over WebSocket or SSE are listed per operation with their results. Works while the stream is open: pass `after` to get only newer events.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | Request id from `list_requests` |
| `after` | integer | No | Only events after this index (from a previous call's `lastIndex`) |
| `type` | string | No | Only events of this type, e.g. `message` or `content_block_delta` |
| `limit` | integer | No | Maximum events (default 200, at most 1000) |
| `max_data` | integer | No | Characters of data per event (default 2000) |

The result has `format`, `live`, `ending` (`complete`, `clientClosed`, `serverFailed`, or `streaming`), `events`, `lastIndex`, `types` (each type with its count), `timing` (`headersMs`, `firstEventMs`, `spanMs`, `averageGapMs`, `longestGapMs`) and `items`: `index`, `type`, `id`, `timeMs`, `gapMs`, `size`, and `json` (parsed) or `data` (text). GraphQL streams add `graphql` with each operation's `status`, `results`, `firstResultMs`, `errors` and `lastResult`. A request that isn't a stream returns an error.

### get_protobuf

(added in Cloak Proxy 0.4.0)

A captured Protobuf body (gRPC, gRPC-Web, Connect or `application/x-protobuf`) as JSON: by field name with an imported `.proto` schema, otherwise by field number. Includes the framing, the message type and gRPC method, every message of a stream, and the call's gRPC status and trailers. See [Edit Protobuf and gRPC](https://docs.subcloak.com/cloak-proxy/inspect/protobuf-and-grpc/).

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | Request id |
| `side` | string | No | `response` (default) or `request` |

### get_request_curl

A captured request as a cURL command.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | Request id |

### replay_request

Send a captured request again, unchanged, through Cloak Proxy; returns the new request and response.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | Request id |

### edit_and_replay

Send a modified copy of a captured request (or a new request) through Cloak Proxy and return the result. Headers given as an object are merged over the original (`null` removes one).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | Captured request to start from (optional) |
| `method` | string | No | HTTP method |
| `url` | string | No | URL |
| `headers` | object | No | `{"Name": "value"}` is merged in (`null` removes a header), or `[{name, value}]` replaces them all |
| `body` | string | No | Body text |

### compare_requests

Line diff of two captured requests and their responses (headers and bodies).

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `a` | integer | Yes | First request id |
| `b` | integer | Yes | Second request id |

### repeat_request_many

(added in Cloak Proxy 0.2.0)

Send a captured request many times (count, how many at once, delay between starts) through Cloak Proxy and get a summary: status counts and min/avg/p95/max time. For race conditions and rate limits on servers you may test.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | Request id |
| `count` | integer | No | How many (1–1000, default 10) |
| `concurrency` | integer | No | At the same time (1–50, default 1) |
| `delay_ms` | integer | No | Milliseconds between starts (default 0) |

The result has `sent`, `completed`, `failed`, `statusCounts` (status code to count), `minMs`, `averageMs`, `p95Ms`, `maxMs`, `seconds` and `requestIds`, the ids of the new requests in the traffic list. Each request goes through your debugging tools. Encrypted tunnels can't be repeated. This is the same as [Repeat Advanced](https://docs.subcloak.com/cloak-proxy/tools/repeat-and-compose/) in the app, with lower limits.

> **Caution:**
> Only send repeated requests to servers you own or have written permission to test. Hundreds of requests at once can trip rate limits, lock accounts or cost money.

### generate_types

(added in Cloak Proxy 0.2.0)

Type definitions inferred from a captured request's JSON response (or request) body: TypeScript, Swift Codable, Python dataclass, Go or Kotlin.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | Request id |
| `side` | string | No | Which body. One of: `response`, `request`. Default `response`. |
| `language` | string | No | Language. One of: `typescript`, `swift`, `python`, `go`, `kotlin`. Default `typescript`. |
| `root_name` | string | No | Name of the top-level type (default: from the URL) |

It returns the code as text, or an error such as `The response body of #12 isn't JSON`. See [Generate types](https://docs.subcloak.com/cloak-proxy/inspect/generate-types/).

### annotate_request

Highlight a captured request with a color and/or set its comment (shown in the traffic list).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | Request id |
| `color` | string | No | Highlight color. One of: `none`, `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `gray` |
| `comment` | string | No | Comment text (empty clears it) |

### search_requests

(added in Cloak Proxy 0.2.1)

Full-text search of every captured request and response: URLs, headers and decoded bodies, case-insensitive. Returns the matching requests and where each match was found (Req headers, Res body…). Use it to find which requests contain an ID, token or email. Or find which requests ran a GraphQL operation (`graphql_operation`, optionally with no text) and which got GraphQL errors back. `query` narrows it with a [typed query](https://docs.subcloak.com/cloak-proxy/inspect/query-language/).

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `text` | string | No | Text to find, for example an ID. Optional with `query`, `graphql_operation` or `graphql_errors`. |
| `limit` | integer | No | Most matches to return, newest last (default 50, max 500) |
| `scope` (added in Cloak Proxy 0.3.0) | string | No | `all` searches every captured request (the default). `view` searches only what the traffic list shows, with its filters and sidebar selection; in [Split View](https://docs.subcloak.com/cloak-proxy/inspect/traffic-list/#split-view), the focused pane. |
| `graphql_operation` (added in Cloak Proxy 0.4.0) | string | No | Only GraphQL requests whose operation contains this, for example `CreateOrder` or `mutation` |
| `graphql_errors` (added in Cloak Proxy 0.4.0) | boolean | No | Only GraphQL requests whose successful response carried an `errors` array |
| `query` (added in Cloak Proxy 0.4.1) | string | No | A typed query the requests must also match, for example `status:>=400 app:ShopApp resp.body~timeout`. Alone, matches are reported as **Query**. |

The result has `text`, `scope`, `view` (the title of the view searched, with `scope` `view`), `matches` (how many requests matched in total) and `requests`: for each, `id`, `method`, `url`, `status`, `app` and `foundIn`, a list of `Res body`, `Req body`, `Res headers`, `Req headers`, `URL` and `Method/status`. Encrypted tunnels aren't searched. This is the same search as the quick filter set to **All** and **Contains**; see [Search every request and response](https://docs.subcloak.com/cloak-proxy/inspect/filtering/#search-every-request-and-response). GraphQL results also have `graphql` (the operation, such as `mutation CreateOrder`) and `graphqlErrors` (the first error). With no `text`, `foundIn` is `["GraphQL"]`. Calling it with none of `text`, `query`, `graphql_operation` or `graphql_errors` is an error.

### trace_value

(added in Cloak Proxy 0.2.1)

Trace a value (an ID, token or email) through captured traffic: the response it first appeared in, every endpoint that sent it afterwards and exactly where (path, query parameter, header, cookie or JSON key), and responses that returned it again. Use it to explain how data flows between API calls.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `value` | string | Yes | The value to trace, at least 3 characters |

The result has `value`, `requests` and `endpoints` (counts), `origin` (`requestId`, `endpoint`, `kind` of `response` or `request`, `where` and a `note`), `sentBy` and `returnedBy` (each endpoint with `requests`, up to 20 `requestIds` and `where`), up to 200 `occurrences` (`id`, `request`, `sent` and `returned` places), and `truncated`. It traces at most 1,000 matching requests. See [Trace Value](https://docs.subcloak.com/cloak-proxy/inspect/trace-value/).

### build_replay_flow

(added in Cloak Proxy 0.2.1)

Turn captured requests into a replayable flow in the API client: values a later request reuses from an earlier response (IDs, tokens, cursors) are read from the fresh response when the flow runs. Returns the steps and the chained values.

**Makes changes.** Adds a collection and a flow to the API client workspace.

| Argument | Type | Required | Description |
|---|---|---|---|
| `ids` | array of integers | Yes | Request ids, in any order (they're sorted by time) |
| `name` | string | No | Flow name (default `Replay of N requests`) |
| `check_status` | boolean | No | Check each step succeeds like it did when captured (default `true`) |

The result has `flowId`, `name`, `steps`, and `chained`: for each value, the `variable`, `fromStep`, `source` (such as `body $.data.order.id`), the `expression` the flow reads it with, and `usedIn` (steps and where). Encrypted tunnels are left out; the call fails with `None of those ids is a captured HTTP request` when nothing is left. The flow opens in the API client; run it there, with `run_flow`, or with `cloakctl flow run`. Its requests go to the real servers. See [Replayable flows](https://docs.subcloak.com/cloak-proxy/api-client/run/replayable-flows/).

### privacy_map

(added in Cloak Proxy 0.2.1)

Where an app's users' data goes: every outside company the app talks to and the personal data and identifiers each receives (email, phone, name, location, advertising/device/user IDs, the app's own auth tokens, IDs from its backend), and where in the request. Values are partly hidden.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `app` | string | Yes | App name, as in `list_apps` |
| `first_party` | array of strings | No | Registrable domains that are the app's own (default: the ones saved for the app in Privacy Map, or suggested from its name and captures) |

The result has `app`, `firstParty`, `requests`, `thirdPartyRequests`, `summary` (each kind of data with `sentTo` and its `appStoreLabel`) and `recipients`: each outside domain with its `company` and `category` when known, `requests`, and `received` (`data`, `where`, a partly hidden `example`, `requests`, up to 10 `requestIds` and `from` for values the app's servers issued). See [Privacy Map](https://docs.subcloak.com/cloak-proxy/insights/privacy-map/).

### list_apps

Apps seen in the captured traffic with request counts and whether SSL proxying is on for them.

**Read-only.** Does not change anything.

No arguments.

### list_domains

Hosts seen in the captured traffic with request counts and whether they're decrypted.

**Read-only.** Does not change anything.

No arguments.

### export_session

Write captured requests to a file: session (Cloak), HAR, CSV, Postman collection or OpenAPI. Optionally only some ids, and redacted (tokens, cookies, secrets removed).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `format` | string | Yes | File format. One of: `session`, `har`, `csv`, `postman`, `openAPI` |
| `path` | string | Yes | File path to write |
| `ids` | array of integers | No | Only these request ids |
| `redact` | boolean | No | Remove credentials and secrets |
| `in_scope` (added in Cloak Proxy 0.5.1) | boolean | No | Only requests in the active target [scope](https://docs.subcloak.com/cloak-proxy/security/scope/) |

### import_session

Open a HAR, Charles (.chlsj) or Cloak session file into the traffic list.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `path` | string | Yes | File path |

## Queries and extract rules

(added in Cloak Proxy 0.4.1)

Check and apply [typed queries](https://docs.subcloak.com/cloak-proxy/inspect/query-language/), and manage highlight and extract rules. `explain_query` is answered by `cloakctl` itself; the others need the app (or the Linux app).

| Tool | Kind |
|---|---|
| [`explain_query`](#explain_query) (added in Cloak Proxy 0.4.1) | Read-only |
| [`set_traffic_filter`](#set_traffic_filter) (added in Cloak Proxy 0.4.1) | Makes changes (to the view) |
| [`list_extract_rules`](#list_extract_rules) (added in Cloak Proxy 0.4.1) | Read-only |
| [`save_extract_rule`](#save_extract_rule) (added in Cloak Proxy 0.4.1) | Makes changes |
| [`delete_extract_rule`](#delete_extract_rule) (added in Cloak Proxy 0.4.1) | Makes changes |

### explain_query

(added in Cloak Proxy 0.4.1)

Checks a typed traffic query before it's used, and teaches the syntax. Returns the query in its usual form, each condition in plain words and any problems, with where they are. Without a query, returns every field and `is:` flag with examples. Answered by `cloakctl` itself, so it works without the app.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `query` | string | No | The query to check, for example `status:>=500 -host:*.example.net resp.body~timeout` |

Returns `normalized`, `typed` (whether it uses any field), `valid`, `meaning` (such as "status is 5xx (500–599) and not (host matches cdn.*) and duration above 1s") and `problems` (`message`, `at`, `length`, `text`).

### set_traffic_filter

(added in Cloak Proxy 0.4.1)

Puts a typed query in the query bar of the traffic list in front (in Split View, the focused pane), where you see it and can edit it. Returns how many requests match and the newest ones. An empty query clears the bar.

**Makes changes** to the view. Nothing is deleted.

| Argument | Type | Required | Description |
|---|---|---|---|
| `query` | string | Yes | A typed query, for example `status:5xx app:ShopApp dur:>500ms` |
| `save_as` | string | No | Also save it under this name in **Saved Queries** |
| `limit` | integer | No | How many matching requests to return (default 20, max 200) |

### list_extract_rules

(added in Cloak Proxy 0.4.1)

Highlight and extract rules, each with its query, what it extracts and from where, its color and tag, and how many of the newest 20,000 captured requests it matches, with up to five sample values.

**Read-only.** Does not change anything.

No arguments.

### save_extract_rule

(added in Cloak Proxy 0.4.1)

Adds or changes a highlight or extract rule. A rule matching the `id`, or else the `name`, is updated; otherwise a new rule is added. A rule that can't work as written (an empty name, a bad JSONPath or regex, a scope that uses `col:`) is an error that says why.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | string | No | The rule to change, from `list_extract_rules` |
| `name` | string | Yes | Rule and column name, for example `Order` |
| `scope` | string | No | A typed query choosing the requests; empty means all |
| `source` | string | No | `responseBody` (default), `requestBody`, `url`, `requestHeaders` or `responseHeaders` |
| `method` | string | No | `jsonPath` (bodies only) or `regex`. Defaults to `jsonPath` for a pattern starting with `$` |
| `pattern` | string | No | A JSONPath such as `$.order.id`, or a regex whose first group is the value. Empty: highlight only |
| `color` | string | No | `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `gray` or `none` |
| `tag` | string | No | Tag added to matching requests |
| `show_column` | boolean | No | Show the value as a traffic-list column (default true when there's a pattern) |
| `enabled` | boolean | No | On or off (default on) |

### delete_extract_rule

(added in Cloak Proxy 0.4.1)

Deletes a highlight or extract rule.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | string | No | The rule's id |
| `name` | string | No | Or its name |

## Capture control

Muted apps and hosts, Focus mode, how much traffic is kept, recording, the traffic list, macOS capture, App Capture and SSL proxying. These need the app.

| Tool | Kind |
|---|---|
| [`mute_app`](#mute_app) (added in Cloak Proxy 0.2.0) | Makes changes |
| [`mute_host`](#mute_host) (added in Cloak Proxy 0.5.4) | Makes changes |
| [`set_focus`](#set_focus) (added in Cloak Proxy 0.5.4) | Makes changes |
| [`set_retention`](#set_retention) (added in Cloak Proxy 0.5.4) | Makes changes |
| [`set_recording`](#set_recording) | Makes changes |
| [`clear_session`](#clear_session) | Destructive |
| [`set_macos_proxy`](#set_macos_proxy) | Makes changes |
| [`app_capture_status`](#app_capture_status) (added in Cloak Proxy 0.5.0) | Read-only |
| [`set_app_capture`](#set_app_capture) (added in Cloak Proxy 0.5.0) | Makes changes |
| [`ssl_proxying`](#ssl_proxying) | Makes changes |

### mute_app

(added in Cloak Proxy 0.2.0)

Stop (or resume) recording an app's traffic. Muted apps still go through Cloak Proxy and its tools; their requests just aren't listed.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `app` | string | Yes | App name as shown in the sidebar |
| `muted` | boolean | No | `true` to mute (default), `false` to unmute |

The result lists every muted app. It changes the same list as **Settings › General › Muted apps and hosts**; see [Settings](https://docs.subcloak.com/cloak-proxy/reference/settings/#general).

### mute_host

(added in Cloak Proxy 0.5.4)

Stop (or resume) recording a host's traffic, like `mute_app`: `api.example.com`, or `*.example.com` for the domain and every subdomain. Muted hosts still go through Cloak Proxy and its tools. For noisy hosts you never need, Bypass (**Settings › Bypass**) skips the proxy entirely and costs no CPU, and the tool suggests it.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `host` | string | Yes | Host, or `*.example.com` for a whole domain |
| `muted` | boolean | No | `true` to mute (default), `false` to unmute |
| `domain` | boolean | No | `true`: mute the whole domain the host is in (`*.example.com`) |

See [Mute a host or a domain](https://docs.subcloak.com/cloak-proxy/capture/focus-and-retention/#mute-a-host-or-a-domain).

### set_focus

(added in Cloak Proxy 0.5.4)

Focus mode: record only some apps and hosts. Everything else still goes through Cloak Proxy, untouched (not decrypted, no rules) and not recorded. The app shows a banner with what's in focus and how many requests weren't recorded. Focus lasts across launches until it's turned off.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `action` | string | No | `status` (default) shows the focus; `set` focuses on exactly the given apps and hosts; `add` and `remove` change it; `off` stops focusing (the list is kept) and `on` turns it on again |
| `apps` | array | No | App names as in `list_apps` (or a device's address) |
| `hosts` | array | No | Hosts: `api.example.com`, or `*.example.com` for the domain and every subdomain |

The result has what's in focus and `notRecorded`. See [Focus mode](https://docs.subcloak.com/cloak-proxy/capture/focus-and-retention/#focus-mode).

### set_retention

(added in Cloak Proxy 0.5.4)

How much traffic the session keeps (**Settings › General › Capture**). Past either limit the oldest requests are trimmed, except highlighted, commented and Findings requests. Without arguments, it returns the current limits.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `max_requests` | integer | No | `50000`, `100000`, `250000` or `500000` |
| `max_age_days` | integer | No | `1`, `3`, `7`, or `0` for no age limit |

See [How much traffic is kept](https://docs.subcloak.com/cloak-proxy/capture/focus-and-retention/#how-much-traffic-is-kept).

### set_recording

Pause or resume recording traffic (the proxy keeps forwarding either way).

(added in Cloak Proxy 0.4.2) From 0.4.2, while paused the proxy by default (`whilePaused` `passThrough`) passes traffic through untouched, with no decryption and no rules, so sign-ins and bot-protected sites work; `intercept` keeps decrypting and applying rules without recording. The result then also has `whilePaused` and `handsOff`.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `on` | boolean | Yes | true to record |
| `while_paused` (added in Cloak Proxy 0.4.2) | string | No | What paused traffic gets from now on (Settings › General). One of: `passThrough`, `intercept` |

### clear_session

Remove every captured request from the traffic list. (added in Cloak Proxy 0.5.1) Off while an [assistant scope](https://docs.subcloak.com/cloak-proxy/automation/assistant-scope/) is on.

**Destructive.** Deletes something; clients that support it ask you to confirm.

No arguments.

### set_macos_proxy

Turn capturing of all macOS traffic on or off (points the system HTTP/HTTPS proxy at Cloak Proxy; previous settings come back when off).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `on` | boolean | Yes | true to capture macOS traffic |

### app_capture_status

(added in Cloak Proxy 0.5.0)

[App Capture](https://docs.subcloak.com/cloak-proxy/capture/capture-apps-that-ignore-the-proxy/) on the Mac: the network extension that sends picked apps' TCP connections through Cloak Proxy even when they skip the macOS proxy (Go and Rust tools, command-line tools, Electron apps).

**Read-only.** Does not change anything.

No arguments.

The result has `state` (`unavailable`, `needsApplicationsFolder`, `notInstalled`, `waitingForApproval`, `off`, `starting`, `on` or `failed`), `summary`, `on`, `wanted` (turned on by the user), `apps` (each with `name`, `path`, `signingIdentifier` and `enabled`), `blockQUIC`, `proxyPort`, `message` when it failed, and while it runs `connectionsCaptured`, `connectionsOpen`, `quicBlocked` and `recentApps`. `waitingForUser` is true while a request from `set_app_capture` waits for the user.

### set_app_capture

(added in Cloak Proxy 0.5.0)

Change App Capture. `remove`, `disable`, `off` and `block_quic` apply at once. `capture`, `add`, `enable` and `on` never apply by themselves: Cloak Proxy shows the request on its App Capture page and waits for the user to click **Allow** (installing the extension also needs their approval in System Settings). The reply is the state, with `waitingForUser` while the question is open; check `app_capture_status` afterwards. In a build without the extension, `capture`, `add`, `enable` and `on` return an error.

**Makes changes.** Marked destructive, so clients that support it ask you to confirm.

| Argument | Type | Required | Description |
|---|---|---|---|
| `action` | string | Yes | One of: `capture` (add an app and turn App Capture on), `add`, `on`, `remove`, `enable`, `disable`, `off`, `block_quic` |
| `app` | string | For app actions | App name (as in `list_apps` or `bypassing_apps`), or the path of an `.app` or a command-line tool |
| `turn_on` | boolean | No | `add`: also turn App Capture on (same as `capture`) |
| `on` | boolean | For `block_quic` | `true` to block captured apps' HTTP/3 (QUIC) so they use TCP |

### ssl_proxying

List, add or remove hosts and apps whose HTTPS traffic is decrypted. Hosts accept wildcards (`*.example.com`).

(added in Cloak Proxy 0.4.2) From 0.4.2, adding a browser (Chrome, Safari, Firefox…) as an app works but returns a `warning`: decrypting all of a browser's traffic breaks sign-ins and bot-protected sites, so prefer `open_capture_browser`. Sign-in pages and bot checks (`accounts.google.com`, `login.microsoftonline.com`, `*.okta.com`, `challenges.cloudflare.com`…) are never decrypted unless `decrypt_anyway` is used for that built-in host; `never_decrypt` undoes it. The reply lists hosts, apps, `neverDecrypted` and `builtIn`.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `action` | string | No | What to do. One of: `list`, `add_host`, `remove_host`, `add_app`, `remove_app`; from 0.4.2 also `decrypt_anyway`, `never_decrypt` (added in Cloak Proxy 0.4.2) |
| `value` | string | No | Host pattern or app name, or (from 0.4.2) a built-in host for `decrypt_anyway` / `never_decrypt` |

## Debugging tools

Breakpoint, Map Local, Map Remote, Rewrite, Scripting, Block List, Allow List, Network Conditions, DNS Spoofing, No Caching, Mock Sets and Alerts. These need the app. The `tool` argument takes `breakpoint`, `mapLocal`, `mapRemote`, `rewrite`, `scripting`, `blockList`, `allowList`, `networkConditions`, `dnsSpoofing`, `noCaching`, `mockSets` or `alerts`.

| Tool | Kind |
|---|---|
| [`list_rules`](#list_rules) | Read-only |
| [`upsert_rule`](#upsert_rule) | Makes changes |
| [`test_rule`](#test_rule) (added in Cloak Proxy 0.5.1) | Read-only |
| [`delete_rule`](#delete_rule) | Destructive |
| [`set_tool_enabled`](#set_tool_enabled) | Makes changes |
| [`rule_from_request`](#rule_from_request) | Makes changes |
| [`script_logs`](#script_logs) | Read-only |
| [`rule_folders`](#rule_folders) (added in Cloak Proxy 0.4.0) | Makes changes (except `list` and `export`) |
| [`rule_sets`](#rule_sets) (added in Cloak Proxy 0.4.0) | Makes changes (except `list` and `export`) |
| [`failure_scenarios`](#failure_scenarios) (added in Cloak Proxy 0.4.0) | Makes changes (except `list`, `templates` and `log`) |
| [`toxiproxy_api`](#toxiproxy_api) (added in Cloak Proxy 0.4.0) | Makes changes (except `status`) |

### list_rules

Debugging tools (Breakpoint, Map Local, Map Remote, Scripting, Block/Allow List, Network Conditions, DNS Spoofing, No Caching, Mock Sets, Alerts): whether each is on, its rules, and an example rule showing every field.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `tool` | string | No | Only this tool. One of: `breakpoint`, `mapLocal`, `mapRemote`, `rewrite`, `scripting`, `blockList`, `allowList`, `networkConditions`, `dnsSpoofing`, `noCaching`, `mockSets`, `alerts` |

### upsert_rule

Create a rule (no `id`) or change one (with its `id`; only the given fields change). Fields follow `exampleRule` from `list_rules`, for example Map Local: `{name, matcher: {url, method}, statusCode, headers, body}`. Turns the tool on.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `tool` | string | Yes | Which tool. One of: `breakpoint`, `mapLocal`, `mapRemote`, `rewrite`, `scripting`, `blockList`, `allowList`, `networkConditions`, `dnsSpoofing`, `mockSets`, `alerts` |
| `rule` | object | Yes | Rule fields; include `id` to update an existing rule |

A [Rewrite](https://docs.subcloak.com/cloak-proxy/tools/rewrite/) rule holds a list of actions: `{name, matcher: {url}, actions: [{target, operation, name, value, find, isRegex}]}`, where `target` is `requestHeader`, `queryParameter`, `url`, `requestBody`, `responseHeader`, `responseBody` or `status`, and `operation` is `set`, `add`, `remove` or `replace`. A new Rewrite rule sent without `actions` starts with none; other missing fields take the example rule's values. Any rule's `matcher` can also take `apps`, a list of app names as shown in the sidebar, so the rule only applies to those apps. (added in Cloak Proxy 0.2.0)

(added in Cloak Proxy 0.4.0) Any rule's `matcher` also takes `conditions`, all of which must pass: `[{field, name, operator, value}]`, with `field` `header`, `query`, `jsonPath`, `body`, `graphQLOperation` or `graphQLType`, and `operator` `equals`, `notEquals`, `contains`, `notContains`, `matches`, `exists` or `missing` (default `equals`, or `exists` without a value). For example `{"field": "graphQLOperation", "value": "CreateOrder"}`. Sending `conditions` replaces the whole list. See [Conditions and GraphQL operations](https://docs.subcloak.com/cloak-proxy/tools/conditions-and-graphql/).

(added in Cloak Proxy 0.5.1) Map Remote rules take `pathMode`: `"prefix"` swaps the start of the path that the pattern spells out for `path` and keeps the rest and the query; leave it out (or `"replace"`) to replace the whole path. See [Swap the prefix](https://docs.subcloak.com/cloak-proxy/tools/map-remote/#swap-the-prefix).

(added in Cloak Proxy 0.4.0) A rule's `folder` can be a folder name or `"Parent › Child"` path, which is created when it doesn't exist; `""` puts the rule at the top level.

(added in Cloak Proxy 0.4.0) Map Local can answer gRPC, gRPC-Web, Connect or Protobuf with a message written as JSON: set the `Content-Type` header (such as `application/grpc-web+proto`), `body` to the JSON (an array for several messages; field names with an imported schema, otherwise field numbers such as `{"1": 150, "2:fixed32": 7}`), and `protobuf: {messageType, grpcStatus, grpcMessage}`. `get_protobuf` shows a captured body in this form.

### test_rule

(added in Cloak Proxy 0.5.1)

Check a debugging-tool rule against a URL or a captured request without changing anything: whether it matches, the first reason it doesn't (method, app, host, path, subpaths, a condition), and what the tool would do, e.g. the URL Map Remote sends it to (rewrittenURL) or the file Map Local serves. The rule is an id, or fields as for upsert_rule (with an id: that rule with those fields changed).

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `tool` | string | Yes | Which tool. One of: `breakpoint`, `mapLocal`, `mapRemote`, `rewrite`, `scripting`, `blockList`, `allowList`, `networkConditions`, `alerts` |
| `rule` | object | Yes | A rule id (as a string), or rule fields such as \{"matcher": \{"url": "https://api.example.com/v1/\*"\}, "host": "localhost", "port": "8080", "pathMode": "prefix", "path": "/"\} |
| `method` | string | No | Its method (default: the rule's, or GET) |
| `url` | string | No | The URL to test |
| `id` | integer | No | Or a captured request id: its URL, method, app, headers and body are tested, conditions included |

Returns `{verdict, reason, outcome, rewrittenURL, hint, url}`, with `verdict` `matches`, `urlMatches` or `noMatch`. See [Test a pattern](https://docs.subcloak.com/cloak-proxy/tools/rules-and-matching/#test-a-pattern).

```json title="Map Remote with a prefix swap"
{"tool": "mapRemote", "rule": {"matcher": {"url": "https://api.example.com/v1/*"}, "scheme": "http", "host": "localhost", "port": "8080", "pathMode": "prefix", "path": "/"}, "url": "https://api.example.com/v1/orders?status=open"}
```

### delete_rule

Delete a debugging-tool rule.

**Destructive.** Deletes something; clients that support it ask you to confirm.

| Argument | Type | Required | Description |
|---|---|---|---|
| `tool` | string | Yes | Which tool. One of: `breakpoint`, `mapLocal`, `mapRemote`, `rewrite`, `scripting`, `blockList`, `allowList`, `networkConditions`, `dnsSpoofing`, `noCaching`, `mockSets`, `alerts` |
| `id` | string | Yes | Rule id |

### set_tool_enabled

Turn a debugging tool on or off (its rules are kept).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `tool` | string | Yes | Which tool. One of: `breakpoint`, `mapLocal`, `mapRemote`, `rewrite`, `scripting`, `blockList`, `allowList`, `networkConditions`, `dnsSpoofing`, `noCaching`, `mockSets`, `alerts` |
| `enabled` | boolean | Yes | On or off |

### rule_from_request

Make a rule matching a captured request, like the app's right-click menu: Map Local copies its response so you can edit it, Breakpoint pauses it, Mock Sets records it, Alerts watch it, etc.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `tool` | string | Yes | Which tool. One of: `breakpoint`, `mapLocal`, `mapRemote`, `rewrite`, `scripting`, `blockList`, `allowList`, `networkConditions`, `dnsSpoofing`, `noCaching`, `mockSets`, `alerts` |
| `id` | integer | Yes | Captured request id |
| `open` | boolean | No | Also show it in the Tools window |

### failure_scenarios

(added in Cloak Proxy 0.4.0)

Named ways of breaking the network, each switched on and off as a whole: return a status, time out, reset the connection, drop or truncate the body, trickle, delay or serve stale data, for the requests each fault matches. See [Failure scenarios](https://docs.subcloak.com/cloak-proxy/tools/failure-scenarios/).

**Makes changes** (except `list`, `templates` and `log`).

| Argument | Type | Required | Description |
|---|---|---|---|
| `action` | string | No | `list` (default), `templates`, `create`, `update`, `enable`, `disable`, `reset`, `delete`, `log` |
| `scenario` | string | Most actions | Scenario name or id |
| `template` | string | No | `create`: a template name (see `templates`) |
| `url` | string | With `template` | The URL pattern the template's faults match |
| `conditions` | array of objects | No | With `template`: matcher conditions for its faults, as in `upsert_rule` |
| `name` | string | No | `create`: a name instead of the template's |
| `definition` | object | No | `create` or `update`: `{name, note, faults: [{name, matcher, kind, trigger, count, percent, statusCode, headers, body, timeoutSeconds, delayMs, keepPercent, bytesPerSecond}]}`. `kind` is `status`, `timeout`, `reset`, `dropMidBody`, `slow`, `delay`, `truncate` or `stale`; `trigger` is `always`, `firstN`, `afterN`, `nth` or `percent`. |
| `enabled` | boolean | No | `create`: switch it on straight away (default off) |
| `limit` | integer | No | `log`: most events (default 100) |

`list` returns each scenario with `enabled` and its faults' `summary`, `matched` and `applied` counts. `log` returns events with `time`, `requestId`, `scenario`, `fault`, `applied`, `match` (which matching request, 1-based), `method`, `url` and `result`.

### toxiproxy_api

(added in Cloak Proxy 0.4.0)

The [Toxiproxy-compatible API](https://docs.subcloak.com/cloak-proxy/automation/toxiproxy/): its status, or turn it on (on `port`, default `8474`) or off.

**Makes changes** (except `status`).

| Argument | Type | Required | Description |
|---|---|---|---|
| `action` | string | No | `status` (default), `on` or `off` |
| `port` | integer | No | `on`: the API's port (default `8474`) |

Returns `on`, `port`, `url`, `proxies` (as Toxiproxy's API shows them) and `errors` (such as a port already in use).

### script_logs

Recent console output (`console.log`, warnings, errors) from Scripting rules.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | No | How many (default 100) |

### rule_folders

(added in Cloak Proxy 0.4.0)

Folders of rules in each tool, which nest and turn on or off as a unit: a folder that's off turns off every rule in it, and in folders inside it, without touching the rules' own checkboxes. See [Rule folders and sets](https://docs.subcloak.com/cloak-proxy/tools/folders-and-sets/).

**Makes changes** (except `list` and `export`).

| Argument | Type | Required | Description |
|---|---|---|---|
| `action` | string | No | `list` (default), `create`, `rename`, `enable`, `disable`, `move_rule`, `move_folder`, `delete`, `export`, `import` |
| `tool` | string | For `create` and `move_rule` | The folder's tool; elsewhere narrows folder names to that tool |
| `folder` | string | Most actions | Folder name, `"Parent › Child"` path or id. Empty with `move_rule`: the top level |
| `name` | string | `create`, `rename` | The folder's name |
| `parent` | string | No | `create` and `move_folder`: the parent folder (empty: the top) |
| `rule` | string | `move_rule` | The rule's id |
| `delete_rules` | boolean | No | `delete`: also delete its rules (default: they move up a level) |
| `rules` | object | `import` | A rules file's JSON, as `export` returns it |

Each folder in results has `id`, `name`, `path`, `tool`, `enabled` (its own switch), `active` (it and its parents on), `parent`, `rules` (count, including folders inside) and `sets`. `export` returns `rules` (the file) and `ruleCount`; `import` returns `imported`, `folders` and `sets`.

### rule_sets

(added in Cloak Proxy 0.4.0)

Named sets of folders across tools, such as a QA scenario like "Payment declined" or "Empty cart". See [Rule folders and sets](https://docs.subcloak.com/cloak-proxy/tools/folders-and-sets/#rule-sets).

**Makes changes** (except `list` and `export`).

| Argument | Type | Required | Description |
|---|---|---|---|
| `action` | string | No | `list` (default), `create`, `activate`, `deactivate`, `delete`, `export`, `import` |
| `set` | string | `activate`, `delete`, `export` | Set name or id |
| `name` | string | `create` | The new set's name |
| `folders` | array of strings | No | `create`: folder names, paths or ids (default: the folders that are on now) |
| `note` | string | No | `create`: what the set is for |
| `rules` | object | `import` | A rules file's JSON |

`activate` turns the set's folders on, every other set's folders off, and the tools its folders belong to on. `deactivate` turns every set's folders off. `list` returns `active` (the active set's name) and `sets`, each with `id`, `name`, `note`, `active` and `folders` (as `Tool: path`).

## Breakpoints

Requests and responses paused by Breakpoint rules. These need the app.

| Tool | Kind |
|---|---|
| [`break_on_next`](#break_on_next) (added in Cloak Proxy 0.2.0) | Makes changes |
| [`list_paused`](#list_paused) | Read-only |
| [`resolve_paused`](#resolve_paused) | Makes changes |

### break_on_next

(added in Cloak Proxy 0.2.0)

Pause the next request like a captured one at a breakpoint, once (the rule removes itself). Then use `list_paused` and `resolve_paused`.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | Captured request id to match |

It adds a request-only Breakpoint rule for the request's method and URL, turns Breakpoint on, and returns the rule's `ruleId`. The rule is removed once a request has paused on it. Encrypted tunnels can't be used. See [Breakpoint](https://docs.subcloak.com/cloak-proxy/tools/breakpoint/).

### list_paused

Requests and responses currently held by Breakpoint rules, waiting for a decision.

**Read-only.** Does not change anything.

No arguments.

### resolve_paused

Let a paused request/response continue (optionally edited), continue it unedited, or abort it.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | string | Yes | Paused message id from `list_paused` |
| `action` | string | No | Decision. One of: `send`, `send_original`, `abort` |
| `request` | object | No | Edits for a paused request: `{method, url, headers, body}` |
| `response` | object | No | Edits for a paused response: `{status, headers, body}` |

## Insights analysis

Analysis of the captured traffic. Needs the app.

| Tool | Kind |
|---|---|
| [`insights`](#insights) | Read-only |
| [`api_scan`](#api_scan) (added in Cloak Proxy 0.5.1) | Read-only |

### insights

Analysis of the captured traffic: summary, endpoints (API catalog with p50/p95 and errors), security (per-host grades and issues), secrets (leaked keys and tokens, masked), performance (slow, large, duplicate and N+1 requests), schema (JSON shape changes), or a Markdown report.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `section` | string | No | What to return. One of: `summary`, `endpoints`, `security`, `secrets`, `performance`, `schema`, `markdown` |
| `limit` | integer | No | Maximum items (default 50) |

### api_scan

(added in Cloak Proxy 0.5.1)

Passive API-security scan of the captured traffic (nothing is sent). Flags likely BOLA/IDOR (object ids read behind a login — confirm with authorization_matrix), mass-assignment candidates (privileged fields in write bodies), missing rate-limit signals, verbose errors and stack traces, sensitive data in responses, missing security headers and weak cookie flags, CORS misconfigurations, JWT weaknesses, GraphQL introspection, and HTTP request-smuggling / HTTP-2-downgrade (desync) signals. Each finding has evidence, a severity, fix advice, the OWASP API Top 10 id and the request ids. Read-only.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `min_severity` | string | No | Only findings at least this severe (default low). One of: `low`, `medium`, `high` |
| `category` | string | No | Only this category. One of: `bola`, `mass_assignment`, `rate_limit`, `verbose_error`, `sensitive_data`, `security_headers`, `cors`, `jwt`, `graphql`, `desync` |
| `format` | string | No | What to return (default summary). One of: `summary`, `markdown` |
| `limit` | integer | No | Maximum findings (default 50) |
| `in_scope` | boolean | No | Only requests in the active target scope (scope_status) |

See [API scan](https://docs.subcloak.com/cloak-proxy/insights/api-scan/).

## Settings

Proxy settings and the root certificate. These need the app.

| Tool | Kind |
|---|---|
| [`get_settings`](#get_settings) | Read-only |
| [`update_settings`](#update_settings) | Makes changes |
| [`certificate_info`](#certificate_info) | Read-only |

### get_settings

Proxy settings: port, other devices, HTTP/2, body size limit, SSL proxying and bypass lists, allowed devices, external proxy, SOCKS, reverse proxies, insecure upstream hosts, TLS key log, and (added in Cloak Proxy 0.4.0) `tracing` (`injectEnabled`, `injectHosts`, `injectSampled`, `injectOnlyWhenMissing`, `backends`; see [Distributed tracing](https://docs.subcloak.com/cloak-proxy/inspect/distributed-tracing/)).

**Read-only.** Does not change anything.

No arguments.

### update_settings

Change proxy settings. Keys as in `get_settings` (objects like externalProxy merge). Port, other-devices, SOCKS and reverse-proxy changes restart the proxy.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `changes` | object | Yes | `{setting: value}`, for example `{"port": 9091}` or `{"externalProxy": {"isEnabled": true, "host": "proxy.example.com", "port": 8080}}` |

(added in Cloak Proxy 0.4.2) From 0.4.2, the settable keys also include `whilePaused` (`"passThrough"` or `"intercept"`), `decryptBuiltInHosts` (built-in sign-in hosts decrypted anyway) and `externalProxy.bypassHosts` (hosts reached directly, not through the external proxy); SOCKS5 external proxies use `username` and `password` too. A reply adds `warning` when the change adds a browser to `sslProxyingApps`. `get_settings` returns the same keys.

(added in Cloak Proxy 0.5.1) `stripAltSvc` (default `true`) removes `Alt-Svc` from decrypted responses, so apps stay off HTTP/3. See [Keep apps off HTTP/3](https://docs.subcloak.com/cloak-proxy/capture/network-settings/#keep-apps-off-http3).

### certificate_info

The Cloak Proxy root certificate: file, whether macOS trusts it, and its PEM (for installing on devices). Trusting it needs the user's password in the app. (added in Cloak Proxy 0.5.1) It also returns `trust` (`trusted`, `notTrusted` or `distrustedForSSL`), `expiresAt`, `expiry` (`valid`, `expiresSoon` or `expired`), `daysLeft` when it expires soon, and `replacedAt` with `replacedNotice` after the certificate was replaced. The Linux app's answer has them too, with each trust store's `note`.

**Read-only.** Does not change anything.

No arguments.

## Apps that ignore the proxy

Find apps whose traffic is missing and start capturing them. These need the app.

| Tool | Kind |
|---|---|
| [`bypassing_apps`](#bypassing_apps) | Read-only |
| [`diagnose_capture`](#diagnose_capture) (added in Cloak Proxy 0.3.0) | Read-only |
| [`suggest_capture_domains`](#suggest_capture_domains) | Read-only |
| [`authorization_matrix`](#authorization_matrix) (added in Cloak Proxy 0.4.0) | Makes requests |
| [`check_contract`](#check_contract) (added in Cloak Proxy 0.4.0) | Read-only (or makes changes with `save`) |
| [`contract_report`](#contract_report) (added in Cloak Proxy 0.4.0) | Read-only |
| [`release_diff`](#release_diff) (added in Cloak Proxy 0.4.0) | Read-only |
| [`make_tests`](#make_tests) (added in Cloak Proxy 0.4.0) | Makes changes (and requests, with `run`) |
| [`compare_environments`](#compare_environments) (added in Cloak Proxy 0.4.0) | Makes requests |
| [`mirror_report`](#mirror_report) (added in Cloak Proxy 0.4.0) | Read-only |
| [`open_capture`](#open_capture) | Makes changes |

### bypassing_apps

Apps connecting straight to the internet instead of through Cloak Proxy (so their requests don't show up), and apps already captured through DNS.

**Read-only.** Does not change anything.

No arguments.

### diagnose_capture

(added in Cloak Proxy 0.3.0)

Why traffic isn't showing or is failing, per app or device: apps that skip the proxy, certificate pinning (with the pinned hosts), an untrusted certificate on the Mac or a device, HTTP/3 (QUIC) that no proxy can see, the macOS proxy turned off or changed by another app or a VPN, recording paused, filters, muted apps, the Allow List, devices that haven't connected, and servers that can't be reached; from 0.4.2 also bot challenges (`botChallenge`), sign-ins refused while decrypted (`signInRefused`) and an upstream proxy that refuses connections (`upstreamProxyRefused`) (added in Cloak Proxy 0.4.2); from 0.5.0 also App Capture turned on but not running (`appCaptureOff`) (added in Cloak Proxy 0.5.0). Each finding has evidence (hosts, counts, times) and a suggested fix; also returns recent failed connections.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `app` | string | No | Only this app or device (name, or a device's address); omit for everything |

The result has `problems` (how many findings are problems), `findings` (each with `kind`, `severity` (`problem`, `warning` or `info`), `subject`, `title`, `explanation`, `hosts`, `evidence`, `count`, `lastSeen`, `fix` with an `action` and a `title`, and `docs`), `checked` (what was checked and is fine) and `connections` (recent and failed counts, and the last 15 failures). It's the same as the app's [Doctor](https://docs.subcloak.com/cloak-proxy/capture/doctor/). Fixes aren't applied: the user clicks them in the Doctor, or you use the matching tools (`set_macos_proxy`, `set_recording`, `mute_app`, `ssl_proxying`, `open_capture`, and from 0.5.0 `set_app_capture` for the `captureApp` fix).

### suggest_capture_domains

The domains to capture for an app that ignores the proxy (from its binary and traffic seen).

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `app` | string | Yes | App name |

The result has `recommended` (domains named like the app, and the ones it's connected to directly), `connectedDirectlyNow` (domains whose servers the app is connected to directly right now) and `others` (up to 25 more domains found in the app's code). See [Suggested domains](https://docs.subcloak.com/cloak-proxy/capture/apps-that-ignore-the-proxy/#suggested-domains).

### authorization_matrix

(added in Cloak Proxy 0.4.0)

Replay captured requests as several identities and report where another user, or no credentials, gets the original user's data back (a broken object-level authorization check, an IDOR — OWASP API #1). Groups the scope into endpoints, re-sends each as each identity straight to the server (not through the proxy's tools, not into the traffic list), and returns a per-cell verdict with a body-similarity score. Read-only methods by default; writes need `include_writes`. See [Authorization matrix](https://docs.subcloak.com/cloak-proxy/testing/authorization-matrix/).

**Makes requests** to the server, but does not change Cloak Proxy's state. Only test systems you're allowed to test.

| Argument | Type | Required | Description |
|---|---|---|---|
| `identities` | array | No | The identities to test, besides Original and No credentials. Each: `{name, color?, allowed?, headers?, cookies?, query?, from_request?}` |
| `ids` | array of integer | No | Only these captured request ids |
| `app` | string | No | Only this app's requests |
| `host` | string | No | Only this host's requests |
| `in_scope` (added in Cloak Proxy 0.5.1) | boolean | No | Only requests in the active target [scope](https://docs.subcloak.com/cloak-proxy/security/scope/). With a scope active and its guard on, endpoints outside it are skipped anyway |
| `include_anonymous` | boolean | No | Also test with every credential stripped (default true) |
| `include_writes` | boolean | No | Also replay writes (off by default) |
| `treat_404_as_enforced` | boolean | No | Count a 404 as access denied when the original was 2xx (default true) |
| `every_request` | boolean | No | Test every captured request, not one per endpoint |
| `ignore_fields` | array of string | No | JSONPath fields to leave out when comparing bodies |
| `format` | string | No | `summary` (default) or `markdown` |

An identity's `headers`, `cookies` and `query` are objects (`{"Authorization": "Bearer …"}`); `from_request` copies the credentials from a captured request by id; `allowed: true` marks an admin or support role that may see other users' data, so its matches are reported as allowed rather than as problems. The summary result has `scope`, `endpoints`, `identities` (with each one's credentials and JWT subject), `vulnerableCount`, `allowedCount`, `baselineExpired` and `problems` (each with `endpoint`, `identity`, `status`, `similarity`, masked `matched` identifiers and `reasons`).

### check_contract

(added in Cloak Proxy 0.4.0)

Check captured requests and responses against an OpenAPI 3.x or Swagger 2.0 spec: undocumented endpoints and methods, missing or invalid parameters, request and response bodies that don't match their schemas, undocumented status codes and undeclared content types. Each problem has a JSON path (`$.items[3].price`), the expected and actual values and the schema location. Pass the spec as text or a path, or neither to use the specs bound in API Contracts. See [Contract checking](https://docs.subcloak.com/cloak-proxy/testing/contract-checking/).

**Read-only**, unless `save` is true: then the spec is added to API Contracts and live traffic is checked against it from then on.

| Argument | Type | Required | Description |
|---|---|---|---|
| `spec` | string | No | The OpenAPI or Swagger document, as YAML or JSON text |
| `spec_path` | string | No | Path to a spec file on this Mac (instead of `spec`) |
| `host` | string | No | Check this host's requests (and bind the spec to it). Default: the hosts in the spec's `servers`, or the bound hosts |
| `ids` | array of integer | No | Only these captured request ids |
| `app` | string | No | Only this app's requests |
| `strict` | boolean | No | Also report fields and query parameters the spec doesn't list (default false) |
| `only_problems` | boolean | No | List only requests with problems (default true) |
| `limit` | integer | No | Most requests to list (default 50) |
| `save` | boolean | No | Add the spec to API Contracts, bound to `host`, for live checking (default false) |
| `format` | string | No | `summary` (default), `markdown`, `json` or `junit` |

The summary has `summary`, `specs` (title, version, kind, operation count and any problems reading it), `checked`, `failed`, `withWarnings`, `requests` (each with `id`, `operation`, `status`, `result` and `problems`: `kind`, `severity`, `where`, `path`, `message`, `expected`, `actual`, `schema`) and `coverage`.

### contract_report

(added in Cloak Proxy 0.4.0)

API Contracts' report for the specs bound in the app: how many requests were checked and failed, each endpoint's calls and most common problem, the most common problems overall with their JSON paths and example request ids, requests the spec doesn't document, and coverage (operations exercised and never called). (added in Cloak Proxy 0.5.1) Off while an [assistant scope](https://docs.subcloak.com/cloak-proxy/automation/assistant-scope/) is on.

**Read-only.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `spec` | string | No | Only this saved spec, by name or id (default: every enabled spec) |
| `format` | string | No | `summary` (default), `markdown`, `json` or `junit` |

### release_diff

(added in Cloak Proxy 0.4.0)

Compare two recordings of the same journey — two builds of an app, yesterday and today, staging and production: endpoints added and no longer called, JSON fields added, removed, retyped or now null in request and response bodies, query parameters, status code changes, slower calls, endpoints called more often, and third parties that now receive user data. Each difference has a severity and the request ids on both sides. See [Release diff](https://docs.subcloak.com/cloak-proxy/testing/release-diff/).

**Read-only.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `before` | object | Yes | The older side: `session_path` (a `.cloaksession` or `.har` file on this Mac), or nothing for the captured traffic; narrowed with `app`, `app_version`, `host`, `ids`, `from_id`, `to_id`; `label` names it |
| `after` | object | Yes | The newer side, in the same form |
| `slower_ratio` | number | No | Slower when the median is at least this many times the old one (default 1.5) |
| `slower_min_ms` | number | No | …and at least this many milliseconds slower (default 100) |
| `ignore_fields` | array of string | No | JSONPaths to leave out, such as `$.meta.generatedAt` |
| `first_party` | array of string | No | The app's own registrable domains (default: guessed) |
| `host_map` | object | No | After-side host → before-side host, such as `{"api.staging.example": "api.example"}` |
| `include_static` | boolean | No | Also compare images, scripts, styles and fonts (default false) |
| `third_parties` | boolean | No | Compare the user data third parties receive (default true) |
| `min_severity` | string | No | List only `high`, `medium` or `low` and worse |
| `category` | string | No | List only `endpoints`, `fields`, `statuses`, `timing`, `requests` or `third-parties` |
| `limit` | integer | No | Most differences to list (default 50) |
| `format` | string | No | `summary` (default), `markdown` or `json` |

The summary has `before` and `after` (label, requests, API requests, endpoints, errors, median time, apps), `differences`, `counts` by severity, `byCategory`, `changes` (each with `severity`, `category`, `kind`, `title`, `endpoint` or `thirdParty`, `where`, `path`, `before`, `after`, `summary`, `beforeIds` and `afterIds`), `thirdParties` whose data changed, and `firstParty`.

### make_tests

(added in Cloak Proxy 0.4.0)

Turn captured requests into an API-client collection that runs as a test suite: requests in their captured order, IDs and tokens chained from earlier responses, credentials in collection variables, and tests inferred from the capture — status, content type, a JSON schema of every captured response of the endpoint, values that never changed and a response time budget. Static files, tunnels, requests without a response, 5xx responses and SDK third parties are left out by default. See [Make tests from traffic](https://docs.subcloak.com/cloak-proxy/testing/make-tests/).

**Makes changes:** adds a collection to the API client. With `run`, it also sends the requests to the real servers.

| Argument | Type | Required | Description |
|---|---|---|---|
| `ids` | array of integer | No | Only these captured request ids |
| `app` | string | No | Only this app's requests |
| `host` | string | No | Only this host's requests |
| `name` | string | No | The collection's name (default `Tests: …` after the scope) |
| `assertions` | array of string | No | Which tests: `status`, `content-type`, `schema`, `value`, `response-time` (default all) |
| `time_budget_multiplier` | number | No | The slowest captured time × this (default 3) |
| `min_time_budget_ms` | number | No | The smallest budget (default 200) |
| `values_from_one_response` | boolean | No | Also assert flags and labels seen only once (default false) |
| `chain` | boolean | No | Chain IDs and tokens between requests (default true) |
| `credentials_as_variables` | boolean | No | Move credential headers into collection variables (default true) |
| `keep_credentials` | boolean | No | Keep the captured credential values (default true) |
| `include_server_errors` | boolean | No | Keep requests that got a 5xx (default false) |
| `include_third_parties` | boolean | No | Keep requests to SDK companies (default false) |
| `one_per_endpoint` | boolean | No | Keep only the first request to each endpoint (default false) |
| `run` | boolean | No | Run the collection now and return the results (default false) |

The result has `collection` and `collectionId`, `requests`, `tests`, `byKind`, `steps` (each with `name`, `fromRequest`, `endpoint`, `samples`, `tests`, `provides`, `uses`), `chained`, `credentialVariables` and `skipped`; with `run`, `run` has `passed`, the test counts and `failures` (each failing test with its message).

### compare_environments

(added in Cloak Proxy 0.4.0)

Send captured requests to two environments, or compare the captured responses with one other environment, and report what differs per request: status, fields only on one side, fields of another type, and values, ignoring timestamps, request IDs and nonces. Requests go straight to the servers. See [Compare environments](https://docs.subcloak.com/cloak-proxy/testing/compare-environments/).

**Makes requests** to the environments; changes nothing in Cloak Proxy.

| Argument | Type | Required | Description |
|---|---|---|---|
| `right` | object | Yes | `{host, scheme?, port?, headers?: {"Authorization": "Bearer …"}, name?}` |
| `left` | object | No | The same form, or `{captured: true}` (the default) |
| `ids` | array of integer | No | Only these captured request ids |
| `app` / `host` | string | No | Only this app's or host's requests |
| `include_writes` | boolean | No | Also send POST, PUT, PATCH and DELETE (default false) |
| `every_request` | boolean | No | Every request, not one per endpoint (default false) |
| `ignore_fields` | array of string | No | JSONPaths to leave out |
| `concurrency` | integer | No | Requests at once (default 4) |
| `requests_per_second` | integer | No | Rate cap per side (default 10; 0 for none) |
| `allow_insecure_tls` | boolean | No | Accept self-signed certificates (default false) |
| `only_differences` | boolean | No | List only requests that differ (default true) |
| `limit` | integer | No | Most requests to list (default 50) |
| `format` | string | No | `summary` (default), `markdown` or `json` |

The summary has `left`, `right`, `summary`, `counts` (by result: `same`, `values-differ`, `shape-differs`, `status-differs`, `error`, `skipped`) and `requests`, each with `id`, `endpoint`, `result`, both sides' `status`, `ms` and `url`, `similarity` and `differences` (`path`, `kind`, `left`, `right`).

### mirror_report

(added in Cloak Proxy 0.4.0)

Map Remote's mirror mode: the mirror rules, counts (mirrored, writes not mirrored, skipped while busy) and the latest comparisons between each live request's answer and its copy's. Turn mirroring on with `upsert_rule` (tool `map_remote`, `"mirror": true`). See [Mirror live traffic](https://docs.subcloak.com/cloak-proxy/testing/compare-environments/#mirror-live-traffic). (added in Cloak Proxy 0.5.1) Off while an [assistant scope](https://docs.subcloak.com/cloak-proxy/automation/assistant-scope/) is on.

**Read-only.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `only_differences` | boolean | No | List only requests that differ (default true) |
| `limit` | integer | No | Most requests to list (default 50) |
| `format` | string | No | `summary` (default) or `markdown` |

### open_capture

Open the capture sheet for an app in Cloak Proxy so the user can confirm capturing it (needs their Mac password).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `app` | string | Yes | App name |

## Windows

Show something in the app. Needs the app.

| Tool | Kind |
|---|---|
| [`open_in_app`](#open_in_app) | Makes changes |

### open_in_app

Show something in Cloak Proxy: a captured request, the Tools window (optionally a tool), Insights, the API Client, MCP, the Breakpoint window, Device Setup (`mac`, `browser`, `electron`, `terminal`, `ios`, `simulator`, `android`, `docker`, `flutter`, `other`) or a Settings page (general, ssl, bypass, certificate, network, advanced).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `target` | string | Yes | What to show. One of: `request`, `tools`, `insights`, `api_client`, `mcp`, `breakpoints`, `setup`, `settings` |
| `id` | integer | No | Request id (target request) |
| `tool` | string | No | Tool (target tools). One of: `breakpoint`, `mapLocal`, `mapRemote`, `rewrite`, `scripting`, `blockList`, `allowList`, `networkConditions`, `dnsSpoofing`, `noCaching`, `mockSets`, `alerts` |
| `page` | string | No | Setup or Settings page |

## API client

The API client's workspace: collections, requests, environments, runs, mocks, specs, flows, monitors, datasets, comments, generators, packages, history, Recently Deleted and Git. These read and write the workspace folder directly and work without the app, except `save_captured_request`, which reads the request from the proxy.

| Tool | Area | Kind |
|---|---|---|
| [`list_collections`](#list_collections) | Collections and requests | Read-only |
| [`get_saved_request`](#get_saved_request) | Collections and requests | Read-only |
| [`run_saved_request`](#run_saved_request) | Collections and requests | Makes changes |
| [`run_collection`](#run_collection) | Collections and requests | Makes changes |
| [`create_request`](#create_request) | Collections and requests | Makes changes |
| [`update_request`](#update_request) | Collections and requests | Makes changes |
| [`delete_request`](#delete_request) | Collections and requests | Destructive |
| [`send_http_request`](#send_http_request) | Collections and requests | Makes changes |
| [`get_code_snippet`](#get_code_snippet) | Collections and requests | Read-only |
| [`save_captured_request`](#save_captured_request) | Collections and requests | Makes changes |
| [`create_collection`](#create_collection) | Collections and requests | Makes changes |
| [`delete_collection`](#delete_collection) | Collections and requests | Destructive |
| [`create_folder`](#create_folder) | Collections and requests | Makes changes |
| [`import_into_client`](#import_into_client) | Collections and requests | Makes changes |
| [`set_shared_headers`](#set_shared_headers) (added in Cloak Proxy 0.4.1) | Collections and requests | Makes changes |
| [`export_http_file`](#export_http_file) (added in Cloak Proxy 0.4.1) | Collections and requests | Read-only (or makes changes with `path`) |
| [`list_environments`](#list_environments) | Environments and variables | Read-only |
| [`create_environment`](#create_environment) | Environments and variables | Makes changes |
| [`set_variable`](#set_variable) | Environments and variables | Makes changes |
| [`delete_variable`](#delete_variable) | Environments and variables | Destructive |
| [`set_active_environment`](#set_active_environment) | Environments and variables | Makes changes |
| [`run_load_test`](#run_load_test) | Load tests and mock servers | Makes changes |
| [`start_mock_server`](#start_mock_server) | Load tests and mock servers | Makes changes |
| [`stop_mock_server`](#stop_mock_server) | Load tests and mock servers | Makes changes |
| [`list_mock_servers`](#list_mock_servers) | Load tests and mock servers | Read-only |
| [`list_specs`](#list_specs) | Specs | Read-only |
| [`get_spec`](#get_spec) | Specs | Read-only |
| [`save_spec`](#save_spec) | Specs | Makes changes |
| [`lint_spec`](#lint_spec) | Specs | Read-only |
| [`sync_spec`](#sync_spec) | Specs | Makes changes |
| [`generate_openapi`](#generate_openapi) | Specs | Read-only |
| [`list_flows`](#list_flows) | Flows | Read-only |
| [`run_flow`](#run_flow) | Flows | Makes changes |
| [`list_monitors`](#list_monitors) | Monitors | Read-only |
| [`run_monitor`](#run_monitor) | Monitors | Makes changes |
| [`list_datasets`](#list_datasets) | Datasets | Read-only |
| [`get_dataset`](#get_dataset) | Datasets | Read-only |
| [`save_dataset`](#save_dataset) | Datasets | Makes changes |
| [`list_comments`](#list_comments) | Comments | Read-only |
| [`add_comment`](#add_comment) | Comments | Makes changes |
| [`resolve_comment`](#resolve_comment) | Comments | Makes changes |
| [`generate_docs`](#generate_docs) | Docs, SDKs and MCP servers | Makes changes |
| [`generate_sdk`](#generate_sdk) | Docs, SDKs and MCP servers | Makes changes |
| [`generate_mcp_server`](#generate_mcp_server) | Docs, SDKs and MCP servers | Makes changes |
| [`list_packages`](#list_packages) | Packages | Read-only |
| [`save_package`](#save_package) | Packages | Makes changes |
| [`client_history`](#client_history) | History and Recently Deleted | Read-only |
| [`list_recently_deleted`](#list_recently_deleted) | History and Recently Deleted | Read-only |
| [`restore_deleted`](#restore_deleted) | History and Recently Deleted | Makes changes |
| [`git_status`](#git_status) | Git | Read-only |
| [`git_diff`](#git_diff) | Git | Read-only |
| [`git_commit`](#git_commit) | Git | Makes changes |

### list_collections

The API client's collections with every request (ids, methods, URLs) and the environments.

**Read-only.** Does not change anything.

No arguments.

### get_saved_request

A saved request: method, URL, params, headers, body, auth, scripts and docs.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `request` | string | Yes | Request name, `Folder / Name` path, or id |

### run_saved_request

Send a saved request (any protocol: HTTP, GraphQL, gRPC, WebSocket, MQTT, MCP, AI, SQL, TCP) with its scripts, auth and environment; returns the response and test results.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `request` | string | Yes | Request name, `Folder / Name` path, or id |
| `environment` | string | No | Environment name (default: active) |

### run_collection

Run a collection (or one folder) with its tests, like Newman: iterations, a dataset or data file, environment. Returns a pass/fail report.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `environment` | string | No | Environment name |
| `iterations` | integer | No | Times to run (default 1) |
| `folder` | string | No | Only this folder |
| `dataset` | string | No | Dataset name or CSV/JSON file path: one iteration per row |

### create_request

Save a new HTTP request in a collection (created if missing).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name |
| `name` | string | Yes | Request name |
| `method` | string | No | HTTP method |
| `url` | string | Yes | URL; may use `{{variables}}` |
| `headers` | object | No | `{"Name": "value"}` |
| `body` | string | No | Raw body |
| `tests` | string | No | Post-response script with `pm.test`(...) |
| `folder` | string | No | Folder name (optional) |

### update_request

Change a saved request; only the given fields change. Headers and params given as objects merge (`null` removes one). Auth: `{type: bearer | basic | apiKey | …, …params}`.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `request` | string | Yes | Request name, `Folder / Name` path, or id |
| `name` | string | No | New name |
| `method` | string | No | HTTP method |
| `url` | string | No | URL |
| `headers` | object | No | `{"Name": "value"}`, or `null` as the value to remove one |
| `params` | object | No | Query params `{"name": "value"}`, or `null` as the value to remove one |
| `body` | string | No | Raw body |
| `pre_request_script` | string | No | Pre-request script |
| `tests` | string | No | Post-response script |
| `docs` | string | No | Markdown docs |
| `auth` | object | No | `{type, …params}` |

### delete_request

Delete a saved request (kept in Recently Deleted for 30 days).

**Destructive.** Deletes something; clients that support it ask you to confirm.

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `request` | string | Yes | Request name, `Folder / Name` path, or id |

### send_http_request

Send an ad-hoc HTTP request (not saved, not through the proxy) and return the response.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `method` | string | No | HTTP method (default GET) |
| `url` | string | Yes | Absolute URL |
| `headers` | object | No | `{"Name": "value"}` |
| `body` | string | No | Raw body |

### get_code_snippet

A saved request as code: cURL, JavaScript fetch, Python requests, Go, Swift, Node axios, Java, C#, PHP, Ruby, Rust, Kotlin, Dart, PowerShell, HTTPie, wget, raw HTTP…

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `request` | string | Yes | Request name, `Folder / Name` path, or id |
| `language` | string | No | Language name, e.g. cURL, Python, Go (default cURL) |

### save_captured_request

Save a captured request (with its response as an example) into an API-client collection.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | Captured request id |
| `collection` | string | No | Collection name (default: Captured Requests) |

### create_collection

A new, empty collection.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `name` | string | Yes | Name |
| `docs` | string | No | Markdown description |

### delete_collection

Delete a collection (kept in Recently Deleted for 30 days).

**Destructive.** Deletes something; clients that support it ask you to confirm.

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |

### create_folder

A folder in a collection (optionally inside another folder).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `name` | string | Yes | Folder name |
| `parent` | string | No | Parent folder name |

### import_into_client

Import into the API client from a file or text: OpenAPI/Swagger, Postman collection or environment, HAR, a `.http`/`.rest` file (VS Code REST Client, JetBrains HTTP Client) (added in Cloak Proxy 0.4.1), or a cURL command.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `path` | string | No | File path |
| `text` | string | No | Or the content itself (e.g. a curl command) |
| `name` | string | No | Collection name to use |

### set_shared_headers

(added in Cloak Proxy 0.4.1)

Headers every request in a collection, or one folder, sends, such as an API version or client header. A request's own header with the same name wins, and a folder's over the collection's. Values can use `{{variables}}`. See [Collections and requests](https://docs.subcloak.com/cloak-proxy/api-client/collections-and-requests/).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `folder` | string | No | Folder name (default: the whole collection) |
| `headers` | object | Yes | `{"Header-Name": "value"}`; `null` removes one |

### export_http_file

(added in Cloak Proxy 0.4.1)

A collection, or one folder, as a `.http` file for VS Code's REST Client or JetBrains' HTTP Client: variables first, then each request with its inherited headers and auth. Secret variables are left out. Returns the text, or writes it to `path`. See [.http files](https://docs.subcloak.com/cloak-proxy/api-client/http-files/).

**Read-only** unless `path` is given.

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `folder` | string | No | Only this folder |
| `path` | string | No | File to write |

### list_environments

Environments and globals with their variables (secret values hidden), and which is active. Each environment has `basedOn` (added in Cloak Proxy 0.4.1) and `inherited` (the values it gets from its base and `.env` files, with where each comes from), and the result lists the workspace's `dotEnvFiles`.

**Read-only.** Does not change anything.

No arguments.

### create_environment

A new environment with variables.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `name` | string | Yes | Name |
| `variables` | object | No | `{"key": "value"}` |
| `activate` | boolean | No | Make it the active environment |
| `based_on` (added in Cloak Proxy 0.4.1) | string | No | An environment whose variables this one uses unless it sets the same name, for example `Base` |

### set_variable

Set a variable in an environment, a collection or globals.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `scope` | string | Yes | Where. One of: `environment`, `collection`, `globals` |
| `environment` | string | No | Environment name (default: active) |
| `collection` | string | No | Collection (scope collection) |
| `key` | string | Yes | Name |
| `value` | string | Yes | Value |
| `secret` | boolean | No | Store as a secret (kept out of Git) |

### delete_variable

Remove a variable from an environment, a collection or globals.

**Destructive.** Deletes something; clients that support it ask you to confirm.

| Argument | Type | Required | Description |
|---|---|---|---|
| `scope` | string | Yes | Where. One of: `environment`, `collection`, `globals` |
| `environment` | string | No | Environment name |
| `collection` | string | No | Collection |
| `key` | string | Yes | Name |

### set_active_environment

Choose the active environment (or none).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `environment` | string | Yes | Environment name, or `none` |

### run_load_test

Local performance test of a collection: virtual users, duration and load shape. Returns throughput, latency percentiles and errors per request.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `virtual_users` | integer | No | Concurrent users (default 10) |
| `duration_seconds` | integer | No | Seconds (default 30) |
| `profile` | string | No | Load shape. One of: `fixed`, `rampUp`, `spike`, `peak` |
| `environment` | string | No | Environment name |

### start_mock_server

Serve a collection's saved examples on localhost (match by method and path; `x-mock-response-name/-code` headers pick examples). Runs while this MCP session lasts.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `port` | integer | No | Port (default: any free port) |

### stop_mock_server

Stop a mock server started in this session.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |

### list_mock_servers

Mock servers running in this session, with their URLs and recent calls.

**Read-only.** Does not change anything.

No arguments.

### list_specs

OpenAPI specs in the workspace and the collections they're linked to.

**Read-only.** Does not change anything.

No arguments.

### get_spec

A spec's YAML/JSON text.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `spec` | string | Yes | Spec name or id |

### save_spec

Create or replace a spec's text.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `name` | string | Yes | Spec name |
| `text` | string | Yes | OpenAPI YAML or JSON |

### lint_spec

Check an OpenAPI spec (from the workspace, or text) for problems.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `spec` | string | No | Spec name |
| `text` | string | No | Or the spec text |

### sync_spec

Generate the spec's collection, or update its linked collection from the spec (tests, scripts and examples are kept; removed operations move aside).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `spec` | string | Yes | Spec name |
| `collection` | string | No | Existing collection to link and update (default: the linked one, or a new one) |

### generate_openapi

An OpenAPI 3 YAML document generated from a collection.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |

### list_flows

Flows (chained requests with logic) in the workspace.

**Read-only.** Does not change anything.

No arguments.

### run_flow

Run a flow and return each step's result and its outputs.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `flow` | string | Yes | Flow name or id |
| `inputs` | object | No | Input variables `{"name": value}` |

### list_monitors

Scheduled collection monitors with their last results.

**Read-only.** Does not change anything.

No arguments.

### run_monitor

Run a monitor now and record the result in its history.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `monitor` | string | Yes | Monitor name or id |

### list_datasets

Datasets (test data tables for the runner).

**Read-only.** Does not change anything.

No arguments.

### get_dataset

A dataset's columns and rows.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `dataset` | string | Yes | Dataset name |

### save_dataset

Create or replace a dataset.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `name` | string | Yes | Dataset name |
| `columns` | array of strings | Yes | Column names |
| `rows` | array of arrays of strings | Yes | Rows: arrays of cell strings |

### list_comments

Comment threads on a collection or a request.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `request` | string | No | Request (omit for the collection's comments) |

### add_comment

Comment on a collection or request (optionally on one part, or as a reply).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `request` | string | No | Request (omit for the collection) |
| `text` | string | Yes | Comment |
| `anchor` | string | No | Part it's about: URL, Params, Headers, Body, Scripts… |
| `reply_to` | string | No | Comment id to reply to |

### resolve_comment

Mark a comment thread resolved (or reopen it).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | string | Yes | Comment id |
| `resolved` | boolean | No | true to resolve |

### generate_docs

API documentation for a collection as one HTML file (with code samples and the collection's branding).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `path` | string | Yes | Where to write the .html |

### generate_sdk

A client SDK for a collection's API.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `language` | string | Yes | Language. One of: `TypeScript`, `Python`, `Swift` |
| `path` | string | Yes | Folder to write |

### generate_mcp_server

A Node.js MCP server with one tool per request in a collection, so AI assistants can call that API.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `collection` | string | Yes | Collection name or id |
| `path` | string | Yes | Folder, or a .zip path |

### list_packages

Script packages (`pm.require` modules) in the workspace.

**Read-only.** Does not change anything.

No arguments.

### save_package

Create or replace a script package (CommonJS: `module.exports = …`).

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `name` | string | Yes | Package name |
| `code` | string | Yes | JavaScript |

### client_history

Requests recently sent from the API client.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | No | How many (default 30) |

### list_recently_deleted

Deleted collections, folders, requests, environments and datasets that can still be restored.

**Read-only.** Does not change anything.

No arguments.

### restore_deleted

Restore something from Recently Deleted.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | string | Yes | Id from `list_recently_deleted` |

### git_status

The workspace's Git branch, changed files and recent commits.

**Read-only.** Does not change anything.

No arguments.

### git_diff

The uncommitted diff of the workspace (or one file).

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `path` | string | No | File path inside the workspace |

### git_commit

Commit every change in the workspace.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `message` | string | Yes | Commit message |

## Model calls

(added in Cloak Proxy 0.4.0)

What apps and agents sent to model APIs and what it cost. These need the app (or the Linux headless app), not `cloakctl run`. See [LLM Inspector](https://docs.subcloak.com/cloak-proxy/inspect/llm-inspector/).

| Tool | Kind |
|---|---|
| [`llm_calls`](#llm_calls) (added in Cloak Proxy 0.4.0) | Read-only |
| [`llm_summary`](#llm_summary) (added in Cloak Proxy 0.4.0) | Read-only |
| [`llm_prices`](#llm_prices) (added in Cloak Proxy 0.4.0) | Makes changes |

### llm_calls

(added in Cloak Proxy 0.4.0)

Model calls in the captured traffic (OpenAI Chat Completions and Responses, Anthropic Messages, Gemini, Ollama and OpenAI-compatible servers): model, input, cached and output tokens, cost, time to first token, tokens per second, stop reason, tool calls, errors and retries. With `id`: one call in full, with the prompt, the reply reassembled from the stream, each tool call paired with the result a later request sent back, where the context window went, and the first change since the previous turn (where a prompt cache stops matching).

**Read-only.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | One call in full (a request id) |
| `app` | string | No | App name contains this |
| `host` | string | No | Host contains this |
| `model` | string | No | Model contains this |
| `errors_only` | boolean | No | Only failed calls |
| `since_id` | integer | No | Only calls with a larger id |
| `limit` | integer | No | Maximum calls (default 50) |
| `max_text` | integer | No | With `id`: characters per prompt or reply text (default 4000) |

Each call: `id`, `api`, `provider`, `model`, `app`, `status`, `streamed`, `stopReason`, `error`, `retryAfterSeconds`, `inputTokens` (billed at the full price), `cacheReadTokens`, `cacheWriteTokens`, `outputTokens`, `reasoningTokens`, `costUSD`, `timeToFirstTokenMs`, `durationMs`, `tokensPerSecond`, `toolCalls`, `retryOf`. With `id` it adds `parameters`, `cost` (by part, with the price used), `cacheHitPercent`, `contextBudget`, `sinceLastTurn` (`previousId`, `samePrefixBytes`, `firstChange`, `offset`, `before`, `after`), `system`, `tools`, `turns`, `reply`, `reasoning` and `replyToolCalls` (with `resultIn` and `result`).

### llm_summary

(added in Cloak Proxy 0.4.0)

Spend and tokens of the captured model calls by model, app and host: calls, failures, input, cached and output tokens, cost, prompt-cache hit rate, median and p95 time to first token, retries, and models without a price.

**Read-only.** No arguments.

### llm_prices

(added in Cloak Proxy 0.4.0)

The price list the LLM Inspector uses for costs, in dollars per million tokens (input, output, cache read, cache write): built-in prices with your own entries on top. Built-in prices are a dated snapshot, so costs are estimates; set your provider's current prices for the models you rely on. Pass `set` to add or change entries (a model id or prefix), `remove` to take your entries out.

**Makes changes** (with `set` or `remove`).

| Argument | Type | Required | Description |
|---|---|---|---|
| `model` | string | No | Only models containing this |
| `set` | array of objects | No | `{model, provider, input, output, cacheRead, cacheWrite}`; `model`, `input` and `output` are required |
| `remove` | array of strings | No | Model ids of your entries to remove |

## Setup, docs and bug reports

(added in Cloak Proxy 0.4.0)

Guided capture setup, one-click capture targets, the root certificate, these docs, and bug reports. These run in the app; when it isn't running, cloakctl does the parts that need no app (simulators, adb, certificate files, terminal variables, starting browsers and Electron apps, writing configuration). `search_docs` runs in cloakctl and works offline. See [Agent skills and setup tools](https://docs.subcloak.com/cloak-proxy/automation/agent-skills/), [Capturing browser and Electron apps](https://docs.subcloak.com/cloak-proxy/devices/capturing-browser/), [Docker](https://docs.subcloak.com/cloak-proxy/devices/docker/) and [Flutter](https://docs.subcloak.com/cloak-proxy/devices/flutter/).

| Tool | Kind |
|---|---|
| [`capture_setup`](#capture_setup) | Read-only (or makes changes with `apply`) |
| [`install_certificate`](#install_certificate) | Makes changes |
| [`open_capture_browser`](#open_capture_browser) | Makes changes (starts a browser) |
| [`launch_electron`](#launch_electron) | Makes changes (starts, and with `relaunch` quits, an app) |
| [`inject_terminal`](#inject_terminal) | Read-only, or opens a Terminal window |
| [`capture_config`](#capture_config) | Read-only, or writes files with `write` |
| [`search_docs`](#search_docs) | Read-only |
| [`make_bug_report`](#make_bug_report) (added in Cloak Proxy 0.4.0) | Makes changes |

### capture_setup

Guided capture setup: the checklist for getting a kind of client's HTTPS traffic into Cloak Proxy, each step marked `done`, `todo` (Cloak Proxy can do it), `needs_user` or `info`, with `next` the first step to do. Checks the proxy, certificate trust, macOS capture, SSL proxying for the given hosts or app, booted simulators and their certificates, Android devices over adb, and whether the app's requests are arriving. With `apply`, does one step first.

**Makes changes** with `apply`; otherwise read-only.

| Argument | Type | Required | Description |
|---|---|---|---|
| `target` | string | Yes | `mac`, `ios_simulator`, `iphone`, `android`, `terminal`, `docker`, `firefox`, `java`, `electron` or `flutter` |
| `app` | string | No | The app to capture (its name as in `list_apps`): adds it to SSL proxying and checks its requests arrive |
| `hosts` | array of strings | No | API hosts to decrypt, such as `["api.example.com", "*.example.com"]` |
| `apply` | string | No | A step to do now: `macos-proxy`, `ssl-proxying`, `other-devices`, `recording`, `mac-certificate`, `simulator-certificate`, `android-proxy`, `android-proxy-off`, `android-certificate`, `environment`, `capture-browser`, `launch-electron`, `compose-override`, `flutter-snippet` or `network-security-config` |
| `project` | string | No | `compose-override`, `flutter-snippet`, `network-security-config`: the project folder to write into |
| `relaunch` | boolean | No | `launch-electron`: quit the app first if it's running |
| `udid` | string | No | `simulator-certificate`: one simulator (UDID or name) instead of every booted one |
| `serial` | string | No | `android-…`: one device serial instead of every ready one |

The result has `target`, `title`, `summary`, `steps` (each with `id`, `title`, `detail`, `status`, `required`, `apply` and `commands`), `next`, `ready`, `docs`, `text` (the checklist as plain text) and, with `apply`, `applied` (what was done, per simulator or device). What each step does is on [Agent skills and setup tools](https://docs.subcloak.com/cloak-proxy/automation/agent-skills/#steps-cloak-proxy-can-do).

### install_certificate

Install or export the root certificate: in booted simulators (no password), on an Android device's Downloads over adb, on this Mac (opens **Settings › Certificate** for the user to confirm with their password), or as a file.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `target` | string | Yes | `simulator`, `android`, `mac` or `file` |
| `udid` | string | No | `simulator`: one simulator's UDID or name (default: every booted one) |
| `serial` | string | No | `android`: one device serial (default: every ready device) |
| `path` | string | No | `file`: where to write it (default `~/Downloads/cloak-proxy-ca.pem` or `.cer`; a folder gets that file name) |
| `format` | string | No | `file`: `pem` (default) or `der` |

### open_capture_browser

Open a capturing browser: Chrome, Chromium, Edge, Brave or Firefox in its own profile, already using Cloak Proxy (localhost included) and trusting its certificate, without changing the Mac's proxy or the user's everyday browser. Lists the installed browsers, or quits the ones Cloak Proxy opened.

**Makes changes:** starts a browser (not with `dry_run`).

| Argument | Type | Required | Description |
|---|---|---|---|
| `action` | string | No | `open` (default), `list` or `close` |
| `browser` | string | No | `chrome`, `chromium`, `edge`, `brave` or `firefox` (default: the first installed Chromium browser) |
| `url` | string | No | A page to open, such as `http://localhost:3000` |
| `capture_localhost` | boolean | No | Send localhost and 127.0.0.1 through the proxy too (default `true`) |
| `fresh_profile` | boolean | No | Start from an empty throwaway profile, deleted when the browser quits (default `false`) |
| `dry_run` | boolean | No | Return the plan without starting anything |

The result has `browser`, `title`, `version`, `launched`, `pid`, `profile`, `fresh_profile`, `proxy`, `captures_localhost`, `trust` (`launch_flag`, `keychain`, `profile_store` or `untrusted`), `trust_note`, `command` and `note`. `list` returns `browsers` and the `open` ones; `close` returns `closed`.

### launch_electron

Start an Electron app with capture: Chromium's proxy flags for its windows, the Node.js proxy variables and certificate for its main process. A running copy is quit first only with `relaunch`; otherwise the call fails and says so.

**Makes changes:** starts the app, and with `relaunch` quits it first (not with `dry_run`).

| Argument | Type | Required | Description |
|---|---|---|---|
| `action` | string | No | `launch` (default) or `list` |
| `app` | string | For `launch` | The app's name (from `list`), bundle id, or path to the `.app` |
| `relaunch` | boolean | No | Quit the app first if it's running (default `false`) |
| `capture_localhost` | boolean | No | Proxy its localhost requests too (default `true`) |
| `dry_run` | boolean | No | Return the plan without quitting or starting anything |

The result has the app's `name`, `path`, `bundle_id`, `version` and `electron` version, `was_running`, `launched`, `pid`, `command` and `note`. `list` returns `apps`.

### inject_terminal

Proxy settings for command-line tools: open a new Terminal window whose programs use Cloak Proxy and trust its certificate, or get the lines to paste into a shell.

**Read-only**, except `mode: "open"`, which opens a Terminal window.

| Argument | Type | Required | Description |
|---|---|---|---|
| `mode` | string | No | `open` (default in the app), `script` or `env` |
| `shell` | string | No | `script`: `zsh` (default), `bash`, `fish` or `powershell` |
| `dry_run` | boolean | No | `open`: return the script without opening a window |

The result has `script` (and `opened`) or `variables`. When the app isn't running, `open` returns the script instead.

### capture_config

Configuration that gets a container's, Flutter app's or Android app's traffic into Cloak Proxy, previewed or written into a project.

**Read-only**, except with `write: true`, which writes files into `project`.

| Argument | Type | Required | Description |
|---|---|---|---|
| `kind` | string | Yes | `docker_compose`, `docker_run`, `env_file`, `flutter` or `android_network_config` |
| `project` | string | No | The project folder: with `compose.yaml`, `pubspec.yaml`, or the Android project or app module. Needed for `docker_compose` and to write. |
| `write` | boolean | No | Write the files into `project` (default `false`: preview) |
| `services` | array of strings | No | `docker_compose`: only these services (default: all) |
| `service` | string | No | `docker_run`, `env_file`: the name to label the container's requests with |
| `proxy_host` | string | No | `docker_*`: how containers reach this computer (default `host.docker.internal`) |
| `device` | string | No | `flutter`: `ios_simulator` (default), `android_emulator`, `android_usb` or `device` |
| `trust` | string | No | `android_network_config`: `bundled` (default) or `user` |
| `domains` | array of strings | No | `android_network_config`: limit the trust to these domains (default: all) |

`docker_compose` returns `compose_file`, `override_file`, `project`, `services`, `captured`, `change` (`created`, `updated`, `unchanged` or `preview`), `automatic`, `command` and `contents`. `docker_run` returns `flags` and `command`; `env_file` returns `contents` and `mounts`. `flutter` returns `file`, `contents`, `change`, `run`, `main`, `import` and `device_note`. `android_network_config` returns `module`, `config`, `trust` and `files` (each with `path`, `change` and `contents`).

### search_docs

Search Cloak Proxy's documentation: an offline index of every page's title, description and headings. Returns the best pages with their URLs, a Markdown URL to read, and the matching sections with links.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `query` | string | Yes | A question or keywords, such as `install certificate on android` |
| `limit` | integer | No | Most pages to return (default 5, max 20) |

### make_bug_report

(added in Cloak Proxy 0.4.0)

Bundle captured traffic into a bug report and save it as a .zip: `README.md` with the failing requests first (status, timing, response excerpt, trace and links, API contract errors, related Sentry error reports, a cURL repro) and a timeline; `requests.har` and a Cloak session, redacted by default; `replay/collection.json` and `replay/flow.json`; `reproduce.sh`. It never files anything: with `review: true` it opens the Report Bug window filled in, where the user checks it and clicks File. See [Report Bug](https://docs.subcloak.com/cloak-proxy/sessions/report-bug/).

**Makes changes.** Writes a file (or opens a window).

| Argument | Type | Required | Description |
|---|---|---|---|
| `title` | string | Yes | The bug's title |
| `description`, `steps`, `expected` | string | No | What happened, how to reproduce it, and what should have happened |
| `ids` | array of integers | No | The requests to include |
| `app` | string | No | Without `ids`: only this app's requests |
| `minutes` | integer | No | Without `ids`: the last N minutes (default 5) |
| `redact` | boolean | No | Remove tokens, cookies, passwords and keys (default `true`) |
| `include_har`, `include_session`, `include_replay`, `include_curl` | boolean | No | Leave a part out (all default `true`) |
| `path` | string | No | A .zip path or a folder (default `~/Downloads`) |
| `review` | boolean | No | Open the Report Bug window with this report instead of saving |

The result has `path`, `requests`, `failing` (ids), `sentryEvents`, `files` (each with `path` and `bytes`), `redacted` and `markdown`.

## Distributed tracing

(added in Cloak Proxy 0.4.0)

Trace IDs, propagation checks and trace links. These need the app. See [Distributed tracing](https://docs.subcloak.com/cloak-proxy/inspect/distributed-tracing/).

| Tool | Kind |
|---|---|
| [`get_trace`](#get_trace) | Read-only |
| [`trace_report`](#trace_report) | Read-only |
| [`configure_tracing`](#configure_tracing) | Makes changes |

### get_trace

A captured request's distributed trace: its trace and parent span IDs in every format it sent (W3C, B3, Jaeger, Datadog, X-Ray, Cloud Trace, Sentry), what the response reported, the verdict (`untraced`, `sent`, `confirmed`, `server_started` or `broken`) and its problems, `Server-Timing` metrics, links to the configured backends, and every other captured request in the trace. Or pass `trace_id` to find the requests in a trace.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | A captured request id |
| `trace_id` | string | No | Or a trace ID: 16 or 32 hex digits, a Datadog decimal, or an X-Ray root (`1-…-…`) |
| `limit` | integer | No | Most requests in the trace to list (default 100) |

The result has `traceId` (and `traceId32`, `traceIdDecimal`), `requests` (each with `id`, `request`, `status`, `app`, `spanId`, `formats`, `verdict`, `problems` and `injected`), `count`, `links` (each with `name`, `url` and `needsEditing`) and, with `id`, `analysis`.

### trace_report

Trace propagation across captured traffic: requests that carried trace context, confirmed by the server, broken, server-started and untraced, per host, and every broken request with its problems.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `host` | string | No | Only this host (wildcards allowed) |
| `app` | string | No | Only this app's requests |
| `ids` | array of integers | No | Only these request ids |
| `limit` | integer | No | Most broken requests to list (default 50) |
| `format` | string | No | `summary` (JSON, default) or `markdown` |

### configure_tracing

Change the tracing settings: inject a sampled W3C `traceparent` into requests for chosen hosts, and the **Open in …** links. Only the fields given change; `backends` replaces the whole list. Returns the settings.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `inject` | boolean | No | Turn injection on or off (needs `inject_hosts`) |
| `inject_hosts` | array of strings | No | Hosts to inject into, such as `["api.example.com", "*.example.com"]` |
| `sampled` | boolean | No | Set the sampled flag (default `true`) |
| `only_when_missing` | boolean | No | Leave requests that already carry trace context alone (default `true`) |
| `backends` | array of objects | No | `[{name?, kind, url_template?, hosts?}]`: `kind` is `jaeger`, `zipkin`, `tempo`, `honeycomb`, `datadog`, `xray`, `cloud_trace`, `sentry` or `custom` (which needs `url_template`) |

## Live sharing

(added in Cloak Proxy 0.4.1)

Share live traffic, read-only, with a colleague on the same network. These need the app (or the Linux app). See [Live sharing](https://docs.subcloak.com/cloak-proxy/sessions/live-sharing/).

| Tool | Kind |
|---|---|
| [`start_live_share`](#start_live_share) (added in Cloak Proxy 0.4.1) | Makes changes |
| [`list_live_shares`](#list_live_shares) (added in Cloak Proxy 0.4.1) | Read-only |
| [`stop_live_share`](#stop_live_share) (added in Cloak Proxy 0.4.1) | Makes changes |

### start_live_share

(added in Cloak Proxy 0.4.1)

Shares live traffic, read-only, with a colleague on the same network. Returns links to open in a browser (no account; nothing leaves the network). A typed query chooses what's shared. Secrets are hidden unless `redact` is false. (added in Cloak Proxy 0.5.1) Off while an [assistant scope](https://docs.subcloak.com/cloak-proxy/automation/assistant-scope/) is on, and `list_live_shares` leaves out the links.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `name` | string | Yes | Shown to the viewer, for example `Checkout bug in ShopApp 4.2` |
| `scope` | string | No | A typed query of what to share, for example `app:ShopApp -host:*.analytics.example` (default: everything) |
| `include_bodies` | boolean | No | Include request and response bodies (default true) |
| `redact` | boolean | No | Hide tokens, cookies, passwords and keys (default true) |
| `hours` | number | No | Stop after this many hours (default 8; 0 for until stopped) |

### list_live_shares

(added in Cloak Proxy 0.4.1)

Shares that are on: id, name, scope, links, viewers in the last minute and end time.

**Read-only.** Does not change anything.

No arguments.

### stop_live_share

(added in Cloak Proxy 0.4.1)

Stops a share; its link stops working at once.

**Makes changes.**

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | string | No | The share's id, from `list_live_shares` |
| `all` | boolean | No | Stop every share |

## Share links

(added in Cloak Proxy 0.6.0)

End-to-end encrypted links to captured requests, or to a saved session or HAR file, that anyone opens read-only in a browser. They need the app, signed in to [Personal Cloud](https://docs.subcloak.com/cloak-proxy/cloud/overview/) with a plan. Every link an assistant asks for waits for you to allow it in Cloak Proxy, is always redacted and lasts at most 7 days. See [Share links](https://docs.subcloak.com/cloak-proxy/cloud/share-links/).

| Tool | Kind |
|---|---|
| [`create_share_link`](#create_share_link) (added in Cloak Proxy 0.6.0) | Makes changes |
| [`list_share_links`](#list_share_links) (added in Cloak Proxy 0.6.0) | Read-only |
| [`revoke_share_link`](#revoke_share_link) (added in Cloak Proxy 0.6.0) | Destructive |

### create_share_link

(added in Cloak Proxy 0.6.0)

Creates an end-to-end encrypted Personal Cloud link to captured requests, or to a saved session or HAR file, that someone opens in their browser, read-only. Cloak Proxy asks you to allow it first; secrets are always redacted, and the link expires (default 24 hours, at most 7 days). Returns the link to hand to you. Needs a Personal Cloud plan. Give one of `ids`, `query` or `file`.

**Makes changes.** Uploads the encrypted requests to Personal Cloud, so it's marked as reaching other hosts (`openWorldHint: true`).

| Argument | Type | Required | Description |
|---|---|---|---|
| `ids` | integer[] | No | Request ids to share |
| `query` | string | No | Or a typed query choosing the requests, for example `host:api.example.com status:>=500` |
| `file` | string | No | Or the path of a saved Cloak Proxy session (`.cloaksession`, `.cloak`) or HAR file (`.har`) to share instead of captured requests |
| `name` | string | No | Shown to the viewer, for example `Checkout 500s in ShopApp 4.2` |
| `expires` | string | No | `1h`, `24h` (default) or `7d` |
| `max_views` | integer | No | Stop working after this many views (1, 5, 25 or 100; default unlimited) |
| `include_bodies` | boolean | No | Include request and response bodies (default true) |

### list_share_links

(added in Cloak Proxy 0.6.0)

Personal Cloud share links created on this Mac: name, status, expiry, views, views left, when each was last opened, and size. Not the links themselves, and not the list of opens.

**Read-only.** Does not change anything.

No arguments.

### revoke_share_link

(added in Cloak Proxy 0.6.0)

Revokes a share link: it stops working at once and its data is deleted from the server.

**Destructive.** Deletes something; clients that support it ask you to confirm.

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | string | Yes | The link's id, from `list_share_links` |

## Browser extension

(added in Cloak Proxy 0.4.1)

What the [browser extension](https://docs.subcloak.com/cloak-proxy/devices/browser-extension/) reported: which tab and script made a request, and console errors from your tabs. These need the app (or the Linux app). Pairing is done by you, in **Proxy › Browser Extension…**.

| Tool | Kind |
|---|---|
| [`browser_extension_status`](#browser_extension_status) (added in Cloak Proxy 0.4.1) | Read-only |
| [`get_browser_context`](#get_browser_context) (added in Cloak Proxy 0.4.1) | Read-only |
| [`list_browser_console`](#list_browser_console) (added in Cloak Proxy 0.4.1) | Read-only |

### browser_extension_status

(added in Cloak Proxy 0.4.1)

The browsers paired with Cloak Proxy through the browser extension, the tabs being recorded, and how many console errors were collected.

**Read-only.** Does not change anything.

No arguments.

(added in Cloak Proxy 0.5.0) From 0.5.0 the result also has `safari`, with `included` (whether this copy of Cloak Proxy contains the Safari extension) and `state` (`on`, `off`, `not-found` or `not-included`).

### get_browser_context

(added in Cloak Proxy 0.4.1)

Where a request came from in the browser: the tab's title and URL, the page and frame, and what started it (the script and line, and the JavaScript stack for tabs recorded in Chrome). `context` is null when the extension didn't report the request.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `id` | integer | Yes | The request's id |

### list_browser_console

(added in Cloak Proxy 0.4.1)

Console errors and warnings (uncaught exceptions, rejected promises, `console.error`) from browser tabs, newest last, with the tab, script, line and stack.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | No | How many of the newest (default 50, at most 500) |

## Scope and tokens

(added in Cloak Proxy 0.5.1)

The target [scope](https://docs.subcloak.com/cloak-proxy/security/scope/) and [tokens and sign-in](https://docs.subcloak.com/cloak-proxy/security/tokens-and-sign-in/). These need the app.

| Tool | Kind |
|---|---|
| [`scope_status`](#scope_status) | Read-only |
| [`update_scope`](#update_scope) | Makes changes; widening asks you |
| [`inspect_tokens`](#inspect_tokens) | Read-only |

### scope_status

(added in Cloak Proxy 0.5.1)

The target scope: the hosts and paths the user may test. Returns the active scope's include and exclude rules (scheme, host with wildcards, subdomains or an address range, port, path; excludes win), the other saved scopes, what happens to out-of-scope traffic (record, dontRecord, block) and whether replays and the Authorization Matrix are held to it (guardsTools). Pass check (URLs or hosts) to ask whether each is in scope and which rule decided. Tools that send traffic on their own (the fuzzer and scanner) only reach hosts in scope.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `check` | array of strings | No | URLs (https://api.example.com/v1/orders) or hosts (api.example.com:8443) to test against the active scope |

### update_scope

(added in Cloak Proxy 0.5.1)

Change the target scope. Narrowing applies at once: exclude, remove_rule or disable_rule on an include, create (inactive), rename, set_notes. Widening never applies by itself: include on the active scope, activate, deactivate, delete of the active scope, set_out_of_scope, guard_tools off, and turning an exclude off wait for the user to click Allow in Cloak Proxy's Scope window; the reply has waitingForUser while the question is open. value is a host (api.example.com, \*.example.com, .example.com for the name and its subdomains), a URL prefix (https://api.example.com/v1/), an address range (203.0.113.0/24) or re: and a host regex; rules takes several.

**Makes changes.** Marked destructive, so clients that support it ask you to confirm. Narrowing applies at once; anything that widens the scope waits for you to click **Allow** in Cloak Proxy.

| Argument | Type | Required | Description |
|---|---|---|---|
| `action` | string | Yes | What to do. One of: `create`, `include`, `exclude`, `remove_rule`, `enable_rule`, `disable_rule`, `activate`, `deactivate`, `rename`, `set_notes`, `delete`, `set_out_of_scope`, `guard_tools` |
| `name` | string | No | create/rename: the scope's name |
| `notes` | string | No | create/set_notes: engagement notes |
| `scope` | string | No | Scope name or id (default: the active one) |
| `value` | string | No | include/exclude: a host, URL prefix or address range; remove/enable/disable_rule: the rule's id or text; set_out_of_scope: record, dontRecord or block |
| `id` | string | No | A rule id from scope_status |
| `rules` | array of strings | No | include/exclude/create: several hosts or URL prefixes |
| `activate` | boolean | No | create: also make it the active scope (asks the user) |
| `on` | boolean | No | guard_tools: keep replays and the Authorization Matrix inside the scope |

### inspect_tokens

(added in Cloak Proxy 0.5.1)

Tokens and sign-in flows in the captured traffic, checked without sending anything. Tokens (JWTs and opaque bearer or session tokens): role (access, ID, refresh, session), decoded JWT header and claims, expiry (and time left), who issued it, a sent-to map (each host and place: header, cookie, query, body; in scope or not) and findings: alg none or no signature, a key in the header (jku, jwk, x5u), no or long expiry, accepted after expiry, an audience that doesn't name the receiving host, an issuer over HTTP, secrets or personal data in claims, tokens in URLs or over plain HTTP, sent to several sites. Sign-in flows (OAuth 2.0 and OpenID Connect): the authorization request, sign-in pages, the redirect back, the token request and user info as one timeline, with findings: no or changed state, no PKCE or plain PKCE, tokens issued without the verifier, the implicit flow and tokens in URLs, a code that worked twice, a refresh token that never rotates, OIDC without a nonce, the password grant, plain HTTP. Token values are masked. With id (a token or flow id) one item in full; a token's full Trace Value map with trace: true.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `trace` | boolean | No | With a token id: also trace it through every request (Trace Value) |
| `limit` | integer | No | Maximum items (default 50) |
| `id` | string | No | A token id (tok-…) or flow id (flow-…) for the full item |
| `section` | string | No | What to list (default summary). One of: `summary`, `tokens`, `flows`, `findings` |
| `in_scope` | boolean | No | Only requests in the active target scope |

## Request fuzzer

(added in Cloak Proxy 0.5.1)

Plan a [request fuzzer](https://docs.subcloak.com/cloak-proxy/security/request-fuzzer/) run. Running one sends traffic, so it stays with you: in the app, or with `cloakctl fuzz --confirm`.

| Tool | Kind |
|---|---|
| [`fuzz_preview`](#fuzz_preview) | Read-only |

### fuzz_preview

(added in Cloak Proxy 0.5.1)

Preview a request-fuzzer run without sending anything. Give a request with §-marked payload positions (first line "METHOD URL", then headers, a blank line, body; mark a value as id=§1§), an attack mode, payload lists, and the scope hosts. Returns how many requests the run would send, whether the target is in scope, and a sample of the first requests. Running a fuzz sends traffic, so it isn't an MCP tool — do it in the Mac app (Request Fuzzer, with a confirmation) or `cloakctl fuzz --confirm --scope HOST`.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `request` | string | Yes | The request with § payload positions, e.g. "GET http://localhost:8080/search?q=§§\nAccept: \*/\*\n\n" |
| `scope` | array of strings | No | Allowed hosts (exact or \*.wildcard), as the scope manager would hold. A host not in scope can't be fuzzed. |
| `mode` | string | No | Attack mode (default sniper). One of: `sniper`, `batteringRam`, `pitchfork`, `clusterBomb` |
| `payloads` | array of arrays | No | Payload lists: one list of strings per position for pitchfork/cluster-bomb; the first list is used for sniper and battering-ram. |

## AI security

(added in Cloak Proxy 0.5.1)

Prompt injection, MCP tool pinning and the AI Guard. See [AI security](https://docs.subcloak.com/cloak-proxy/security/ai-security/). These need the app. An assistant can't approve its own tools or loosen the guard: those requests wait for you.

| Tool | Kind |
|---|---|
| [`prompt_injection`](#prompt_injection) | Read-only |
| [`mcp_manifests`](#mcp_manifests) | Read-only |
| [`review_mcp_manifest`](#review_mcp_manifest) | Makes changes; approving asks you |
| [`ai_guard_log`](#ai_guard_log) | Read-only |
| [`configure_ai_guard`](#configure_ai_guard) | Makes changes; loosening asks you |

### prompt_injection

(added in Cloak Proxy 0.5.1)

Prompt-injection findings in captured traffic: tool results in model requests (OpenAI, Anthropic, Gemini, Ollama), tool descriptions, and what MCP servers returned (tool calls, resources, prompts, tools/list), that read like instructions to the model: "ignore previous instructions", fake system turns and chat-template tokens, asking to hide things from the user or send data somewhere, tool or shell directives, text hidden in Unicode tag characters, zero-width characters, base64 or HTML comments. Each finding has a severity, the signals with a plain explanation, the matched text and an excerpt, and for a tool result the earlier captured response it was fetched from (originId). Heuristic and observe-only.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `host` | string | No | Only this host (wildcards allowed) |
| `in_scope` | boolean | No | Only requests inside the active target scope (scope_status) |
| `include_history` | boolean | No | Also report results a request only carried again from earlier turns (default false: each is reported where it first entered the conversation) |
| `ids` | array of integers | No | Only these captured requests (model requests, MCP calls or any response) |
| `limit` | integer | No | Most findings to list (default 50) |
| `include_responses` | boolean | No | Also scan every text response, not just model requests and MCP results (default false) |
| `include_low` | boolean | No | Also report weak findings (default false) |
| `app` | string | No | Only this app's requests |

### mcp_manifests

(added in Cloak Proxy 0.5.1)

MCP servers' pinned tool manifests (seen in captured traffic or used from the API client): each server's status (pinned, changed: its tools/list differs from the pin and waits for review, rejected), fingerprint and tool count; tool descriptions that read like instructions (tool poisoning). With server: the pinned and pending tools, the diff (new and removed tools, changed descriptions with before and after, schema paths that changed) and the review history.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `server` | string | No | A server's URL or name, for its manifest and diff |

### review_mcp_manifest

(added in Cloak Proxy 0.5.1)

Review an MCP server's changed tools. reject keeps the pin (the new version stays marked rejected) and block answers its tool calls with a JSON-RPC error while its tools differ from the pin; both apply at once. approve never applies by itself: Cloak Proxy shows the diff on its AI Security page and waits for the user to click Allow (the reply has waitingForUser). unblock and forget (drop the pin, so the next tools/list is pinned unreviewed) ask the user the same way.

**Makes changes.** `reject` and `block` apply at once; `approve`, `unblock` and `forget` wait for you to click **Allow** in Cloak Proxy.

| Argument | Type | Required | Description |
|---|---|---|---|
| `server` | string | Yes | The server's URL or name (from mcp_manifests) |
| `action` | string | Yes | What to do; default follows the AI Security setting for blocking. One of: `approve`, `reject`, `block`, `unblock`, `default`, `forget` |

### ai_guard_log

(added in Cloak Proxy 0.5.1)

The AI Guard: what it found in prompts sent to model providers (captured traffic and the API client's AI requests): API keys and tokens, private keys, card numbers, email addresses, phone numbers, secret fields and custom patterns, masked, with where in the body and whether the request was warned about, redacted or blocked. Also lists the rules. Pass id to check one captured request, or text to try the rules on some text (nothing is sent or logged).

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `text` | string | No | Text to check against the rules (a dry run) |
| `limit` | integer | No | Most events (default 50) |
| `id` | integer | No | A captured request to check |
| `action` | string | No | Only events with this outcome. One of: `warn`, `redact`, `block` |

### configure_ai_guard

(added in Cloak Proxy 0.5.1)

Change AI Security settings: the AI Guard's action per detector (warn, redact or block) or its whole rule list, extra model-provider hosts, checking the API client, prompt-injection tagging, MCP manifest pinning and blocking changed servers. Stricter changes apply at once; anything less strict (turning a check off, a weaker action, values never to report) only asks the user in Cloak Proxy and waits for them (waitingForUser). Returns the settings.

**Makes changes.** Marked destructive, so clients that support it ask you to confirm. Stricter settings apply at once; anything less strict waits for you to click **Allow** in Cloak Proxy.

| Argument | Type | Required | Description |
|---|---|---|---|
| `manifest_pinning` | boolean | No | Pin MCP servers' tools/list |
| `injection_tagging` | boolean | No | Tag model requests carrying prompt injection |
| `enabled` | boolean | No | The AI Guard on or off |
| `notify_manifest_changes` | boolean | No | Notify when a server's tools change |
| `rules` | array of objects | No | The whole rule list: [\{detector, action, providers?: ["OpenAI", "api.anthropic.com"], pattern? (custom regex), label?, enabled?\}] |
| `allowed_values` | array of strings | No | Values never reported (a test account's email) |
| `actions` | object | No | Action by detector, e.g. \{"apiKeys": "block", "emailAddresses": "redact"\}. Detectors: apiKeys, privateKeys, cardNumbers, emailAddresses, phoneNumbers, secretFields, custom |
| `check_api_client` | boolean | No | Also check the API client's AI requests |
| `injection_minimum` | string | No | Lowest prompt-injection level tagged. One of: `low`, `medium`, `high` |
| `block_changed_mcp_servers` | boolean | No | Answer tool calls to servers whose tools changed with an error |
| `extra_hosts` | array of strings | No | Hosts to treat as model providers, e.g. an internal LLM gateway |

## Findings and reports

(added in Cloak Proxy 0.5.1)

The engagement open in **Tools › Findings**. See [Findings and reports](https://docs.subcloak.com/cloak-proxy/security/findings/). Evidence from requests outside the [assistant scope](https://docs.subcloak.com/cloak-proxy/automation/assistant-scope/) is withheld.

| Tool | Kind |
|---|---|
| [`list_findings`](#list_findings) | Read-only |
| [`add_finding`](#add_finding) | Makes changes; you check and add it |
| [`export_findings_report`](#export_findings_report) | Makes changes |

### list_findings

(added in Cloak Proxy 0.5.1)

The security findings of the engagement open in Cloak Proxy (Tools › Findings): each finding's id (F-001), title, severity, status, CVSS score, affected endpoints, references and evidence count, worst first. Pass id for one finding in full (description, impact, remediation, steps, evidence; include_evidence adds the redacted request and response). Filter by minimum severity, status or text; format markdown returns the report as Markdown. Evidence from requests outside the assistant scope is withheld.

**Read-only.** Does not change anything.

| Argument | Type | Required | Description |
|---|---|---|---|
| `severity` | string | No | Only this severity and worse. One of: `critical`, `high`, `medium`, `low`, `info` |
| `id` | string | No | One finding: F-001, its number, or its UUID |
| `status` | string | No | Only this status. One of: `draft`, `open`, `fixed`, `acceptedRisk`, `falsePositive` |
| `include_evidence` | boolean | No | With id: include each evidence's redacted request and response |
| `format` | string | No | json (default) or markdown (the whole report). One of: `json`, `markdown` |
| `search` | string | No | Title, description, endpoint or reference contains this |
| `engagement` | string | No | Read this engagement folder instead of the one open in the app |

### add_finding

(added in Cloak Proxy 0.5.1)

Propose a security finding for the open engagement, with captured requests as evidence (redacted: tokens, cookies, keys and card numbers removed). It never saves by itself: Cloak Proxy shows the Add Finding sheet filled in and the user checks it and clicks Add (the reply has waitingForUser; check list_findings afterwards). Without the app's window (the Linux engine) it's saved as a Draft that stays out of reports until reviewed. Pass finding to add the requests as evidence to an existing finding instead. Only report issues on systems you're allowed to test.

**Makes changes.** Marked destructive, so clients that support it ask you to confirm. Nothing is saved until you click **Add Finding** in Cloak Proxy.

| Argument | Type | Required | Description |
|---|---|---|---|
| `finding` | string | No | Add the requests as evidence to this finding (F-002) instead of proposing a new one |
| `references` | array of strings | No | CWE-639, API1:2023, A01:2021, LLM01:2025 or URLs |
| `description` | string | No | What's wrong (Markdown) |
| `cvss` | string | No | A CVSS 3.1 or 4.0 vector, e.g. CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| `title` | string | No | Short and specific, e.g. "Orders readable by other users" |
| `impact` | string | No | What an attacker can do (Markdown) |
| `ids` | array of integers | No | Captured requests to attach as evidence |
| `remediation` | string | No | How to fix it (Markdown) |
| `severity` | string | No | Default medium, or the CVSS rating when cvss is given. One of: `critical`, `high`, `medium`, `low`, `info` |
| `redact` | boolean | No | Redact the evidence (default true) |
| `endpoints` | array of strings | No | Affected endpoints, e.g. "GET api.example.com/v1/orders/\{id\}" (default: from ids) |
| `evidence_note` | string | No | What the requests show |
| `status` | string | No | Default open. One of: `draft`, `open`, `fixed`, `acceptedRisk`, `falsePositive` |
| `reproduction` | string | No | Steps to reproduce (Markdown) |

### export_findings_report

(added in Cloak Proxy 0.5.1)

Write the open engagement's report to a file: PDF or HTML (cover, executive summary, scope, findings table, each finding with its redacted evidence, appendix), Markdown, JSON for tooling (re-importable), SARIF 2.1.0, or Burp Suite issue XML (burp) for SysReptor, Dradis and DefectDojo. Drafts and false positives are left out unless include_drafts. Returns the path.

**Makes changes.** Writes a file.

| Argument | Type | Required | Description |
|---|---|---|---|
| `format` | string | No | File format (default markdown). One of: `markdown`, `html`, `pdf`, `json`, `sarif`, `burp` |
| `path` | string | No | File or folder to write (default ~/Downloads) |
| `engagement` | string | No | Read this engagement folder instead of the one open in the app |
| `include_drafts` | boolean | No | Include draft findings |

## Resources

Resources are read-only context an assistant can attach. Clients list them with `resources/list` and `resources/templates/list`.

| URI | Name | Type | Contents |
|---|---|---|---|
| `cloak://status` | `status` | `application/json` | Port, recording, macOS capture and active tools (the same as `proxy_status`). |
| `cloak://assistant-scope` (added in Cloak Proxy 0.5.1) | `assistant-scope` | `application/json` | What the [assistant scope](https://docs.subcloak.com/cloak-proxy/automation/assistant-scope/) lets the assistant see (the same as `assistant_scope_status`). |
| `cloak://requests/recent` | `recent-requests` | `application/json` | The last 100 captured requests. |
| `cloak://insights/report` | `insights` | `text/markdown` | The Insights report: endpoints, errors, security, secrets and schema changes. |
| `cloak://rules` | `rules` | `application/json` | Every debugging tool and its rules (the same as `list_rules`). |
| `cloak://collections` | `collections` | `text/plain` | API client collections, requests and environments (the same as `list_collections`). |
| `cloak://requests/{id}` | `request` | `application/json` | A template: headers and bodies of one captured request (the same as `get_request`). |

## Prompts

Prompts are ready-made tasks. Clients list them with `prompts/list`; many show them as slash commands.

| Prompt | Title | Arguments | What it asks the assistant to do |
|---|---|---|---|
| `debug_request` | Debug a failing request | `id` (required): captured request id | Call `get_request`, look at the status, headers and body, compare with a similar successful request (`list_requests`, `compare_requests`), explain the cause and the fix, and try the fix with `edit_and_replay` if useful. |
| `mock_endpoint` | Mock an endpoint | `id` (required): captured request id; `change` (optional): how the mocked response should differ | Call `rule_from_request` with tool `mapLocal`, change the response with `upsert_rule`, and confirm by replaying the request. |
| `write_tests` | Write tests for a saved request | `collection` (required), `request` (required) | Read the request with `get_saved_request`, run it with `run_saved_request`, write `pm.test` assertions for status, timing and important body fields, save them with `update_request`, run again and report. |
| `security_review` | Security review of captured traffic | None | Call `insights` for secrets and security, then explain each finding (masked values only), how serious it is, and how to fix it. |
| `app_traffic_summary` | What is this app doing? | `app` (required): app name | List the app's requests, group them by host and endpoint, note errors, slow calls and anything sensitive, and check `bypassing_apps` if traffic seems missing. |
| `setup_capture` (added in Cloak Proxy 0.4.0) | Set up capture | `target` (required): what to capture; `app` (optional) | Call `capture_setup`, do each `todo` step with `apply` after saying what changes, give exact instructions for `needs_user` steps, repeat until ready, then check `list_requests` and call `diagnose_capture` if nothing arrives. |

## Related

  - [MCP server](https://docs.subcloak.com/cloak-proxy/automation/mcp-server/): Connect Claude Code, Claude Desktop, Cursor or VS Code.
  - [Control API](https://docs.subcloak.com/cloak-proxy/automation/control-api/): The local API behind the proxy tools, with every RPC method.
  - [Debug with Claude](https://docs.subcloak.com/cloak-proxy/guides/debug-with-claude/): Put the tools to work on a real bug.
  - [Rules and matching](https://docs.subcloak.com/cloak-proxy/tools/rules-and-matching/): What the fields of a debugging-tool rule mean.
