Skip to content

Commit 7a0cb26

Browse files
feat(DATAGO-118768): Support remote MCP server configuration in sam add agent --gui (#735)
* feat: new ui * fix: config file formatting bugs * fix: remove oauth2 configuration, alter headers * fix: remove duplicate env variables input * fix: remove blocking deletion, description * fix: copilot requests * fix: remove redundant deletion logic * chore: log message * Cleanup of orginal change. * Updated help text * revert help text back to original --------- Co-authored-by: Robert Zuchniak <[email protected]>
1 parent f85d698 commit 7a0cb26

File tree

6 files changed

+823
-172
lines changed

6 files changed

+823
-172
lines changed

cli/commands/add_cmd/agent_cmd.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
import click
66
import yaml
77

8-
from config_portal.backend.common import AGENT_DEFAULTS, USE_DEFAULT_SHARED_ARTIFACT, USE_DEFAULT_SHARED_SESSION
8+
from config_portal.backend.common import (
9+
AGENT_DEFAULTS,
10+
USE_DEFAULT_SHARED_ARTIFACT,
11+
USE_DEFAULT_SHARED_SESSION,
12+
)
913

1014
from ...utils import (
1115
ask_if_not_provided,
@@ -143,6 +147,7 @@ def _write_agent_yaml_from_data(
143147
Dumper=yaml.SafeDumper,
144148
default_flow_style=False,
145149
indent=2,
150+
sort_keys=False,
146151
).strip()
147152

148153
if "\n" in tools_replacement_value:

config_portal/frontend/app/components/AddAgentFlow.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,17 @@ const AgentReviewSubmitStep: React.FC<StepProps> = ({
111111
if (Array.isArray(processedConfig.tools)) {
112112
processedConfig.tools = processedConfig.tools
113113
.map((toolInstance) => {
114-
const cleanTool: Partial<Tool> = {};
115-
if (toolInstance.tool_type)
116-
cleanTool.tool_type = toolInstance.tool_type;
114+
if (!toolInstance.tool_type) {
115+
console.error("Tool is missing tool_type:", toolInstance);
116+
return null;
117+
}
118+
119+
// Build tool with explicit field ordering - tool_type MUST be first
120+
const cleanTool: Record<string, any> = {
121+
tool_type: toolInstance.tool_type,
122+
};
123+
124+
// Add other fields in a specific order after tool_type
117125
if (toolInstance.tool_name)
118126
cleanTool.tool_name = toolInstance.tool_name;
119127
if (toolInstance.tool_description)
@@ -139,10 +147,6 @@ const AgentReviewSubmitStep: React.FC<StepProps> = ({
139147
if (toolInstance.tool_config)
140148
cleanTool.tool_config = toolInstance.tool_config;
141149

142-
if (!cleanTool.tool_type) {
143-
console.error("Tool is missing tool_type:", toolInstance);
144-
return null;
145-
}
146150
return cleanTool as Tool;
147151
})
148152
.filter((tool) => tool !== null) as Tool[];

0 commit comments

Comments
 (0)