@@ -63,13 +63,15 @@ func hasNonFormParams(args map[string]any, formParams map[string]struct{}) bool
6363// shared by the form-backed write tools (create_pull_request,
6464// update_pull_request, issue_write). It reports whether a call should be handed
6565// off to its MCP App form instead of executing now: defer only when MCP Apps
66- // are enabled, the client can render UI, the call is not itself a form
67- // submission, and every supplied parameter can be represented by the form
68- // (formParams is the tool's form-parameter allowlist). When it returns false
69- // the handler executes directly; the host may still render the tool's view,
70- // which renders the result rather than an input form.
66+ // are enabled, form deferral has not been disabled, the client can render UI,
67+ // the call is not itself a form submission, and every supplied parameter can
68+ // be represented by the form (formParams is the tool's form-parameter
69+ // allowlist). When it returns false the handler executes directly; the host may
70+ // still render the tool's view, which renders the result rather than an input
71+ // form.
7172func shouldDeferToForm (ctx context.Context , deps ToolDependencies , req * mcp.CallToolRequest , args map [string ]any , formParams map [string ]struct {}) bool {
7273 return deps .IsFeatureEnabled (ctx , MCPAppsFeatureFlag ) &&
74+ ! deps .IsFeatureEnabled (ctx , MCPAppsDisableFormDeferralFeatureFlag ) &&
7375 clientSupportsUI (ctx , req ) &&
7476 ! uiSubmitted (args ) &&
7577 ! hasNonFormParams (args , formParams )
0 commit comments