Skip to content
TriedDocs
Voice agents

Repair agent

Find and fix references in an agent that point at deleted things.

POSThttps://api.tried.com.au/repair-agent/{agent_id}

Checks an agent and its LLM or flow for references that no longer exist and fixes them in the drafts. Published versions are never changed. Use dry_run to see the report without writing.

Checks and fixes:

Target Problem Fix
agent voice_id does not exist Set to 11labs-Adrian.
LLM knowledge_base_ids include deleted knowledge bases Removed.
LLM A state edge points at a missing state Edge removed.
LLM starting_state missing or not set while states exist Set to the first state.
LLM An mcp tool references an mcp_id not in mcps (and has no url) Tool removed.
flow knowledge_base_ids include deleted knowledge bases Removed.
flow An edge (edges, else_edge, skip_response_edge) points at a missing node Destination cleared.
flow start_node_id missing Set to the first node.

A missing llm_id or conversation_flow_id cannot be fixed and is reported in unfixable.

Request#

Path parameters#

Parameter Type Required Description
agent_id string Yes The agent.

Body#

Field Type Required Description
dry_run boolean No Report without writing. Default false.

Example request#

curl -X POST "https://api.tried.com.au/repair-agent/agent_3f9a1c0b2d4e5f6a7b8c9d0e" \
  -H "Authorization: Bearer $TRIED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "dry_run": true
}'
const res = await fetch("https://api.tried.com.au/repair-agent/agent_3f9a1c0b2d4e5f6a7b8c9d0e", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TRIED_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "dry_run": true
  }),
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://api.tried.com.au/repair-agent/agent_3f9a1c0b2d4e5f6a7b8c9d0e",
    headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
    json={
        "dry_run": True,
    },
)
data = res.json()

Response#

200 OK

{
  "agent_id": "agent_3f9a1c0b2d4e5f6a7b8c9d0e",
  "dry_run": true,
  "repaired": false,
  "fixes": [
    { "target": "llm", "path": "knowledge_base_ids", "issue": "missing knowledge bases knowledge_base_1a2b3c4d5e6f7a8b9c0d1e2f", "fix": "removed" }
  ],
  "unfixable": []
}

repaired is true when fixes were written. Fixes go through the normal update path, so a published LLM, flow or agent gets a new draft.

Errors#

Status When
400 Validation failed.
401 Missing or invalid API key.
403 The key's IP allowlist or scopes reject the request. This route needs the agents scope.
404 The agent does not exist.
429 Rate limit exceeded. See Rate limits.

See Errors for the body format.