Skip to content
Docs menu · AI agents

AI agents

New in 1.1

MCP tools

On this page

ReqRes has 33 MCP tools: 18 read tools and 15 change tools.

Filters shared by several tools

list_sessions, wait_for_session, wait_for_sessions and list_destinations take the same filters. Every filter is optional.

FilterMatches
hostPart of the host name, in any case
methodThe HTTP method, such as GET
statusA status code such as 404, or a class such as 5xx
schemehttp or https
url_containsPart of the full URL, in any case
appPart of the app or process name, in any case. claude matches both the Claude app and the claude command-line tool. Requests ReqRes could not attribute to an app are left out.
pidThe exact process id. Use it to tell apart several copies of one tool.
countryA 2-letter ISO country code such as US, or local (private network), mac (this Mac) or unknown
outcomeHow the request ended: completed, failed (no response), aborted (cut off by the app, the server or a breakpoint) or timed_out (closed by ReqRes's idle limit)
grpcThe call's own status on gRPC-Web, Connect and native gRPC rows: error (anything but OK), ok, a status name such as NOT_FOUND, or a number. Other rows match none.
protoWhat the row spoke: h1, h2, ws or relay. http2, websocket and tcp work too.

The country comes from an offline lookup of the server's address, at country level. See See where requests go.

What a row says

list_sessions returns one short row per request. Tokens in the row say what the request spoke and how far it got:

  • Protocol. Each request row carries proto=h1, proto=h2 or proto=ws. HTTP/2 rows appear only with Capture HTTP/2 (beta) on. See Capture HTTP/2 and gRPC.
  • RPC status. A gRPC-Web, Connect or native gRPC call carries grpc= with its status. A gRPC-Web error arrives as HTTP 200, so grpc=NOT_FOUND next to 200 is the failure.
  • Relayed connections. A connection ReqRes did not decrypt is one kind=relay row: the endpoint, the bytes each way and how long it was open. It has no method, status, headers or body. HTTPS is relayed until the ReqRes CA is installed and trusted.
  • Failed requests. A request that did not complete is still a row, marked outcome=failed, aborted or timed_out, with the phase it broke in: dns, connect, tlsUpstream (the server's certificate), tlsClient (the app refused ReqRes's certificate), request or response. cancelled_by_app marks a request the app gave up on. See See why a request failed.
  • Live rows. A request still open is listed as IN_FLIGHT waiting (no response yet) or IN_FLIGHT streaming (bytes so far). When it finishes, the finished row replaces it under the same uid. ENDED_WITHOUT_FINAL_ROW marks one whose end was never recorded, for example because capture stopped.
  • WebSockets. A WebSocket connection is its 101 Switching Protocols row. list_messages reads its messages.

What the Delivery line says

While capture is on, capture_status has a Delivery: line, and diagnose_setup a Delivery to ReqRes check. They say whether what capture records reaches the copy of ReqRes the agent is talking to. Requests already in the list stay there, whatever the line says.

The line starts withMeaning
"Delivery: requests reach ReqRes"New requests reach ReqRes. For 5 minutes after ReqRes reconnects to a capture that kept running, the line also says how many requests were captured while ReqRes was not receiving them, and how many earlier ones, if any, were not kept.
"Delivery: reconnecting to the running capture"Capture kept running while ReqRes was not receiving it, for example while ReqRes was closed after a crash or a Force Quit. The extension reconnects by itself, usually within a few seconds, and delivers the most recent of what it captured meanwhile. Ask again in a moment.
"Delivery: the extension has not connected to ReqRes yet"The first moments of a start, or the seconds before ReqRes restarts a capture that cannot reconnect. Ask again in a moment.
"Delivery: NOT reaching ReqRes"No new request reaches ReqRes until capture starts again from ReqRes. The line says why.
"Delivery: another copy of ReqRes holds this capture's connection"Another copy of ReqRes is running and holds the capture, so the copy the agent is talking to receives nothing new.

If the extension cannot reconnect within a few seconds, for example because capture was started from System Settings or by an earlier ReqRes build, ReqRes restarts capture once by itself. It does not restart a capture it started itself that never connected, and it does not restart after you or an agent asked for a start or a stop.

When the line says "NOT reaching ReqRes", ask the user to click Restart Capture in the traffic list or the menu bar menu, or call stop_capture and then start_capture. Each asks for approval first, unless the user allowed agent changes.

While the line reads reconnecting, not connected yet or "NOT reaching ReqRes", breakpoints hold nothing: a request that matches one goes through, because nobody could answer it. A request held before ReqRes went away is listed again once ReqRes reconnects, with what is left of its 60 seconds.

Read tools (18)

Read tools never ask for approval. ReqRes redacts credential-shaped values in everything they return, except for hosts you send unmasked. See Control what agents see.

ToolWhat it doesArguments and limits
capture_statusReports whether capture is running, starting or stopping, whether setup is finished, the proxy address, whether the ReqRes CA is installed and trusted, how many requests this run holds, whether new requests reach ReqRes while capture runs (see What the Delivery line says), and the ReqRes version. Then lists each protocol with its status: supported, beta, relayed or not_captured. Call it first.None
list_sessionsLists captured requests, newest first, one short row each.Filters. limit: default 30, max 100. cursor for the next page.
get_sessionReturns one request in full: HTTP version, headers, trailers, timings, whether it reused a connection, and body previews. A request that did not complete has an Outcome line with the cause.uid. view, from and limit: see get_session views. Each body preview stops at 10,240 bytes and ends with a truncation marker.
query_session_bodyDescribes the structure of a JSON body, or returns one value from it, without returning the whole body. Says when ReqRes kept only part of the body. Refuses a request still in flight with in_flight.uid. side: request or response (default). mode: structure (default) or path. path, such as data.items[0].id.
wait_for_sessionWaits for the next matching request, then returns it. Requests captured before the call are ignored. So are failed, aborted and timed-out requests, unless include_failed is true or outcome names one. With until set to headers or first_message, it can return a request still in flight.Filters. until: complete (default), headers (the response status and headers arrived) or first_message (the first complete event of an SSE or NDJSON stream arrived). timeout_seconds: default 30, max 300. include_failed: default false.
wait_for_sessionsWaits for several matching requests and returns them in order. After the first match, stops early when no new match arrives for settle_seconds. Skips failed requests like wait_for_session.Filters. max_count: default 20, max 50. timeout_seconds: default 30, max 300. settle_seconds: default 2. include_failed: default false.
diff_sessionsCompares 2 requests and returns only the differences: status, method, query parameters, headers, and JSON bodies by key path.uid_a, uid_b
list_messagesLists the messages of one WebSocket connection, oldest first: direction, opcode, milliseconds after the upgrade, size and payload. Says first whether the connection is open, how it closed, and how many messages ReqRes did not keep.uid of the 101 row. direction: sent or received. opcode: text, binary, ping, pong or close. contains: part of the payload, in any case, matched after redaction. cursor. limit: default 50, max 200.
wait_for_messageWaits for the next matching WebSocket message, then returns it. Messages captured before the call are ignored.uid for one connection, or host (part of the host name, in any case) for any connection to a matching host. direction, opcode, contains. timeout_seconds: default 30, max 300.
list_destinationsGroups captured requests by destination country, plus mac, local and unknown. Shows requests, bytes, how many hosts and apps, and the top 3 hosts for each. Requests that failed before connecting are left out and counted.Filters. With country, lists up to 20 hosts and 10 apps for that destination.
list_hostsLists host filters with their ids.None
list_rulesLists rules with their ids, host filter, mode, pattern and response: the status the response gets, → server's status for a rule that keeps the server's, or a map_local rule's file. A credential-named value in a path comes back as REDACTED, unless it is a pattern such as *.host_id, optional
test_patternChecks a rule pattern against a URL without creating anything, and shows the pattern ReqRes compiles. Refuses a path that holds a redaction mask.path, url. match_type: wildcard (default) or regex.
diagnose_setupRuns the setup checks in order and names the first thing to fix. The checks include the proxy port, whether captured requests reach ReqRes, apps that refused ReqRes's certificate, HTTP/2 capture, which kinds of client are captured, and the protocols this version captures.None
capture_environmentPrints the shell lines that send a command-line tool through ReqRes, at the configured proxy port. Each proxy variable is set in both spellings, such as HTTP_PROXY and http_proxy, because curl and git take the proxy for plain http:// only from http_proxy. NO_PROXY and no_proxy skip localhost, 127.0.0.1 and ::1. The lines carry no comments, so hand them over exactly as printed.None
list_saved_sessionsLists saved sessions, newest first, with their ids and notes.limit: default 30, max 100.
get_saved_sessionReturns one saved session: headers, timings and body previews, capped like get_session. A saved stream comes back as its whole body, redacted event by event, with no events or assembled view.id from list_saved_sessions
list_paused_requestsLists held requests with the seconds each has left, and says whether any breakpoint is on. Each request's body: line says what its headers declare, such as body: empty (Content-Length: 0) or a size from its Content-Length. The body itself is never shown, to the agent or to you.None

diagnose_setup runs the same checks as Capture ▸ Diagnose Setup…. See Run Diagnose Setup. capture_environment warns first when capture is stopped, and names the certificate step when the ReqRes CA is not installed. See Capture command-line tools and agents.

list_messages and wait_for_message read what ReqRes kept: the first 200 and the last 2,000 messages of a connection, and the first 64 KB of each message. An agent reads up to 4,096 bytes of each payload. See Read WebSocket messages.

get_session views

The view argument chooses what get_session returns.

viewReturns
detail (default)Headers, trailers, timings and body previews. A request still in flight shows no body until it finishes. ReqRes keeps up to 16 MB of body per request, request and response together. A body kept in part says how many bytes are missing.
eventsThe numbered events of an SSE or NDJSON response, a page at a time. limit: default 50, max 200.
assembledAn Anthropic Messages, OpenAI Chat Completions or OpenAI Responses stream put back together: text, tool calls with their arguments, stop reason, token usage, model and any error event.
rpcA gRPC-Web, Connect or native gRPC call: the service and method, each message decoded without the .proto file, and the call's status with where it came from. limit: default 20, max 100.
  • from starts a page: an event number for events, or a message position for rpc, requests first. Take nextFrom from the previous page.
  • events and assembled show only complete events. An incomplete event at the end is withheld as "N bytes pending".
  • events and assembled read the current capture run only.

See Read streaming responses.

Change tools (15)

Each change tool asks you first, unless you allowed agent changes. exclude_host and replay_request ask every time. answer_paused_request never asks per call: the Let agents answer held requests switch controls it. See Approve agent changes.

ToolWhat it doesArguments and limitsKind of change
add_hostAdds a host filter.host: a bare host name, with no scheme, port or path. scheme: https (default) or http. port, optional. The free version allows 2 host filters.Changes what ReqRes watches
remove_hostRemoves a host filter and the rules under it.id from list_hostsDeletes data
create_ruleCreates a rule.Required: host_id, mode (override, extend or map_local), path. Optional: match_type (wildcard default, or regex), method (omit for any method, the default, or GET, POST, PUT, PATCH or DELETE), scheme (https default, or http; recorded, but matching ignores it), request_headers, response_status (200 to 599; its default depends on the mode, see Status and headers of a rule), response_headers, response_body, local_file, enabled (default true). The free version allows 1 rule.Rewrites live traffic
update_ruleChanges only the fields you give, except that a map_local rule made extend or override takes that mode's status unless you send one. Set enabled to false to turn a rule off without deleting it.id, plus any create_rule field except host_id. Leave path out to keep the rule's own. method: any or an empty string for any method. A headers object replaces the existing headers, and {} removes them.Rewrites live traffic
delete_ruleDeletes a rule.id from list_rulesDeletes data
mock_from_sessionTurns a captured response into a rule that answers the app without contacting the server, with an optional new status, body or headers. The rule matches the captured method, and the captured path and query unless you give path. A text response is replayed as UTF-8, and the copied Content-Type says so. Adds a host filter for the host when there is none, which counts toward the 2 free host filters.uid. response_status: 200 to 599, needed when the captured status is outside that range, such as a WebSocket's 101. response_body, response_headers (merged over the captured headers). mode: override (default) or map_local, which answers 200; extend is not accepted. path, match_type.Rewrites live traffic
exclude_hostAdds a host to Settings ▸ Capture ▸ Excluded from interception. ReqRes passes connections opened from then on through untouched and records none of them, so new requests to the host no longer appear in the traffic list, for you or the agent. Rows already captured stay. See Pass a host through untouched. A host already on the list changes nothing and asks no one.host: a bare host name, or *.example.com for its subdomains but not example.com itself. No scheme, port or path.Rewrites live traffic
start_captureStarts capture. Setup must be finished. Replies "starting" until the tunnel connects.NoneChanges what ReqRes watches
stop_captureStops capture. Captured requests stay in the list.NoneChanges what ReqRes watches
clear_sessionsRemoves all captured requests from the current run.NoneDeletes data
export_sessionsWrites requests to a HAR 1.2 file, with values redacted, and returns its path. Requests still in flight are left out, and the result says how many.uids: up to 100. filename: a bare name of up to 80 characters; ReqRes adds .har. A file stops at about 20 MB, and later requests are left out.Writes captured traffic to a file
replay_requestSends a captured request again and returns the new response, redacted. The result says which route it took.uid. method: GET, HEAD or OPTIONS only. url: same scheme, host and port; change the path and query. headers, remove_headers: up to 32 header changes. Times out after 12 s.Sends a real request to another server
save_sessionKeeps a captured request after the run ends, and returns its saved id. Refuses a request still in flight.uid. note: up to 280 characters, shown next to it in ReqRes.Writes captured traffic to a file
delete_saved_sessionDeletes a saved session. It cannot be recovered.id from list_saved_sessionsDeletes data
answer_paused_requestResumes or aborts a held request. The reply names the request with its URL redacted.id. action: resume or abort. set_headers, remove_headers: never Content-Length or Transfer-Encoding. body: up to 256 KB, sent in place of the original, none of which reaches the server; refused for a TRACE. Without body, the original body goes on unchanged, except for a TRACE that arrives with a body of its own, which ReqRes answers 502 over HTTP/1.1, as its body: line says. Abort that one instead. abort_status: 400 to 599, default 409.Rewrites live traffic

Limits that apply to several change tools:

  • Rules need capture. A rule created while capture is stopped does nothing until capture starts. The tool result says so.
  • Patterns cover the path and the query. /search does not match /search?q=x; write /search*. A regex starts with /, never with ^. See Write a URL pattern that matches.
  • Mocks answer without the server. An override with a response_body, or a map_local file ReqRes can read, answers the app and never contacts the server. An override without a body sends the app's request to the server, and replaces the status and headers of the real answer. A map_local file that is missing or unreadable also sends the request on, and the server's response comes back unchanged.
  • Some captures cannot be mocked. mock_from_session refuses a request still in flight. Without a response_body, it also refuses a response with no body, a body ReqRes kept only in part, a body under an encoding ReqRes did not decode, and, in override mode, a binary body, which needs map_local. Without a response_status, an override mock also refuses a captured status outside 200 to 599, such as a WebSocket's 101.
  • Exports go to one folder. export_sessions writes to MCP Exports in ReqRes's Application Support folder. The agent names the file, not the folder. See Review and undo agent changes.
  • Replay repeats only safe methods. A request captured as POST, PUT, PATCH or DELETE is refused, even when the agent asks for GET.
  • Replay sends real credentials. The request goes out with the captured headers.
  • Replay follows capture. With capture on, the replay goes through ReqRes. Your rules apply and it appears in the traffic list only when the host is not excluded and, for HTTPS, the ReqRes CA is installed and trusted. Otherwise ReqRes relays it untouched: the real server answers and no rule applies. An HTTPS replay without a trusted CA leaves one kind=relay row, and a replay to an excluded host leaves none. With capture off, it goes straight to the server.
  • A busy port stops capture. If another program holds the proxy port, start_capture does not start capture, and ReqRes offers another port in its window. See Change the proxy port.
  • Held requests need a switch. answer_paused_request works only while Settings ▸ Breakpoints ▸ Let agents answer held requests is on. It is off by default. See Hold a request with a breakpoint.
  • Rule paths come back masked. list_rules and the rule a change tool returns show a credential-named value in the path as REDACTED. The stored rule keeps the real value and matches on it. A path sent back to update_rule exactly as shown keeps the stored one, and a path holding the mask any other way is refused. See Control what agents see.

Status and headers of a rule

  • An extend rule keeps the server's status. It sends the request to the server and changes only what it names in the response. A response_status from 200 to 599 answers in place of the server's, a 404 or a 500 included. Left out, or 0, the server's status stays.
  • An override answers with its own status. It is 200 when response_status is left out. 0 is refused.
  • A map_local rule uses no status. Its file answers 200. When the file is missing, the server's response comes back unchanged.
  • Only an override gets a Content-Type by default. When its response_headers name none, a new override is given Content-Type: application/json; charset=utf-8, because its response carries only the rule's headers. An extend or map_local rule gets no response headers unless you give them, so the server's Content-Type, or the file's, stands.
  • A change of mode keeps the status and the response headers. update_rule keeps both unless you send new ones. An override made extend keeps its status, such as 200, in place of the server's, so send response_status 0 with the change to keep the server's. An extend rule that keeps the server's status needs a response_status to become an override. A map_local rule has no status of its own, so one made extend or override without a response_status takes the status a new rule in that mode starts with: 200 for an override, the server's for an extend rule. A rule made an override keeps its stored response headers as well, so it answers with no Content-Type unless they name one. Send response_headers with the change. The approval panel says what the rule keeps.
  • A rule never sets a request's Content-Length or Transfer-Encoding. request_headers are set over the app's own headers, except these 2, which describe the app's body and stay as the app sent them.
  • A rule from before ReqRes 1.1 can still answer 200. Rules saved before ReqRes 1.1 can carry status 200 and the JSON Content-Type in every mode. At its first launch, ReqRes 1.1 reset each extend rule that sets a request header and still had that untouched response: status 200, that Content-Type alone and no body. Such a rule now keeps the server's status and headers. ReqRes 1.1 also removed that Content-Type from each map_local rule whose only response header it was. Other rules keep what they saved, so an older extend rule can still answer 200 in place of the server's status. list_rules shows each rule's status.

Errors

When ReqRes refuses a call, the agent receives the HTTP status, an error code and a message.

CodeStatusMeaning
consent_denied403You clicked Deny, or agents may not answer held requests. If the MCP server is turned off while a change waits, the agent gets a connection error instead, and the activity log shows the change as denied.
consent_timeout408Nobody answered the approval panel within 45 s. Nothing changed.
limit_reached403The free limit of 2 host filters or 1 rule is reached.
not_found404No request, rule, host filter, saved session or held request has that id. A held request's id stops working when its countdown ends. A kind=relay row has no body, stream or RPC to read.
in_flight409The request has not finished, so query_session_body and the rpc view cannot read it yet.
not_a_stream400The events or assembled view was asked for a response that is not SSE or NDJSON.
not_an_rpc400The rpc view was asked for a request that is not a gRPC, gRPC-Web or Connect call.
not_a_websocket400list_messages was given a uid that is not a WebSocket's 101 row.
bad_request400An argument is missing or not valid. The message says what to send.
unavailable503Capture cannot start or stop yet, because setup is not finished or capture is still changing state. ReqRes also returns it when this build lacks the feature. start_capture also gets it when another copy of ReqRes, or another program, holds 127.0.0.1:50001, where the extension delivers what it captures. The message says which.
internal_error500ReqRes could not make the change.

For errors before a call reaches ReqRes, such as "Cannot reach ReqRes", see Fix agent errors, missing agent traffic and the App column.