Skip to content

Commit ae665b0

Browse files
committed
feat(mcp): enhance tool detail panel with dynamic title and improved description display #371
1 parent 082ebec commit ae665b0

File tree

3 files changed

+10
-23
lines changed

3 files changed

+10
-23
lines changed

core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpLlmConfigDialog.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,6 @@ class McpLlmConfigDialog(
8181
}
8282

8383
return panel {
84-
row {
85-
label("Adjust settings for the selected chatbot").applyToComponent {
86-
font = JBUI.Fonts.label(14.0f)
87-
foreground = UIUtil.getContextHelpForeground()
88-
}
89-
}
9084
row {
9185
label("Temperature: ${String.format("%.1f", config.temperature)}")
9286
}
@@ -100,9 +94,6 @@ class McpLlmConfigDialog(
10094
}
10195
})
10296
}
103-
row {
104-
comment("Lower values produce more focused outputs. Higher values produce more creative outputs.")
105-
}
10697
group("Enabled Tools") {
10798
allTools.forEach { (serverName, tools) ->
10899
tools.forEach { tool ->

core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpResultPanel.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class McpResultPanel : JPanel(BorderLayout()) {
8787
toolsPanel.add(toolPanel, gbc)
8888
}
8989

90-
// Add empty filler panel at the end
9190
val fillerPanel = JPanel()
9291
fillerPanel.isOpaque = false
9392

core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpToolDetailPanel.kt

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,15 @@ class McpToolDetailDialog(
101101
private var mainPanel: JPanel? = null
102102

103103
init {
104-
title = "Tool Details"
104+
title = "MCP Tool Detail - $serverName"
105105
init()
106106
}
107107

108108
override fun createCenterPanel(): JComponent {
109109
val mockData = MockDataGenerator.generateMockData(tool.inputSchema)
110110
val prettyJson = json.encodeToString(mockData)
111111

112-
jsonLanguageField = JsonLanguageField(
113-
project,
114-
prettyJson,
115-
"Enter parameters as JSON",
116-
"parameters.json"
117-
)
112+
jsonLanguageField = JsonLanguageField(project, prettyJson, "Enter parameters as JSON", "parameters.json")
118113

119114
resultPanel = JPanel(BorderLayout()).apply {
120115
isVisible = false
@@ -133,23 +128,25 @@ class McpToolDetailDialog(
133128
}
134129
}
135130
row {
136-
label(tool.description ?: "No description available").applyToComponent {
137-
font = JBUI.Fonts.label(14.0f)
131+
val textArea = JTextArea().apply {
132+
text = tool.description ?: "No description available"
133+
isEditable = false
134+
wrapStyleWord = true
135+
lineWrap = true
136+
background = UIUtil.getPanelBackground()
137+
border = JBUI.Borders.empty(4)
138138
}
139+
cell(textArea)
139140
}
140141

141142
group("Parameters") {
142143
tool.inputSchema.properties.forEach { param: Map.Entry<String, JsonElement> ->
143144
row {
144145
label(param.key)
145-
.applyToComponent {
146-
font = JBUI.Fonts.label(14.0f)
147-
}
148146
}
149147
row {
150148
label(param.value.toString())
151149
.applyToComponent {
152-
font = JBUI.Fonts.label(12.0f)
153150
foreground = JBColor(0x6B7280, 0x9DA0A8)
154151
}
155152
}

0 commit comments

Comments
 (0)