routing.get_default_handler

V1.1 · post-MVP

Read the current routing preference for a (user × action class) pair.

CategoryRouting
JSON-RPCtools/call
EndpointPOST /mcp

Description

Returns the resolved handler the substrate would dispatch to for the given pair, plus the routing reason (`explicit` if the user set a preference, `only_handler` if only one is registered, `policy_rule` if a routing rule selected it).

Input schema

FieldTypeRequiredDescription
user_idstringyesEnd-user id.
action_classstringyesAction class to resolve.

Output shape

typescript
{
  handler_id: string;
  source: "explicit" | "only_handler" | "policy_rule";
  candidates: Array<{ handler_id: string; url: 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": "routing.get_default_handler",
  "arguments": {
    "user_id": "usr_01HXP9USER",
    "action_class": "communicate"
  }
}

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
{
  "handler_id": "hnd_01HXP9HANDLER",
  "source": "explicit",
  "candidates": [
    { "handler_id": "hnd_01HXP9HANDLER", "url": "https://handlers.your-app.com/cortex" },
    { "handler_id": "hnd_01HXP9OTHER",   "url": "https://other-app.example.com/cortex" }
  ]
}

Errors this tool can return

CodeMeaning
invalid_argumentsTool input failed Zod validation.
unauthorizedMissing or invalid bearer token.

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

Notes