Available on non-WebAssembly only.
Expand description
PromptHandler implementation for SequentialWorkflow with server-side execution
Enables workflows to be registered as prompts in the server with full tool execution.
§MCP-Compliant Workflow Execution
This module implements server-side workflow execution during prompts/get. When a user
invokes a workflow prompt, the server:
- Creates a user intent message from the workflow description and arguments
- Creates an assistant plan message listing all workflow steps
- Executes each step sequentially:
- Announces the tool call (assistant message)
- Executes the tool server-side
- Returns the tool result (user message)
- Stores the result in execution context (bindings)
- Returns the complete conversation trace to the client
This approach provides:
- Complete execution context for the LLM
- Efficient single-round-trip execution
- Clear error handling and debugging
- Data flow via bindings between steps
Structs§
- Workflow
Prompt Handler PromptHandlerimplementation forSequentialWorkflow