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

Function showInteractiveMCPWorkflowSelection

pkg/cli/mcp_list.go:229–254  ·  view source on GitHub ↗

showInteractiveMCPWorkflowSelection displays an interactive list of workflows with MCP servers

(workflows []struct {
	name        string
	serverCount int
	serverNames []string
}, verbose bool)

Source from the content-addressed store, hash-verified

227
228// showInteractiveMCPWorkflowSelection displays an interactive list of workflows with MCP servers
229func showInteractiveMCPWorkflowSelection(workflows []struct {
230 name string
231 serverCount int
232 serverNames []string
233}, verbose bool) (string, error) {
234 mcpListLog.Printf("Showing interactive MCP workflow selection: workflows=%d", len(workflows))
235
236 // Convert workflow data to ListItems
237 items := make([]console.ListItem, len(workflows))
238 for i, wf := range workflows {
239 description := fmt.Sprintf("%d server(s): %s", wf.serverCount, strings.Join(wf.serverNames, ", "))
240 // Truncate description if too long
241 description = stringutil.Truncate(description, 80)
242 items[i] = console.NewListItem(wf.name, description, wf.name)
243 }
244
245 // Show interactive list
246 title := "Select a workflow to view its MCP servers:"
247 selectedWorkflow, err := console.ShowInteractiveList(title, items)
248 if err != nil {
249 return "", err
250 }
251
252 mcpListLog.Printf("Selected workflow: %s", selectedWorkflow)
253 return selectedWorkflow, nil
254}
255
256// determineConfigStatus checks if an MCP server configuration is valid and ready
257func determineConfigStatus(config parser.RegistryMCPServerConfig) string {

Callers 1

Calls 4

TruncateFunction · 0.92
NewListItemFunction · 0.92
ShowInteractiveListFunction · 0.92
PrintfMethod · 0.45

Tested by

no test coverage detected