feat: expose canonical output bindings to mcp
This commit is contained in:
@@ -49,6 +49,7 @@ _SEARCH_ALWAYS_VISIBLE_TOOL_NAMES = [
|
||||
"wf.workflow.set_draft_name",
|
||||
"wf.workflow.set_draft_route",
|
||||
"wf.workflow.set_step_input_bindings",
|
||||
"wf.workflow.set_step_output_bindings",
|
||||
"wf.workflow.set_step_input_map",
|
||||
"wf.workflow.set_step_output_map",
|
||||
"wf.workflow.set_workflow_output_map",
|
||||
|
||||
@@ -239,6 +239,15 @@ class SetStepInputBindingsRequest(BaseModel):
|
||||
bindings: DraftInputBindings
|
||||
|
||||
|
||||
class SetStepOutputBindingsRequest(BaseModel):
|
||||
"""Replace one step's complete ordered canonical output-binding list."""
|
||||
|
||||
workspace_id: WorkspaceId
|
||||
revision: int = Field(ge=1, description="Expected current workspace revision.")
|
||||
step_id: NonEmptyString
|
||||
bindings: DraftOutputBindings
|
||||
|
||||
|
||||
class SetStepOutputMapRequest(BaseModel):
|
||||
"""Typed MCP request for replacing or merging one step output map."""
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ from .models import (
|
||||
SetDraftRouteRequest,
|
||||
SetStepInputBindingsRequest,
|
||||
SetStepInputMapRequest,
|
||||
SetStepOutputBindingsRequest,
|
||||
SetStepOutputMapRequest,
|
||||
SetWorkflowOutputMapRequest,
|
||||
TraceRange,
|
||||
@@ -464,6 +465,26 @@ def register_workflow_tools(server: FastMCP[Any], service: WfMcpService) -> None
|
||||
)
|
||||
)
|
||||
|
||||
@server.tool(
|
||||
name="wf.workflow.set_step_output_bindings",
|
||||
title="Set Step Output Bindings",
|
||||
description=(
|
||||
"Replace one capability step's complete ordered output bindings. "
|
||||
"Repeated sources are valid fan-out; state targets must not overlap."
|
||||
),
|
||||
)
|
||||
async def set_step_output_bindings(
|
||||
request: SetStepOutputBindingsRequest,
|
||||
) -> DraftWorkspaceResult:
|
||||
return DraftWorkspaceResult.model_validate(
|
||||
await handlers.set_step_output_bindings(
|
||||
workspace_id=request.workspace_id,
|
||||
revision=request.revision,
|
||||
step_id=request.step_id,
|
||||
bindings=request.bindings,
|
||||
)
|
||||
)
|
||||
|
||||
@server.tool(
|
||||
name="wf.workflow.set_step_output_map",
|
||||
title="Set Step Output Map",
|
||||
|
||||
Reference in New Issue
Block a user