Skip to Content
Tares

How do I ask the Cursor agent to investigate 5xx errors on an API with Tares?

Tares lets the Cursor agent investigate 5xx errors by connecting it over MCP, then asking what happened to your API service in the last 15 minutes. Cursor calls the Tares read tool and answers from one correlated timeline of logs, metrics, alerts and findings for that service. You add one entry to mcp.json, approve the server in Cursor, and ask.

How it works

Tares exposes an MCP endpoint that Cursor connects to over streamable HTTP. Once connected, Cursor discovers the Tares tools and picks the right one for your question.

  • read returns a time-ordered timeline across all sources that match a label selector. For an API, that is the service label set to your service name, for example api-server.
  • The timeline merges the request logs, the 5xx and latency metrics, fired alerts and earlier findings on one clock, so Cursor sees the error spike next to the alert and the log lines that go with it.
  • catalog_list and catalog_describe let Cursor learn which sources, triggers and projects exist before it reads.

This is the pull side: you ask, the agent reads. Where the endpoint lives depends on where Tares runs. On your machine it is http://localhost:8788/mcp. On your own server it is https://<your-domain>/mcp. On Tares Cloud it is shown under Connect in your console.

For the timeline to hold your API’s 5xx data, your metrics, logs and alerts sources need to carry the same service label. The AI SRE guide shows that wiring end to end.

Set it up

  1. Start Tares on your machine, then start the MCP endpoint in a second terminal.
tares up tares mcp
  1. Add Tares to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project).
{ "mcpServers": { "tares": { "url": "http://localhost:8788/mcp" } } }
  1. Approve the server in Cursor under Settings → MCP.

  2. Verify the connection by asking Cursor:

Use tares: what are you ingesting right now?

Cursor should call catalog_list and answer with your sources, triggers and projects.

  1. Ask about the 5xx errors. Use your own service name:

Use tares: what happened to api-server in the last 15 minutes? Focus on 5xx errors.

Cursor calls read for that service and answers from the correlated timeline. Ask follow-ups such as which alert fired first or which log lines show the failing route.

  1. On a server or Tares Cloud instance, replace the URL with your endpoint and add a credential. Use an API key with the read scope rather than the root token. The console’s Connect page generates the exact command with the endpoint and token filled in. See Connecting agents (MCP) for every client and the authentication options.

In the console, Reads lists each read as it happens, tagged client = mcp, so you can confirm Cursor read the timeline.

What you get

  • One answer built from logs, metrics, alerts and findings for the service, not from separate lookups in each tool.
  • A starting point from earlier work. When an agent or a Tares agent has already recorded a finding on the service, Cursor reads it along with the evidence.
  • A visible trail. Every read shows up in the console with the MCP tag.
  • Optional write-back. With the matching scope, the agent can call remember to store what it found, or create_trigger to be woken when the same condition happens again.

When something else fits

  • If you want an investigation to start without anyone asking, use a trigger that wakes an agent when an alert fires. The AI SRE guide builds that push side.
  • If you would rather not wire up an external client, the Ask chat in the Tares console has the same read tools.
  • If your agent should work inside one project only, use a project key instead of a broad API key.

Still stuck? Get help

Last updated on