Skip to content

Commit 2f30664

Browse files
committed
Fix instructions display on MCP server edit
1 parent 1c3913b commit 2f30664

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

src/components/Agentic/IncidentTemplate/MCPServerDialog/ToolsStep/index.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,25 @@ export const ToolsStep = ({
1313
tools,
1414
selectedTools: initialSelectedTools = [],
1515
isLoading,
16+
instructions = "",
1617
error
1718
}: ToolsStepProps) => {
18-
const [textAreaValue, setTextAreaValue] = useState("");
19+
const [instructionsTextAreaValue, setInstructionsTextAreaValue] =
20+
useState(instructions);
1921
const [selectedTools, setSelectedTools] = useState(initialSelectedTools);
2022
const [searchInputValue, setSearchInputValue] = useState("");
2123

22-
const handleTextAreaChange = (e: ChangeEvent<HTMLTextAreaElement>) => {
23-
setTextAreaValue(e.target.value);
24+
const handleInstructionsTextAreaChange = (
25+
e: ChangeEvent<HTMLTextAreaElement>
26+
) => {
27+
setInstructionsTextAreaValue(e.target.value);
2428
};
2529

2630
const handleSaveButtonClick = () => {
2731
sendUserActionTrackingEvent(
2832
trackingEvents.INCIDENT_TEMPLATE_EDIT_MCP_DIALOG_SAVE_BUTTON_CLICKED
2933
);
30-
onSave(selectedTools, textAreaValue);
34+
onSave(selectedTools, instructionsTextAreaValue);
3135
};
3236

3337
const handleCancelButtonClick = () => {
@@ -95,9 +99,9 @@ export const ToolsStep = ({
9599
</s.ToolsList>
96100
)}
97101
</s.ToolsEditor>
98-
<s.TextArea
99-
value={textAreaValue}
100-
onChange={handleTextAreaChange}
102+
<s.InstructionsTextArea
103+
value={instructionsTextAreaValue}
104+
onChange={handleInstructionsTextAreaChange}
101105
placeholder={
102106
"Describe any specific instructions on how this MCP should be used"
103107
}

src/components/Agentic/IncidentTemplate/MCPServerDialog/ToolsStep/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const ToolTag = styled.div<ToolTagProps>`
9191
user-select: none;
9292
`;
9393

94-
export const TextArea = styled.textarea`
94+
export const InstructionsTextArea = styled.textarea`
9595
${({ theme }) => getCodeFont(theme.codeFont)}
9696
display: flex;
9797
flex-grow: 1;

src/components/Agentic/IncidentTemplate/MCPServerDialog/ToolsStep/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export interface ToolsStepProps {
33
onSave: (tools: string[], instructions: string) => void;
44
tools: string[];
55
selectedTools?: string[];
6+
instructions?: string;
67
isLoading?: boolean;
78
error?: string;
89
}

src/components/Agentic/IncidentTemplate/MCPServerDialog/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export const MCPServerDialog = ({
140140
onSave={handleToolsStepSave}
141141
tools={tools}
142142
selectedTools={serverData?.selected_tools}
143+
instructions={serverData?.instructions_prompt}
143144
isLoading={
144145
addMCPServerResult.isLoading || updateMCPServerResult.isLoading
145146
}

0 commit comments

Comments
 (0)