pub async fn dispatch_inbound_sampling(
server_name: &str,
request: &Value,
) -> ValueExpand description
Dispatch an inbound server-to-client sampling/createMessage
request (received while Harn is acting as an MCP client) and return
the JSON-RPC response we should send back to the server.
The implementation order matches existing HITL primitives:
- If a
host_mock("mcp", "sample", ...)matches, use that. - Otherwise, dispatch through the installed
HostCallBridge. - If no host can take the call, decline with a structured error so the server can fall back to a sensible default.
On approval, the request is translated into Harn’s llm_call
boundary (extract_llm_options + execute_llm_call) so providers
pick up the same routing, capability gating, mock interception,
and budget plumbing as a script-side llm_call.