MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / WithDispatchInput

Function WithDispatchInput

internal/mcp/dispatch.go:55–60  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

53// cliArgs); HTTPHandlerDispatcher reads it to build a structured HTTP
54// body without reverse-parsing CLI flags.
55func 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

Calls

no outgoing calls