feat: expose canonical input bindings to mcp

This commit is contained in:
lda
2026-07-22 19:27:36 +07:00 Verified
parent fdceb1e86e
commit 448895e831
6 changed files with 118 additions and 2 deletions
+1
View File
@@ -48,6 +48,7 @@ _SEARCH_ALWAYS_VISIBLE_TOOL_NAMES = [
"wf.workflow.validate_draft_workspace",
"wf.workflow.set_draft_name",
"wf.workflow.set_draft_route",
"wf.workflow.set_step_input_bindings",
"wf.workflow.set_step_input_map",
"wf.workflow.set_step_output_map",
"wf.workflow.set_workflow_output_map",
+9
View File
@@ -230,6 +230,15 @@ class SetStepInputMapRequest(BaseModel):
)
class SetStepInputBindingsRequest(BaseModel):
"""Replace one step's complete canonical input-binding list."""
workspace_id: WorkspaceId
revision: int = Field(ge=1, description="Expected current workspace revision.")
step_id: NonEmptyString
bindings: DraftInputBindings
class SetStepOutputMapRequest(BaseModel):
"""Typed MCP request for replacing or merging one step output map."""
+22
View File
@@ -35,6 +35,7 @@ from .models import (
RunDeploymentResult,
SetDraftNameRequest,
SetDraftRouteRequest,
SetStepInputBindingsRequest,
SetStepInputMapRequest,
SetStepOutputMapRequest,
SetWorkflowOutputMapRequest,
@@ -442,6 +443,27 @@ def register_workflow_tools(server: FastMCP[Any], service: WfMcpService) -> None
)
)
@server.tool(
name="wf.workflow.set_step_input_bindings",
title="Set Step Input Bindings",
description=(
"Replace one capability step's complete canonical input-binding list "
"atomically. Supports graph-path and literal bindings; inspect the "
"draft first because replacement is not a merge."
),
)
async def set_step_input_bindings(
request: SetStepInputBindingsRequest,
) -> DraftWorkspaceResult:
return DraftWorkspaceResult.model_validate(
await handlers.set_step_input_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",