This document follows one hierarchical tool call from Server startup through the MCP Host, capability discovery, Apache Doris, and the final structured result.
sequenceDiagram participant Host as MCP Host participant Proto as Protocol + Auth participant Manifest as Manifest Service participant Cap as Capability Detector participant Dispatch as Child Dispatcher participant Runtime as Domain Runtime participant Route as Route Manager participant Doris as Apache Doris Host->>Proto: tools/list Proto->>Proto: authorize + validate + paginate Proto-->>Host: 8 domain tools Host->>Proto: tools/call doris_catalog {} Proto->>Manifest: discover authorized domain Manifest->>Cap: resolve route-specific snapshot Cap->>Route: resolve request route Route->>Doris: version and bounded feature probes Doris-->>Cap: observable evidence Cap-->>Manifest: coherent capability generation Manifest-->>Host: child manifest + manifest_version Host->>Proto: tools/call domain {child_tool, arguments, manifest_version} Proto->>Dispatch: validated outer request Dispatch->>Dispatch: reauthorize + rediscover + schema check Dispatch->>Runtime: exact child binding Runtime->>Runtime: identifiers + read-only guard + limits Runtime->>Route: request-specific connection Route->>Doris: bounded read-only SQL/HTTP operation Doris-->>Runtime: rows or backend failure Runtime-->>Dispatch: normalized data/warnings/metadata Dispatch->>Dispatch: output Schema validation Dispatch-->>Host: result or deterministic error envelope
tools/listThe protocol layer:
list_tools for the request identity;Hierarchical mode returns eight domains. Flat mode returns authorized formal children, but each is built from the same current domain manifest and remains subject to the same size limits.
An empty object means discovery. The Server resolves children in catalog order:
authorized_child_discovery removes children the identity may not learn about.callable=false.manifest_version.One domain discovery uses one coherent capability generation. A provider or route change during detection cannot mix two generations into one manifest.
The Host submits:
{ "child_tool": "execute_query", "arguments": { "sql": "SELECT 1" }, "manifest_version": "manifest-generation-from-discovery" }
Before backend execution, the dispatcher:
An unauthorized child is reported as not found. This prevents capability-name disclosure and avoids treating discovery permission as execution permission.
The domain runtime applies operation-specific bounds. SQL paths additionally:
The route manager selects Doris OAuth user pool, static-token pool, or global pool in explicit priority order. SQL and HTTP evidence remain bound to that same request route.
A successful child result contains:
{ "mode": "result", "domain": "doris_query", "child_tool": "execute_query", "manifest_version": "...", "data": {}, "metadata": { "request_id": "...", "duration_ms": 12.4, "source": "doris_mysql", "truncated": false }, "warnings": [] }
Warnings identify partial sections, degraded evidence, or truncation without changing a failure into success. The dispatcher validates normalized data against the child's output Schema. The protocol layer then sanitizes error payloads and emits MCP content plus structured content.
| Condition | Result | Host action |
|---|---|---|
| Unknown or unauthorized child | CHILD_TOOL_NOT_FOUND | Do not guess names; rediscover if appropriate |
| Manifest generation changed | CHILD_MANIFEST_STALE | Discover the domain again |
| Capability unavailable | CHILD_CAPABILITY_UNAVAILABLE | Read reason_code; fix version/provider/permission/config |
| Arguments violate schema | CHILD_ARGUMENTS_INVALID | Correct exact argument violations |
| Execution timeout | CHILD_EXECUTION_TIMEOUT | Reduce scope or retry only when marked retryable |
| Doris/provider failure | CHILD_EXECUTION_FAILED | Use reason code and retryability; do not parse raw backend text |
| MCP operation denied | protocol authorization error | Request exact scope or use the correct identity |
The Server processes four different data classes:
Continue with Security and permission model and Reliability and limits.