Skip to main content
Connecting an agent to Mirador means giving it two things: the API contract (via llms.txt) and credentials (a server key). This page shows the setup for the common shapes of agent.
A server key grants read access to every trace in its project. Only hand it to agents you run and trust, keep it in an environment variable rather than pasted into a prompt, and create a dedicated key per agent so you can revoke one without breaking the others.

Claude Code

The fastest way to try this interactively. Export your key, then tell Claude Code where the API brief lives:
Claude Code fetches the brief, composes the right curl requests, and walks the investigation loop on its own — comparing counts across windows, slicing by tags and attributes, and pulling event timelines for the traces that matter.
Doing this often? Add the instructions to your project’s CLAUDE.md (or a custom slash command) so every session already knows how to reach Mirador:

A custom agent (Claude API)

For a programmatic agent — an incident bot, a scheduled report, a Slack assistant — put the brief in the system prompt and give the model one HTTP tool. The brief is small enough to include wholesale, and because it requires no key you can fetch it at startup so it’s always current:
Your tool handler is a few lines — attach the key server-side so it never enters the model’s context:
Run the standard tool-use loop (call → execute → return result → repeat) until the model produces its answer. Error responses use a typed envelope — pass them back to the model verbatim; the brief teaches it to correct an INVALID_FILTER and retry.
Constrain the tool to GET and to the https://api.mirador.org origin, as above. The API itself is read-only, but a narrow tool keeps the agent from being repurposed to call anything else with your credentials.

Triggered investigations (webhooks + AI)

Combine automations with an agent to investigate before a human arrives: when a rule fires, your webhook consumer fetches the matched trace and asks the agent to analyze it, then posts the summary to your incident channel or ticket. This is the trace export recipe with one extra step — instead of attaching raw JSON to the ticket, hand the exported trace to the agent:
For a single already-exported trace the agent doesn’t even need API access — the JSON is the evidence. Give it API access as well (previous section) and it can widen the investigation: “is this trace an isolated failure or part of a pattern?”

Prompting tips

Whatever the agent, the same briefing habits produce grounded answers:
  • Name the time window. “The past 24 hours” beats “recently” — the agent turns it into concrete since/until bounds and a matching baseline window.
  • Ask for evidence. “Cite the trace_ids behind each finding” keeps conclusions tied to real traces you can open in the dashboard.
  • Point at metadata first. “Discover the project’s tags and attributes before filtering” stops the agent from inventing field names.
  • Let counts lead. Encourage comparing pagination.total across slices before fetching event timelines — it’s the difference between a handful of requests and hundreds.

Next Steps

Worked investigation

See the full error-spike investigation, request by request

Endpoints

The filter grammar and response shapes agents rely on