Skip to content
Covo Developers

Reference

Diagnose

Why an agent might be failing, in one call: findings with severity and resolution, validation, recent generation and tool failures, failed imports, unanswered questions and the last test run.

RESTGET /api/v1/agents/{agent_id}/diagnostics
MCP tooldiagnose_agent
ClassificationRead (changes nothing)
Scopeagents:read
Minimum role on the agenteditor
ConfirmationNot needed
Retry safetySafe to retry with the same input
Success status200

What it does

Why an agent might be failing, in one call: findings with severity and resolution, validation, recent generation and tool failures, failed imports, unanswered questions and the last test run.

Side effects

None. It only reads.

Inputs

NameTypeRequiredInDescription
agent_idstringyespathThe agent id (agt_...), from list_agents.
daysintegernoqueryDefault 7.

Example

REST
curl "https://covo.lanaai.io/api/v1/agents/agt_4edc89bb2964/diagnostics?days=7" \
  -H "Authorization: Bearer $COVO_TOKEN"
MCP (POST /mcp)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "diagnose_agent",
    "arguments": {
      "agent_id": "agt_4edc89bb2964",
      "days": 7
    }
  }
}

Response

Returns an object with healthy, findings, validation, recent, unanswered_questions and last_test_run. This is a real response, shortened to two items per list.

200 response
{
  "healthy": true,
  "findings": [],
  "validation": {
    "valid": true,
    "state": "ready",
    "errors": [],
    "warnings": [
      {
        "step": "knowledge",
        "field": null,
        "severity": "recommended",
        "message": "Add a few common questions. Short, specific answers work best."
      }
    ],
    "checks": [
      {
        "name": "ai_provider",
        "status": "pass",
        "message": "The AI provider is configured."
      },
      {
        "name": "reply_allowance",
        "status": "pass",
        "message": "2999 AI replies left this month."
      }
    ]
  },
  "recent": {
    "days": 7,
    "generation_failures": 0,
    "rate_limited": 0,
    "unanswered": 0,
    "tool_failures": [],
    "source_failures": []
  },
  "unanswered_questions": [],
  "last_test_run": {
    "id": "68c583c0-3bb6-42d3-85b4-193ea6eeca79",
    "revision": 7,
    "passed": 1,
    "failed": 0,
    "cases": [
      {
        "name": "Explains the studio",
        "turns": [
          {
            "reply": "Northwind Labs\nNorthwind Labs builds private AI systems for small law firms.",
            "message": "What does Northwind Labs do?",
            "grounding": "known",
            "components": [
              "suggested_questions"
            ],
            "latency_ms": 40,
            "handed_to_person": false
          }
        ],
        "passed": true,
        "failures": [],
        "conversation_id": "b2412a0b-9da5-4df5-adc9-031895e6a98c"
      }
    ],
    "client": {
      "name": "docs-examples",
      "interface": "rest"
    },
    "created_at": "2026-10-07T20:14:41.959Z"
  }
}

Over MCP the same object comes back as the tool result, in structuredContent and as JSON text.

Errors

StatusCodeMeaning
401unauthorizedNo token, or it is unknown, revoked or expired. OAuth apps refresh or reconnect.
403account_suspendedThe account that owns the token is paused.
403insufficient_scopeThe token lacks agents:read.
404agent_not_foundUnknown agent, or not reachable with this token.
400bad_requestAn input is invalid; field names it.
429rate_limitedWait Retry-After seconds.