Example flows
Worked examples of how an AI agent investigates problems with the inspector.rest MCP tools: summarize, list, request, body.
These flows show the calls an agent makes. The arguments are exactly what is sent in a tools/call request. The agent decides each next call from the result of the previous one; the results are not repeated here (see the tool reference for result shapes).
Why are payments failing?
Payments started failing about an hour ago. What is going on?
1. List environments
The agent finds the environment it should look at and sees that production is the busiest one.
{"name":"list_environments","arguments":{}}2. Summarize requests
Errors are concentrated on one host: api.stripe.com returns 5xx. One compact table answers this without listing a single request.
{
"name": "summarize_requests",
"arguments": {
"environment": "acme/billing/production",
"since": "3h",
"group_by": ["host","status_class"],
"metrics": ["count","error_rate","p95"]
}
}3. Summarize requests
A time series shows that the 5xx started at 08:35 and has not stopped.
{
"name": "summarize_requests",
"arguments": {
"environment": "acme/billing/production",
"since": "3h",
"host": ["api.stripe.com"],
"group_by": ["time:5m","status_class"]
}
}4. List requests
Five failing calls with their request ids, attempts and the tenant label.
{
"name": "list_requests",
"arguments": {
"environment": "acme/billing/production",
"since": "1h",
"host": ["api.stripe.com"],
"status_class": ["5xx"],
"limit": 5,
"label_keys": ["tenant"]
}
}5. Get request
Three attempts, all 503, with a retry-after header.
{
"name": "get_request",
"arguments": {
"environment": "acme/billing/production",
"request_id": "req_01JC4M8Q2Z7XW",
"include": ["response_headers"],
"header_names": ["retry-after"]
}
}6. Describe body
A small JSON body with an error object.
{
"name": "describe_body",
"arguments": {
"environment": "acme/billing/production",
"request_id": "req_01JC4M8Q2Z7XW",
"which": "response"
}
}7. Read body
The error message names the cause. The agent now has what it needs and has read a few hundred bytes of the body.
{
"name": "read_body",
"arguments": {
"environment": "acme/billing/production",
"request_id": "req_01JC4M8Q2Z7XW",
"which": "response",
"json_path": "$.error"
}
}Outcome: Seven calls, a few kilobytes in the agent’s context, and the cause: the payment provider is returning 503 with an upstream timeout.
Why did this call fail when a similar one worked?
Request req_01JC4M8Q2Z7XW failed but the same call for another customer worked. What is different?
1. List requests
The agent finds a successful call of the same endpoint.
{
"name": "list_requests",
"arguments": {
"environment": "acme/billing/production",
"path_template": ["/v1/payment_intents"],
"labels": ["tenant:t_4821"],
"status_class": ["2xx"],
"limit": 1
}
}2. Compare requests
Only the differences come back: a missing header and a different JSON path in the responses.
{
"name": "compare_requests",
"arguments": {
"environment": "acme/billing/production",
"a": "req_01JC4M8Q2Z7XW",
"b": "req_01JC4M2D5N8PA",
"parts": ["headers","body"]
}
}Outcome: Two calls instead of two full request dumps.
Find a request by something in its body
A customer reports a problem with order ord_58213. Which call was it?
1. Search bodies
Full-text search over request bodies returns the matching request ids and a snippet around each match.
{
"name": "search_bodies",
"arguments": {
"environment": "acme/billing/production",
"text": "ord_58213",
"since": "7d",
"in": "request",
"limit": 5
}
}2. Get request
The agent opens the matching request and sees how large the bodies are before reading anything.
{
"name": "get_request",
"arguments": {
"environment": "acme/billing/production",
"request_id": "req_01JC4M8Q2Z7XW",
"include": ["error_stack","body_meta"]
}
}Outcome: The request is found without knowing its time, path or status.