counterparty.classify
LiveInferred relationship + class with confidence + evidence summary.
Description
Returns inferred class (colleague / family / vendor / friend / unknown) with plain-language evidence_summary. Reads from the kg_relations graph; classification is materialized, not LLM-rerun on each call. Per ADR-0021 §read-API Family B.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
counterparty_id | string | yes | Canonical counterparty id. |
Output shape
typescript
{
counterparty_id: string;
inferred_relationship?: string;
inferred_class?: 'colleague' | 'family' | 'vendor' | 'friend' | 'unknown';
confidence: 'strong_pattern' | 'pretty_sure' | 'just_guessing';
evidence_summary: string;
}Example call
JSON-RPC tools/call request body (omit the JSON-RPC envelope when using an SDK; the SDK adds it for you):
jsontools/call params
{ "name": "counterparty.classify", "arguments": { "counterparty_id": "entity_01HXSARAH" } }Example response
Tool results are always wrapped as content[0].text with a stringified JSON body. The shape below is what you get back from JSON.parse(result.content[0].text):
jsonparsed result body
{
"counterparty_id": "entity_01HXSARAH",
"inferred_relationship": "API lead at Acme",
"inferred_class": "colleague",
"confidence": "strong_pattern",
"evidence_summary": "47 work-hours interactions over 8 months; all calendar overlaps with Acme attendees; signature domain consistent."
}Errors this tool can return
| Code | Meaning |
|---|---|
invalid_arguments | Tool input failed Zod validation. |
unauthorized | Missing or invalid bearer token. |
quota_exceeded | Per-minute, daily call, or daily inference budget exceeded. |
not_found | The requested resource (action_id, decision_id, counterparty_id, etc.) was not found. |
See the full error catalog for resolution steps on each code, plus the standard transport-layer responses (401, 429).