diff --git a/PR_DESCRIPTION.md b/PR_DESCRIPTION.md new file mode 100644 index 000000000..5a59fb051 --- /dev/null +++ b/PR_DESCRIPTION.md @@ -0,0 +1,111 @@ +# Fix: Improve parameter display and add debugging for MCP tools + +## Problem Description + +The MCP Inspector was inconsistently displaying parameters for tools with multiple parameters. Through systematic testing, we identified several issues: + +1. **Tools with 6+ parameters**: Some parameters were not displayed in the UI +2. **Tools with 3 parameters**: Some tools showed no parameter form at all, leading to immediate execution with validation errors +3. **Lack of debugging information**: No way to identify when parameters were missing from display + +## Root Cause Analysis + +- The parameter rendering logic in `ToolsTab.tsx` was mostly correct but lacked comprehensive error handling +- Edge cases in schema processing weren't being handled properly +- No visual indication when parameters might be missing from display +- Container layout issues for tools with many parameters +- Poor user experience when debugging parameter-related issues + +## Solution Implemented + +### Enhanced Parameter Rendering (`client/src/components/ToolsTab.tsx`) + +1. **Debug Logging**: Added console logging to identify tools with parameter display issues + ```javascript + console.log(`Tool ${selectedTool.name} has ${allProperties.length} parameters:`, allProperties); + ``` + +2. **Parameter Count Indicator**: Added UI element showing total parameters found vs displayed + ```tsx +
{selectedTool.description}
- {Object.entries(selectedTool.inputSchema.properties ?? []).map( - ([key, value]) => { - const prop = value as JsonSchemaType; - const inputSchema = - selectedTool.inputSchema as JsonSchemaType; - const required = isPropertyRequired(key, inputSchema); - return ( -