MCPcopy Create free account
hub / github.com/github/gh-aw / buildMCPRendererFactory

Function buildMCPRendererFactory

pkg/workflow/mcp_renderer_factory.go:149–161  ·  view source on GitHub ↗

buildMCPRendererFactory creates a factory function for MCPConfigRendererUnified instances. The returned function accepts isLast as a parameter and creates a renderer with engine-specific options derived from the provided parameters and workflowData at call time.

(workflowData *WorkflowData, format string, includeCopilotFields, inlineArgs bool)

Source from the content-addressed store, hash-verified

147// The returned function accepts isLast as a parameter and creates a renderer with engine-specific
148// options derived from the provided parameters and workflowData at call time.
149func buildMCPRendererFactory(workflowData *WorkflowData, format string, includeCopilotFields, inlineArgs bool) func(bool) *MCPConfigRendererUnified {
150 mcpRenderingLog.Printf("Building MCP renderer factory: format=%s, copilotFields=%t, inlineArgs=%t", format, includeCopilotFields, inlineArgs)
151 return func(isLast bool) *MCPConfigRendererUnified {
152 return NewMCPConfigRenderer(MCPRendererOptions{
153 IncludeCopilotFields: includeCopilotFields,
154 InlineArgs: inlineArgs,
155 Format: format,
156 IsLast: isLast,
157 ActionMode: GetActionModeFromWorkflowData(workflowData),
158 WriteSinkGuardPolicies: deriveWriteSinkGuardPolicyFromWorkflow(workflowData),
159 })
160 }
161}
162
163// buildStandardJSONMCPRenderers constructs MCPToolRenderers with the standard rendering callbacks
164// shared across JSON-format engines (Claude, Gemini, Copilot, Codex gateway).

Callers 1

Calls 4

NewMCPConfigRendererFunction · 0.85
PrintfMethod · 0.45

Tested by

no test coverage detected