Skip to Content
Tares

How do I ask Claude Code to investigate 5xx errors on an API with Tares?

Tares lets you connect Claude Code over MCP and ask what happened to your API in the last 15 minutes. Claude Code calls the read tool and answers from one correlated timeline of logs, metrics, alerts and findings. You get the 5xx evidence for the service in one read, without querying each system yourself.

How it works

Tares ingests your sources and labels them by service, so every source that carries the same service label merges into one time-ordered timeline for that service. Claude Code reaches that timeline through the Tares MCP endpoint.

  • You connect Claude Code to the endpoint once. It discovers the Tares tools on its own.
  • When you ask about a service, Claude Code calls read with a selector such as service set to api-server. The selector is a strict AND across labels.
  • The read returns metrics (such as the 5xx rate), request logs, fired alerts and any findings already recorded, merged on one clock.
  • Claude Code answers from that timeline. If an earlier investigation left a finding, it starts from that conclusion instead of from scratch.

This is the pull side: you ask when you want to know. If you want an agent woken when a problem starts, that is the push side, described in the AI SRE guide.

Each read shows up in the console under Reads, tagged client = mcp.

Set it up

  1. Start Tares locally and keep it running.

    tares up
  2. In a second terminal, start the MCP endpoint. A local daemon alone does not serve /mcp. On your own server or on Tares Cloud the MCP server is already running, and the Tares Cloud console shows your endpoint under Connect.

    tares mcp
  3. Connect Claude Code to http://localhost:8788/mcp. Run this in your terminal:

    claude mcp add --transport http tares http://localhost:8788/mcp

    Or install the Tares plugin from inside Claude Code. It wires the MCP read-back and also captures your Claude Code sessions into Tares. The install asks for the Tares URL, which is the MCP endpoint, plus an optional auth token and a capture toggle.

    /plugin marketplace add glassflow/tares /plugin install tares@tares
  4. On a secured instance, use an API key with the read scope. Pass it as an Authorization Bearer header on the MCP connection. An open local instance needs no credential.

  5. Verify the connection by asking Claude Code:

    Use tares: what are you ingesting right now?

    It calls catalog_list and lists your sources, triggers and projects.

  6. Ask about the failing API. Use the value of your service label in place of api-server:

    Use tares: what happened to api-server in the last 15 minutes?

    Claude Code calls read for that service and walks you through the 5xx rate, the error logs and any alert that fired. To go further, ask it to look only at specific sources. It can use catalog_describe to learn what each source holds and then read with sources to narrow the timeline.

For other clients and the full tool list, see Connecting agents (MCP).

For a useful answer, your metrics, logs and alerts for the API need to carry the same service label. If one source lacks it, that source is missing from the timeline for the service.

What you get

  • One answer from one correlated read, instead of switching between a metrics UI, a log viewer and an alert list.
  • The 5xx rate, the error log lines and the alert that tripped, on one clock, so the order of events is visible.
  • Continuity between investigations. Findings recorded earlier appear in the same timeline, so Claude Code builds on them.
  • A trail you can audit. Every read is listed in the console under Reads.
  • Write-back when you allow it. A key with the right scope lets Claude Code record what it found with record_finding, or write an observation with remember, so the next investigation sees it.

When something else fits

  • If you want an agent to start investigating the moment 5xx errors begin, without anyone asking, use a trigger that wakes an agent. The AI SRE guide covers that push side.
  • If you would rather explore from a browser than from Claude Code, the in-app Ask chat in the console uses the same read tools.
  • If you use Cursor, Codex or another MCP client, the Connecting agents (MCP) page shows its setup.

Still stuck? Get help

Last updated on