MCPcopy
hub / github.com/github/github-mcp-server / shouldDeferToForm

Function shouldDeferToForm

pkg/github/ui_capability.go:71–76  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

69// the handler executes directly; the host may still render the tool's view,
70// which renders the result rather than an input form.
71func 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}

Callers 3

IssueWriteFunction · 0.85
CreatePullRequestFunction · 0.85
UpdatePullRequestFunction · 0.85

Calls 4

clientSupportsUIFunction · 0.85
uiSubmittedFunction · 0.85
hasNonFormParamsFunction · 0.85
IsFeatureEnabledMethod · 0.65

Tested by

no test coverage detected