You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/mcp/resources.go
+62-11Lines changed: 62 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,25 @@ func (s *Sever) initResources() {
25
25
mcp.Description("Optional Namespace to retrieve the namespaced resources from (ignored in case of cluster scoped resources). If not provided, will list resources from all namespaces"),
26
26
),
27
27
), resourcesList)
28
+
s.server.AddTool(mcp.NewTool(
29
+
"resources_get",
30
+
mcp.WithDescription("Get a Kubernetes resource in the current cluster by providing its apiVersion, kind, optionally the namespace, and its name"),
31
+
mcp.WithString("apiVersion",
32
+
mcp.Description("apiVersion of the resource (examples of valid apiVersion are: v1, apps/v1, networking.k8s.io/v1)"),
33
+
mcp.Required(),
34
+
),
35
+
mcp.WithString("kind",
36
+
mcp.Description("kind of the resource (examples of valid kind are: Pod, Service, Deployment, Ingress)"),
37
+
mcp.Required(),
38
+
),
39
+
mcp.WithString("namespace",
40
+
mcp.Description("Optional Namespace to retrieve the namespaced resource from (ignored in case of cluster scoped resources). If not provided, will get resource from configured namespace"),
41
+
),
42
+
mcp.WithString("name",
43
+
mcp.Description("Name of the resource"),
44
+
mcp.Required(),
45
+
),
46
+
), resourcesGet)
28
47
s.server.AddTool(mcp.NewTool(
29
48
"resources_create_or_update",
30
49
mcp.WithDescription("Create or update a Kubernetes resource in the current cluster by providing a YAML or JSON representation of the resource"),
@@ -38,27 +57,43 @@ func (s *Sever) initResources() {
iftoolResult.Content[0].(map[string]interface{})["text"].(string) !=`failed to get resource: no matches for kind "Custom" in version "custom.non.existent.example.com/v1"` {
0 commit comments