Skip to content

Commit 5337baa

Browse files
committed
Fix type error
1 parent afefcb3 commit 5337baa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

client/src/components/ToolsTab.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Button } from "@/components/ui/button";
33
import { Input } from "@/components/ui/input";
44
import { Label } from "@/components/ui/label";
55
import { TabsContent } from "@/components/ui/tabs";
6-
import { ListToolsResult, Tool } from "@modelcontextprotocol/sdk/types.js";
6+
import { CallToolResult, ListToolsResult, Tool } from "@modelcontextprotocol/sdk/types.js";
77
import { AlertCircle, Send } from "lucide-react";
88
import { useState } from "react";
99
import ListPane from "./ListPane";
@@ -35,12 +35,14 @@ const ToolsTab = ({
3535
if (!toolResult) return null;
3636

3737
if ("content" in toolResult) {
38+
const structuredResult = toolResult as CallToolResult;
39+
3840
return (
3941
<>
4042
<h4 className="font-semibold mb-2">
41-
Tool Result: {toolResult.isError ? "Error" : "Success"}
43+
Tool Result: {structuredResult.isError ? "Error" : "Success"}
4244
</h4>
43-
{toolResult.content.map((item, index) => (
45+
{structuredResult.content.map((item, index) => (
4446
<div key={index} className="mb-2">
4547
{item.type === "text" && (
4648
<pre className="bg-gray-50 p-4 rounded text-sm overflow-auto max-h-64">

0 commit comments

Comments
 (0)