How do I ask Claude Code to investigate high latency with Tares?
Tares lets Claude Code investigate high latency once you connect it over MCP and ask what happened to the slow service in the last 15 minutes. Claude Code calls the read tool and answers from one correlated, time-ordered timeline of logs, metrics, alerts and findings for that service. You can also ask without any alert having fired, because the agent pulls the evidence on demand.
How it works
Tares exposes an MCP endpoint, and Claude Code discovers the Tares tools when it connects. The tool that matters for a latency question is read. It returns a correlated, time-ordered timeline across all sources that match a label selector, so a service label such as service pulls the metrics, request logs, alerts and findings for that service onto one clock.
This is the pull side of an AI SRE. You ask, the agent reads, and the answer comes from the same evidence a trigger-woken agent would see. The AI SRE guide covers the push side, where a trigger wakes an agent for you.
Where the endpoint lives depends on where Tares runs:
- Your machine (
tares up):http://localhost:8788/mcp, after you start the MCP server as a second process. - Your own server:
https://<your-domain>/mcp. - Tares Cloud: shown in your console under Connect.
Two things make the read useful for latency. Your metrics and logs sources must carry the same service label, so they merge into one timeline per service. If your Prometheus rules include a latency alert and you ingest it, the alert lands on that same timeline next to the metrics and logs. Findings that agents recorded earlier appear there too, so Claude Code starts from the previous conclusion instead of from scratch.
Set it up
- Start Tares and, in a second terminal, the MCP endpoint. The daemon alone does not serve
/mcp. On a server or Tares Cloud instance the MCP server already runs, so skip this step.
tares up
tares mcp- Connect Claude Code. The Tares plugin is the default path. Run
/plugin marketplace add glassflow/tares, then/plugin install tares@tares. The install prompts for the MCP endpoint, an optional auth token and a session-capture toggle. If you want to connect without capturing sessions, add the server from your terminal instead:
claude mcp add --transport http tares http://localhost:8788/mcp- On a secured instance, which is every server and Tares Cloud instance, pass a read-scoped API key as a Bearer header:
claude mcp add --transport http tares https://<your-host>/mcp \
--header "Authorization: Bearer <api-key>"- Verify the connection by asking Claude Code:
Use tares: what are you ingesting right now?
Claude Code should call catalog_list and list your sources, triggers and projects. In the console, the Reads view shows each read as it happens, tagged client = mcp.
- Ask the latency question. Name the service and the window:
Use tares: what happened to api-server in the last 15 minutes? Is latency up, and what changed around the same time?
Claude Code calls read with a selector on the service label and answers from the merged timeline. Swap api-server for your own service name.
- Narrow it if you need to. Ask Claude Code to use
catalog_listandcatalog_describeto see what is there, thenreadwith a specific list of sources to look at only the ones that matter, such as your metrics source and your logs source.
No trigger is required for any of this. Your agent can look at a service the moment someone reports it feels slow. More client setups are on the connecting agents page.
What you get
- One answer built from the correlated timeline, so latency metrics, request logs, alerts and earlier findings are read together on one clock.
- A starting point that includes past conclusions. If an agent already recorded a finding for the service, Claude Code reads it with the evidence.
- A visible audit trail. Every read shows up under Reads in the console, tagged
client = mcp. - A path to automation. Once you know which question you keep asking, Claude Code can call
create_triggerso Tares wakes an agent the next time it happens, andrememberto write back what it found. - Scoped access. A read-scoped API key limits Claude Code to the read surface, and a project key limits it to one project.
When something else fits
- If you want the investigation to start without anyone asking, use a trigger that wakes a Tares agent or your own agent service. The AI SRE guide builds that end to end.
- If you want to explore the same timeline by hand, or chat with it without wiring up an external client, use Ask in the console, which has the same read tools.
- If your client only supports stdio servers, use the stdio transport with
tares-mcpinstead of the HTTP endpoint.