WithDispatchInput returns ctx decorated with the original MCP tool- call JSON input map. Called from the registry's tool handler before invoking Dispatch. ExecDispatcher ignores it (it dispatches via cliArgs); HTTPHandlerDispatcher reads it to build a structured HTTP body without reverse-parsing CLI
(ctx context.Context, input map[string]any)
| 53 | // cliArgs); HTTPHandlerDispatcher reads it to build a structured HTTP |
| 54 | // body without reverse-parsing CLI flags. |
| 55 | func WithDispatchInput(ctx context.Context, input map[string]any) context.Context { |
| 56 | if input == nil { |
| 57 | return ctx |
| 58 | } |
| 59 | return context.WithValue(ctx, dispatchInputKey{}, input) |
| 60 | } |
| 61 | |
| 62 | // DispatchInputFromContext returns the original MCP tool-call JSON |
| 63 | // input attached by WithDispatchInput, or nil if none. Safe to call |
no outgoing calls