Skip to content

Commit 0e88935

Browse files
authored
chore(readme): clarify default enabled toolsets in documentation (#469)
* chore(readme): clarify default enabled toolsets in documentation Signed-off-by: Marc Nuri <[email protected]> * chore(readme): clarify default enabled toolsets in documentation Signed-off-by: Marc Nuri <[email protected]> --------- Signed-off-by: Marc Nuri <[email protected]>
1 parent 255eb9b commit 0e88935

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,19 @@ Enabling only the toolsets you need can help reduce the context size and improve
204204

205205
### Available Toolsets
206206

207-
The following sets of tools are available (all on by default).
207+
The following sets of tools are available (toolsets marked with ✓ in the Default column are enabled by default):
208208

209209
<!-- AVAILABLE-TOOLSETS-START -->
210210

211-
| Toolset | Description |
212-
|---------|-------------------------------------------------------------------------------------|
213-
| config | View and manage the current local Kubernetes configuration (kubeconfig) |
214-
| core | Most common tools for Kubernetes management (Pods, Generic Resources, Events, etc.) |
215-
| helm | Tools for managing Helm charts and releases |
216-
| kiali | Most common tools for managing Kiali |
211+
| Toolset | Description | Default |
212+
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
213+
| config | View and manage the current local Kubernetes configuration (kubeconfig) ||
214+
| core | Most common tools for Kubernetes management (Pods, Generic Resources, Events, etc.) ||
215+
| helm | Tools for managing Helm charts and releases ||
216+
| kiali | Most common tools for managing Kiali, check the [Kiali integration documentation](https://github.com/containers/kubernetes-mcp-server/blob/main/docs/KIALI_INTEGRATION.md) for more details. | |
217217

218218
<!-- AVAILABLE-TOOLSETS-END -->
219219

220-
See more info about Kiali integration in [docs/KIALI_INTEGRATION.md](docs/KIALI_INTEGRATION.md).
221-
222220
### Tools
223221

224222
In case multi-cluster support is enabled (default) and you have access to multiple clusters, all applicable tools will include an additional `context` argument to specify the Kubernetes context (cluster) to use for that operation.

internal/tools/update-readme/main.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"slices"
1010
"strings"
1111

12+
"github.com/containers/kubernetes-mcp-server/pkg/config"
1213
internalk8s "github.com/containers/kubernetes-mcp-server/pkg/kubernetes"
1314
"github.com/containers/kubernetes-mcp-server/pkg/toolsets"
1415

@@ -20,7 +21,7 @@ import (
2021

2122
type OpenShift struct{}
2223

23-
func (o *OpenShift) IsOpenShift(ctx context.Context) bool {
24+
func (o *OpenShift) IsOpenShift(_ context.Context) bool {
2425
return true
2526
}
2627

@@ -40,7 +41,16 @@ func main() {
4041
}
4142
// Available Toolsets
4243
toolsetsList := toolsets.Toolsets()
44+
45+
// Get default enabled toolsets
46+
defaultConfig := config.Default()
47+
defaultToolsetsMap := make(map[string]bool)
48+
for _, toolsetName := range defaultConfig.Toolsets {
49+
defaultToolsetsMap[toolsetName] = true
50+
}
51+
4352
maxNameLen, maxDescLen := len("Toolset"), len("Description")
53+
defaultHeaderLen := len("Default")
4454
for _, toolset := range toolsetsList {
4555
nameLen := len(toolset.GetName())
4656
descLen := len(toolset.GetDescription())
@@ -52,10 +62,14 @@ func main() {
5262
}
5363
}
5464
availableToolsets := strings.Builder{}
55-
availableToolsets.WriteString(fmt.Sprintf("| %-*s | %-*s |\n", maxNameLen, "Toolset", maxDescLen, "Description"))
56-
availableToolsets.WriteString(fmt.Sprintf("|-%s-|-%s-|\n", strings.Repeat("-", maxNameLen), strings.Repeat("-", maxDescLen)))
65+
availableToolsets.WriteString(fmt.Sprintf("| %-*s | %-*s | %-*s |\n", maxNameLen, "Toolset", maxDescLen, "Description", defaultHeaderLen, "Default"))
66+
availableToolsets.WriteString(fmt.Sprintf("|-%s-|-%s-|-%s-|\n", strings.Repeat("-", maxNameLen), strings.Repeat("-", maxDescLen), strings.Repeat("-", defaultHeaderLen)))
5767
for _, toolset := range toolsetsList {
58-
availableToolsets.WriteString(fmt.Sprintf("| %-*s | %-*s |\n", maxNameLen, toolset.GetName(), maxDescLen, toolset.GetDescription()))
68+
defaultIndicator := ""
69+
if defaultToolsetsMap[toolset.GetName()] {
70+
defaultIndicator = "✓"
71+
}
72+
availableToolsets.WriteString(fmt.Sprintf("| %-*s | %-*s | %-*s |\n", maxNameLen, toolset.GetName(), maxDescLen, toolset.GetDescription(), defaultHeaderLen, defaultIndicator))
5973
}
6074
updated := replaceBetweenMarkers(
6175
string(readme),

pkg/api/toolsets.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ type Toolset interface {
4040
// Used to identify the toolset in configuration, logs, and command-line arguments.
4141
// Examples: "core", "metrics", "helm"
4242
GetName() string
43+
// GetDescription returns a human-readable description of the toolset.
44+
// Will be used to generate documentation and help text.
4345
GetDescription() string
4446
GetTools(o internalk8s.Openshift) []ServerTool
4547
}

pkg/toolsets/kiali/toolset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (t *Toolset) GetName() string {
1717
}
1818

1919
func (t *Toolset) GetDescription() string {
20-
return "Most common tools for managing Kiali"
20+
return "Most common tools for managing Kiali, check the [Kiali integration documentation](https://github.com/containers/kubernetes-mcp-server/blob/main/docs/KIALI_INTEGRATION.md) for more details."
2121
}
2222

2323
func (t *Toolset) GetTools(_ internalk8s.Openshift) []api.ServerTool {

0 commit comments

Comments
 (0)