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"} />