diff --git a/client/src/components/ToolResults.tsx b/client/src/components/ToolResults.tsx index a3cecf55a..6479b5fbb 100644 --- a/client/src/components/ToolResults.tsx +++ b/client/src/components/ToolResults.tsx @@ -154,6 +154,14 @@ const ToolResults = ({ )} + {structuredResult._meta && ( +
+
Meta:
+
+ +
+
+ )} {!structuredResult.structuredContent && validationResult && !validationResult.isValid && ( diff --git a/client/src/components/ToolsTab.tsx b/client/src/components/ToolsTab.tsx index 3c7db84e4..2eb682e50 100644 --- a/client/src/components/ToolsTab.tsx +++ b/client/src/components/ToolsTab.tsx @@ -19,6 +19,10 @@ import ListPane from "./ListPane"; import JsonView from "./JsonView"; import ToolResults from "./ToolResults"; +// Type guard to safely detect the optional _meta field without using `any` +const hasMeta = (tool: Tool): tool is Tool & { _meta: unknown } => + typeof (tool as { _meta?: unknown })._meta !== "undefined"; + const ToolsTab = ({ tools, listTools, @@ -46,6 +50,7 @@ const ToolsTab = ({ const [params, setParams] = useState>({}); const [isToolRunning, setIsToolRunning] = useState(false); const [isOutputSchemaExpanded, setIsOutputSchemaExpanded] = useState(false); + const [isMetaExpanded, setIsMetaExpanded] = useState(false); useEffect(() => { const params = Object.entries( @@ -245,6 +250,40 @@ const ToolsTab = ({ )} + {selectedTool && + hasMeta(selectedTool) && + selectedTool._meta && ( +
+
+

Meta:

+ +
+
+ +
+
+ )}