MCPcopy Create free account
hub / github.com/compozy/agh / newToolListCommand

Function newToolListCommand

internal/cli/tool_operator.go:81–104  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

79}
80
81func newToolListCommand(deps commandDeps) *cobra.Command {
82 var scope toolScopeFlags
83 cmd := &cobra.Command{
84 Use: toolOperatorListKey,
85 Short: "List operator-visible registry tools",
86 Example: ` # List all operator-visible tools as JSON
87 agh tool list -o json
88
89 # Inspect the session-scoped operator view for one agent
90 agh tool list --workspace ws-1 --session sess-1 --agent coder -o json`,
91 Args: cobra.NoArgs,
92 RunE: func(cmd *cobra.Command, _ []string) error {
93 return runToolCommand(cmd, deps, func(client DaemonClient) error {
94 response, err := client.ListTools(cmd.Context(), scope.query())
95 if err != nil {
96 return err
97 }
98 return writeCommandOutput(cmd, toolListBundle(response))
99 })
100 },
101 }
102 scope.bind(cmd)
103 return cmd
104}
105
106func newToolSearchCommand(deps commandDeps) *cobra.Command {
107 var scope toolScopeFlags

Callers 1

newToolCommandFunction · 0.85

Calls 6

queryMethod · 0.95
bindMethod · 0.95
runToolCommandFunction · 0.85
writeCommandOutputFunction · 0.85
toolListBundleFunction · 0.85
ListToolsMethod · 0.65

Tested by

no test coverage detected