McpServer.registerDynamicPrompt

Register a *dynamic* prompt with the handler that produces its messages.

Like registerDynamicTool, this is the explicit escape hatch for prompts whose argument set is defined at runtime: the handler receives the raw Json arguments. For statically-typed prompts, prefer the UDA layer (@prompt-annotated methods registered via registerPrompts), which marshals typed parameters and dispatches through this same dynamic path.

  1. void registerDynamicPrompt(Prompt descriptor, GetPromptResult delegate(Json) @(safe) handler)
    class McpServer
    @safe
    void
    registerDynamicPrompt
    (,
    GetPromptResult delegate
    (
    Json
    )
    @safe
    handler
    )
  2. void registerDynamicPrompt(Prompt descriptor, MrtrPromptHandler handler)