@@ -22,6 +22,8 @@ import { SESSION_KEYS, getServerSpecificKey } from "./lib/constants";
22
22
import { AuthDebuggerState , EMPTY_DEBUGGER_STATE } from "./lib/auth-types" ;
23
23
import { OAuthStateMachine } from "./lib/oauth-state-machine" ;
24
24
import { cacheToolOutputSchemas } from "./utils/schemaUtils" ;
25
+ import { cleanParams } from "./utils/paramUtils" ;
26
+ import type { JsonSchemaType } from "./utils/jsonUtils" ;
25
27
import React , {
26
28
Suspense ,
27
29
useCallback ,
@@ -771,12 +773,18 @@ const App = () => {
771
773
lastToolCallOriginTabRef . current = currentTabRef . current ;
772
774
773
775
try {
776
+ // Find the tool schema to clean parameters properly
777
+ const tool = tools . find ( ( t ) => t . name === name ) ;
778
+ const cleanedParams = tool ?. inputSchema
779
+ ? cleanParams ( params , tool . inputSchema as JsonSchemaType )
780
+ : params ;
781
+
774
782
const response = await sendMCPRequest (
775
783
{
776
784
method : "tools/call" as const ,
777
785
params : {
778
786
name,
779
- arguments : params ,
787
+ arguments : cleanedParams ,
780
788
_meta : {
781
789
progressToken : progressTokenRef . current ++ ,
782
790
} ,
@@ -787,6 +795,8 @@ const App = () => {
787
795
) ;
788
796
789
797
setToolResult ( response ) ;
798
+ // Clear any validation errors since tool execution completed
799
+ setErrors ( ( prev ) => ( { ...prev , tools : null } ) ) ;
790
800
} catch ( e ) {
791
801
const toolResult : CompatibilityCallToolResult = {
792
802
content : [
@@ -798,6 +808,8 @@ const App = () => {
798
808
isError : true ,
799
809
} ;
800
810
setToolResult ( toolResult ) ;
811
+ // Clear validation errors - tool execution errors are shown in ToolResults
812
+ setErrors ( ( prev ) => ( { ...prev , tools : null } ) ) ;
801
813
}
802
814
} ;
803
815
0 commit comments