Skip to content

Commit de71fb9

Browse files
authored
Merge branch 'main' into auth-fix
2 parents 0da5bc2 + cd2b787 commit de71fb9

File tree

9 files changed

+1302
-513
lines changed

9 files changed

+1302
-513
lines changed

client/src/App.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { SESSION_KEYS, getServerSpecificKey } from "./lib/constants";
2222
import { AuthDebuggerState, EMPTY_DEBUGGER_STATE } from "./lib/auth-types";
2323
import { OAuthStateMachine } from "./lib/oauth-state-machine";
2424
import { cacheToolOutputSchemas } from "./utils/schemaUtils";
25+
import { cleanParams } from "./utils/paramUtils";
26+
import type { JsonSchemaType } from "./utils/jsonUtils";
2527
import React, {
2628
Suspense,
2729
useCallback,
@@ -771,12 +773,18 @@ const App = () => {
771773
lastToolCallOriginTabRef.current = currentTabRef.current;
772774

773775
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+
774782
const response = await sendMCPRequest(
775783
{
776784
method: "tools/call" as const,
777785
params: {
778786
name,
779-
arguments: params,
787+
arguments: cleanedParams,
780788
_meta: {
781789
progressToken: progressTokenRef.current++,
782790
},
@@ -787,6 +795,8 @@ const App = () => {
787795
);
788796

789797
setToolResult(response);
798+
// Clear any validation errors since tool execution completed
799+
setErrors((prev) => ({ ...prev, tools: null }));
790800
} catch (e) {
791801
const toolResult: CompatibilityCallToolResult = {
792802
content: [
@@ -798,6 +808,8 @@ const App = () => {
798808
isError: true,
799809
};
800810
setToolResult(toolResult);
811+
// Clear validation errors - tool execution errors are shown in ToolResults
812+
setErrors((prev) => ({ ...prev, tools: null }));
801813
}
802814
};
803815

0 commit comments

Comments
 (0)