AgentDBDocs

Administration

Retention and lifecycle settings, integrity checks.

Start with: lifecycle_info, lifecycle_set_retention, integrity_check.

3 operations. Discover them from an agent with agentdb_capabilities {"category": "administration"}.

#integrity_check

stable added in 1.0.0-rc.6 read-only

Dry-run integrity report: every required relationship and the records that lack their link.

MCP tool
integrity_check
REST
GET /v1/workspaces/{ws}/integrity scope schema:read

Arguments

ArgumentTypeRequiredDescription
objectstringObject type name, e.g. contact.
workspacestringWorkspace id (preferred), slug or exact name. Omit for the default workspace. Resolve names once with workspace_select.

Example

MCP
{
  "tool": "integrity_check",
  "arguments": {
    "object": "contact"
  }
}
MCP via agentdb_execute
{
  "tool": "agentdb_execute",
  "arguments": {
    "operation": "integrity_check",
    "arguments": {
      "object": "contact"
    }
  }
}
REST
curl -s "https://app.agentdb.link/v1/workspaces/$AGENTDB_WORKSPACE/integrity" \
  -H "Authorization: Bearer $AGENTDB_TOKEN"

#lifecycle_info

stable added in 1.0.0-rc.6 read-only

Retention (days a deleted record stays restorable), archived and recycle-bin counts per object.

MCP tool
lifecycle_info
REST
GET /v1/workspaces/{ws}/lifecycle scope schema:read
CLI
agentdb lifecycle info

Arguments

ArgumentTypeRequiredDescription
objectstringObject type name, e.g. contact.
workspacestringWorkspace id (preferred), slug or exact name. Omit for the default workspace. Resolve names once with workspace_select.

Example

MCP
{
  "tool": "lifecycle_info",
  "arguments": {
    "object": "contact"
  }
}
MCP via agentdb_execute
{
  "tool": "agentdb_execute",
  "arguments": {
    "operation": "lifecycle_info",
    "arguments": {
      "object": "contact"
    }
  }
}
REST
curl -s "https://app.agentdb.link/v1/workspaces/$AGENTDB_WORKSPACE/lifecycle" \
  -H "Authorization: Bearer $AGENTDB_TOKEN"
CLI
agentdb lifecycle info [options] [object]

#lifecycle_set_retention

stable added in 1.0.0-rc.6 changes data

Set how many days deleted records of an object stay in the recycle bin (default 30; 0 = deletes are permanent; null = default). Expired entries are purged automatically.

MCP tool
lifecycle_set_retention
REST
POST /v1/workspaces/{ws}/lifecycle/retention scope schema:write

Arguments

ArgumentTypeRequiredDescription
objectstringyesObject type name, e.g. contact.
retention_daysinteger | nullyesDays to keep archived records before they are purged. null keeps them.
idempotency_keystringOptional retry key ([A-Za-z0-9._:-], max 255). Repeating a call with the same key and arguments returns the original result without writing again.
workspacestringWorkspace id (preferred), slug or exact name. Omit for the default workspace. Resolve names once with workspace_select.

Example

MCP
{
  "tool": "lifecycle_set_retention",
  "arguments": {
    "object": "contact",
    "retention_days": 30
  }
}
MCP via agentdb_execute
{
  "tool": "agentdb_execute",
  "arguments": {
    "operation": "lifecycle_set_retention",
    "arguments": {
      "object": "contact",
      "retention_days": 30
    }
  }
}
REST
curl -s -X POST "https://app.agentdb.link/v1/workspaces/$AGENTDB_WORKSPACE/lifecycle/retention" \
  -H "Authorization: Bearer $AGENTDB_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"object":"contact","retention_days":30}'