FileWrite writes a file to an environment via MCP
(envID, targetFile, contents, explanation string)
| 155 | |
| 156 | // FileWrite writes a file to an environment via MCP |
| 157 | func (s *MCPServerProcess) FileWrite(envID, targetFile, contents, explanation string) error { |
| 158 | ctx := context.Background() |
| 159 | |
| 160 | request := mcp.CallToolRequest{} |
| 161 | request.Params.Name = "environment_file_write" |
| 162 | request.Params.Arguments = map[string]any{ |
| 163 | "environment_source": s.repoDir, |
| 164 | "environment_id": envID, |
| 165 | "target_file": targetFile, |
| 166 | "contents": contents, |
| 167 | "explanation": explanation, |
| 168 | } |
| 169 | |
| 170 | _, err := s.client.CallTool(ctx, request) |
| 171 | return err |
| 172 | } |
| 173 | |
| 174 | // RunCommand executes a command in an environment via MCP |
| 175 | func (s *MCPServerProcess) RunCommand(envID, command, explanation string) (string, error) { |
no outgoing calls
no test coverage detected