routing.get_default_handler
V1.1 · post-MVPRead the current routing preference for a (user × action class) pair.
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
| Field | Type | Required | Description |
|---|---|---|---|
user_id | string | yes | End-user id. |
action_class | string | yes | Action 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
| Code | Meaning |
|---|---|
invalid_arguments | Tool input failed Zod validation. |
unauthorized | Missing or invalid bearer token. |
See the full error catalog for resolution steps on each code, plus the standard transport-layer responses (401, 429).