@@ -63,23 +63,23 @@ func (s *Server) initPodmanContainer() []server.ServerTool {
63
63
}
64
64
65
65
func (s * Server ) containerInspect (_ context.Context , ctr mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
66
- return NewTextResult (s .podman .ContainerInspect (ctr .Params . Arguments ["name" ].(string ))), nil
66
+ return NewTextResult (s .podman .ContainerInspect (ctr .GetArguments () ["name" ].(string ))), nil
67
67
}
68
68
69
69
func (s * Server ) containerList (_ context.Context , _ mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
70
70
return NewTextResult (s .podman .ContainerList ()), nil
71
71
}
72
72
73
73
func (s * Server ) containerLogs (_ context.Context , ctr mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
74
- return NewTextResult (s .podman .ContainerLogs (ctr .Params . Arguments ["name" ].(string ))), nil
74
+ return NewTextResult (s .podman .ContainerLogs (ctr .GetArguments () ["name" ].(string ))), nil
75
75
}
76
76
77
77
func (s * Server ) containerRemove (_ context.Context , ctr mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
78
- return NewTextResult (s .podman .ContainerRemove (ctr .Params . Arguments ["name" ].(string ))), nil
78
+ return NewTextResult (s .podman .ContainerRemove (ctr .GetArguments () ["name" ].(string ))), nil
79
79
}
80
80
81
81
func (s * Server ) containerRun (_ context.Context , ctr mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
82
- ports := ctr .Params . Arguments ["ports" ]
82
+ ports := ctr .GetArguments () ["ports" ]
83
83
portMappings := make (map [int ]int )
84
84
if _ , ok := ports .([]interface {}); ok {
85
85
for _ , port := range ports .([]interface {}) {
@@ -93,7 +93,7 @@ func (s *Server) containerRun(_ context.Context, ctr mcp.CallToolRequest) (*mcp.
93
93
}
94
94
}
95
95
}
96
- environment := ctr .Params . Arguments ["environment" ]
96
+ environment := ctr .GetArguments () ["environment" ]
97
97
envVariables := make ([]string , 0 )
98
98
if _ , ok := environment .([]interface {}); ok && len (environment .([]interface {})) > 0 {
99
99
for _ , env := range environment .([]interface {}) {
@@ -103,9 +103,9 @@ func (s *Server) containerRun(_ context.Context, ctr mcp.CallToolRequest) (*mcp.
103
103
envVariables = append (envVariables , env .(string ))
104
104
}
105
105
}
106
- return NewTextResult (s .podman .ContainerRun (ctr .Params . Arguments ["imageName" ].(string ), portMappings , envVariables )), nil
106
+ return NewTextResult (s .podman .ContainerRun (ctr .GetArguments () ["imageName" ].(string ), portMappings , envVariables )), nil
107
107
}
108
108
109
109
func (s * Server ) containerStop (_ context.Context , ctr mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
110
- return NewTextResult (s .podman .ContainerStop (ctr .Params . Arguments ["name" ].(string ))), nil
110
+ return NewTextResult (s .podman .ContainerStop (ctr .GetArguments () ["name" ].(string ))), nil
111
111
}
0 commit comments