MCPcopy
hub / github.com/docker/docker-agent / runDebugToolsetsCommand

Method runDebugToolsetsCommand

cmd/root/debug.go:108–149  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

106}
107
108func (f *debugFlags) runDebugToolsetsCommand(cmd *cobra.Command, args []string) (commandErr error) {
109 telemetry.TrackCommand(cmd.Context(), "debug", append([]string{"toolsets"}, args...))
110 defer func() { // do not inline this defer so that commandErr is not resolved early
111 telemetry.TrackCommandError(cmd.Context(), "debug", append([]string{"toolsets"}, args...), commandErr)
112 }()
113
114 ctx := cmd.Context()
115
116 t, err := f.loadTeam(ctx, args[0])
117 if err != nil {
118 return err
119 }
120 defer stopToolSets(ctx, t)
121
122 out := cli.NewPrinter(cmd.OutOrStdout())
123
124 for _, name := range t.AgentNames() {
125 agent, err := t.Agent(name)
126 if err != nil {
127 slog.ErrorContext(ctx, "Failed to get agent", "name", name, "error", err)
128 continue
129 }
130
131 agentTools, err := agent.Tools(ctx)
132 if err != nil {
133 slog.ErrorContext(ctx, "Failed to query tools", "name", agent.Name(), "error", err)
134 continue
135 }
136
137 if len(agentTools) == 0 {
138 out.Printf("No tools for %s\n", agent.Name())
139 continue
140 }
141
142 out.Printf("%d tool(s) for %s:\n", len(agentTools), agent.Name())
143 for _, tool := range agentTools {
144 out.Println(" +", tool.Name, "-", tool.Description)
145 }
146 }
147
148 return nil
149}
150
151func (f *debugFlags) runDebugSkillsCommand(cmd *cobra.Command, args []string) (commandErr error) {
152 telemetry.TrackCommand(cmd.Context(), "debug", append([]string{"skills"}, args...))

Callers

nothing calls this directly

Calls 12

loadTeamMethod · 0.95
PrintfMethod · 0.95
PrintlnMethod · 0.95
TrackCommandFunction · 0.92
TrackCommandErrorFunction · 0.92
NewPrinterFunction · 0.92
stopToolSetsFunction · 0.85
ContextMethod · 0.80
AgentNamesMethod · 0.80
AgentMethod · 0.80
ToolsMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected