From 5337baa116877739c81a05b70dfad33d658acdd5 Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Thu, 7 Nov 2024 15:35:55 +0000 Subject: [PATCH] Fix type error --- client/src/components/ToolsTab.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/components/ToolsTab.tsx b/client/src/components/ToolsTab.tsx index 3334122..4c6e097 100644 --- a/client/src/components/ToolsTab.tsx +++ b/client/src/components/ToolsTab.tsx @@ -3,7 +3,7 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { TabsContent } from "@/components/ui/tabs"; -import { ListToolsResult, Tool } from "@modelcontextprotocol/sdk/types.js"; +import { CallToolResult, ListToolsResult, Tool } from "@modelcontextprotocol/sdk/types.js"; import { AlertCircle, Send } from "lucide-react"; import { useState } from "react"; import ListPane from "./ListPane"; @@ -35,12 +35,14 @@ const ToolsTab = ({ if (!toolResult) return null; if ("content" in toolResult) { + const structuredResult = toolResult as CallToolResult; + return ( <>

- Tool Result: {toolResult.isError ? "Error" : "Success"} + Tool Result: {structuredResult.isError ? "Error" : "Success"}

- {toolResult.content.map((item, index) => ( + {structuredResult.content.map((item, index) => (
{item.type === "text" && (