patterns.list

Live

Read the rule-candidate / pattern-detector surface from consolidation Phase 2.

CategoryPatterns
JSON-RPCtools/call
EndpointPOST /mcp
Sourcepackages/mcp-tools/src/tools/patterns-list.ts

Description

Per ADR-0021 §read-API Family D.

Input schema

FieldTypeRequiredDescription
counterparty_idstringnoFilter to a single counterparty.
pattern_class'communication' | 'schedule' | 'preference' | 'commitment' | 'trust'noFilter by pattern class.
sincestring (ISO-8601)noLower bound on detected_at.
limitintegernoDefault 25; max 100.

Output shape

typescript
{ items: Array<{ pattern_class: string; summary: string; confidence: 'strong_pattern' | 'pretty_sure' | 'just_guessing'; evidence_episode_ids: string[]; world_version: 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": "patterns.list", "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
{
  "items": [
    { "pattern_class": "communication", "summary": "Sarah replies within 2 hours during work hours.", "confidence": "strong_pattern", "evidence_episode_ids": ["ep_01H..."], "world_version": "wv_01HXR4WORLD" }
  ]
}

Errors this tool can return

CodeMeaning
invalid_argumentsTool input failed Zod validation.
unauthorizedMissing or invalid bearer token.
quota_exceededPer-minute, daily call, or daily inference budget exceeded.

See the full error catalog for resolution steps on each code, plus the standard transport-layer responses (401, 429).