MCP Routing Telemetry
This contributor reference describes an optional code callback, not product analytics enabled by default. End users configure routing under Settings → MCP Servers.
import { mcpOrchestrator, type McpRoutingTelemetry } from '@/lib/mcp-orchestrator'await mcpOrchestrator.getRelevantTools(userMessage, mcpServiceLike, disabledToolKeys, { routerModel, abortSignal, onRoutingTelemetry: (info: McpRoutingTelemetry) => { console.debug('[mcp-routing]', info) },})
Released Biyan builds do not register onRoutingTelemetry. A custom build must add the callback explicitly.
Important fields
| Field | Meaning |
|---|---|
routingRan | Whether server selection ran for the turn. |
bypassedRouting | Whether Biyan loaded the full tool list directly. |
pickSource | llm, keyword, or null. |
selectedServerCount | Number of selected server names. |
totalLatencyMs | Total tool-routing latency. |
llmRouterLatencyMs | Remote router-model latency, or null. |
fallbackReason | Stable reason code for timeout, abort, error, empty output, or tool-load recovery. |
fellBackToFullToolList | Whether Biyan widened the tool set after selective loading failed. |
llmRouterUsage | Provider usage data when the remote provider returns it. |
Telemetry handlers must not log prompts, API keys, tool arguments, tool output, full paths, or document content. See MCP Servers.