Skip to content

Commit 3951732

Browse files
committed
Tool calling UI looking ok
1 parent 0726f26 commit 3951732

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/inspector/src/components/McpServers.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export function McpServers({
254254
return (
255255
<input
256256
type="number"
257-
className="w-32 p-2 pr-6 mr-3 border border-gray-200 rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-300 placeholder-gray-300"
257+
className="w-32 p-2 pr-6 border border-gray-200 rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-300 placeholder-gray-300"
258258
value={value}
259259
step={schema.type === 'integer' ? 1 : 'any'}
260260
required={isRequired}
@@ -381,11 +381,12 @@ export function McpServers({
381381

382382
{/* Form for tool parameters */}
383383
{tool.inputSchema && tool.inputSchema.properties && (
384-
<div className="space-y-3 mb-4">
384+
<div className="flex flex-wrap gap-3 mb-4">
385385
{Object.entries(tool.inputSchema.properties).map(([fieldName, schema]: [string, any]) => {
386386
const isRequired = tool.inputSchema.required?.includes(fieldName) || false
387+
const isTextInput = schema.type !== 'number' && schema.type !== 'integer' && schema.type !== 'boolean'
387388
return (
388-
<div key={fieldName} className="space-y-1">
389+
<div key={fieldName} className={`space-y-1 ${isTextInput ? 'w-full' : ''}`}>
389390
<div className="flex items-center gap-2">
390391
<label className="text-xs font-medium text-gray-700">
391392
{fieldName}
@@ -399,7 +400,7 @@ export function McpServers({
399400
</div>
400401
)}
401402
</div>
402-
<div className={schema.type === 'number' || schema.type === 'integer' ? 'inline-block' : ''}>
403+
<div>
403404
{renderFormField(tool.name, fieldName, schema, isRequired)}
404405
</div>
405406
</div>

0 commit comments

Comments
 (0)