shouldDeferToForm is the single source of truth for the show/defer decision shared by the form-backed write tools (create_pull_request, update_pull_request, issue_write). It reports whether a call should be handed off to its MCP App form instead of executing now: defer only when MCP Apps are enabled
(ctx context.Context, deps ToolDependencies, req *mcp.CallToolRequest, args map[string]any, formParams map[string]struct{})
| 69 | // the handler executes directly; the host may still render the tool's view, |
| 70 | // which renders the result rather than an input form. |
| 71 | func shouldDeferToForm(ctx context.Context, deps ToolDependencies, req *mcp.CallToolRequest, args map[string]any, formParams map[string]struct{}) bool { |
| 72 | return deps.IsFeatureEnabled(ctx, MCPAppsFeatureFlag) && |
| 73 | clientSupportsUI(ctx, req) && |
| 74 | !uiSubmitted(args) && |
| 75 | !hasNonFormParams(args, formParams) |
| 76 | } |
no test coverage detected