Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

Routing a method name to the handler that serves it.

§Why this is not on Server

Server::call takes a tool name, because a tool call is the only thing a handler can answer. A peer, though, sends a method name, and several methods never reach a tool handler at all — tools/list and ping have no handler to dispatch to. The method table lives here rather than on Server so the two stay apart: the builder is how a server is described, this is how a request against it is routed.

§What the result is, and is not

The result is an IR-level JsonObject, not a wire frame. There is no request-side codec yet — Codec lifts and lowers a ToolResult and nothing else — so a result built here is the canonical form that T13/T14’s transport will then lower for whichever revision negotiated. The in-process test that exercises this says the same thing in its own doc comment rather than pretending to cover the wire.

§Which fields a listing carries

Only the ones every revision expresses. title and icons arrived in 2026-07-28, so emitting them unconditionally would hand a 2024-11-05 peer a field its revision has no name for. Gating a field on a revision is the codec’s job and belongs with it; this module stays the common denominator, and the omission is recorded rather than papered over.

Structs§

Dispatcher
Routes methods to a server’s handlers.

Functions§

result_envelope_defined_in
Whether SEP-2549’s result envelope exists in this revision.