From f64a7ea6e376f7cbc394143f55ab5e1d07410c33 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Mon, 23 Feb 2026 11:15:53 -0500 Subject: [PATCH] Fix review issues from Claude's code review - Default taskSupport fallback to "forbidden" per MCP spec (was "optional") - Fix import path to use @/ alias consistently - Fix misleading "type guard" comment on getTaskSupport - Extract getTaskSupport to a variable to avoid duplicate calls in render - Export ExtendedTool and import in tests instead of duplicating Co-Authored-By: Claude Opus 4.6 --- client/src/components/ToolsTab.tsx | 14 ++++++++------ client/src/components/__tests__/ToolsTab.test.tsx | 9 +-------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/client/src/components/ToolsTab.tsx b/client/src/components/ToolsTab.tsx index 6f823615..ac898235 100644 --- a/client/src/components/ToolsTab.tsx +++ b/client/src/components/ToolsTab.tsx @@ -51,12 +51,12 @@ import { hasValidMetaName, hasValidMetaPrefix, isReservedMetaKey, -} from "../utils/metaUtils"; +} from "@/utils/metaUtils"; /** * Extended Tool type that includes optional fields used by the inspector. */ -interface ExtendedTool extends Tool, WithIcons { +export interface ExtendedTool extends Tool, WithIcons { _meta?: Record; execution?: { taskSupport?: "forbidden" | "required" | "optional"; @@ -69,7 +69,7 @@ const hasMeta = ( ): tool is ExtendedTool & { _meta: Record } => typeof (tool as ExtendedTool)._meta !== "undefined"; -// Type guard to detect execution.taskSupport +// Returns the execution.taskSupport value for a tool, defaulting to "forbidden" per MCP spec const getTaskSupport = ( tool: Tool | null, ): "forbidden" | "required" | "optional" => { @@ -83,7 +83,7 @@ const getTaskSupport = ( ) { return taskSupport; } - return "optional"; + return "forbidden"; }; // Type guard to safely detect the optional annotations field @@ -264,6 +264,8 @@ const ToolsTab = ({ return trimmedKey !== "" && !hasValidMetaName(trimmedKey); }); + const taskSupport = getTaskSupport(selectedTool); + return (
@@ -777,7 +779,7 @@ const ToolsTab = ({
)} - {getTaskSupport(selectedTool) !== "forbidden" && ( + {taskSupport !== "forbidden" && (
setRunAsTask(checked) } - disabled={getTaskSupport(selectedTool) === "required"} + disabled={taskSupport === "required"} />