Skip to content

Commit f9cb2c1

Browse files
authored
Merge pull request modelcontextprotocol#241 from NicolasMontone/main
Do not remove form on error in tool call tab.
2 parents affd207 + 80f2986 commit f9cb2c1

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

client/src/components/ToolsTab.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
1+
import { Alert, AlertDescription } from "@/components/ui/alert";
22
import { Button } from "@/components/ui/button";
33
import { Checkbox } from "@/components/ui/checkbox";
44
import { Input } from "@/components/ui/input";
@@ -13,7 +13,7 @@ import {
1313
ListToolsResult,
1414
Tool,
1515
} from "@modelcontextprotocol/sdk/types.js";
16-
import { AlertCircle, Send } from "lucide-react";
16+
import { Send } from "lucide-react";
1717
import { useEffect, useState } from "react";
1818
import ListPane from "./ListPane";
1919
import JsonView from "./JsonView";
@@ -27,7 +27,6 @@ const ToolsTab = ({
2727
setSelectedTool,
2828
toolResult,
2929
nextCursor,
30-
error,
3130
}: {
3231
tools: Tool[];
3332
listTools: () => void;
@@ -147,13 +146,7 @@ const ToolsTab = ({
147146
</h3>
148147
</div>
149148
<div className="p-4">
150-
{error ? (
151-
<Alert variant="destructive">
152-
<AlertCircle className="h-4 w-4" />
153-
<AlertTitle>Error</AlertTitle>
154-
<AlertDescription>{error}</AlertDescription>
155-
</Alert>
156-
) : selectedTool ? (
149+
{selectedTool ? (
157150
<div className="space-y-4">
158151
<p className="text-sm text-gray-600">
159152
{selectedTool.description}

client/src/components/__tests__/ToolsTab.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { render, screen, fireEvent } from "@testing-library/react";
22
import { describe, it, expect, jest } from "@jest/globals";
3+
import "@testing-library/jest-dom";
34
import ToolsTab from "../ToolsTab";
45
import { Tool } from "@modelcontextprotocol/sdk/types.js";
56
import { Tabs } from "@/components/ui/tabs";
@@ -79,7 +80,6 @@ describe("ToolsTab", () => {
7980
const newInput = screen.getByRole("spinbutton") as HTMLInputElement;
8081
expect(newInput.value).toBe("");
8182
});
82-
8383
it("should handle integer type inputs", () => {
8484
renderToolsTab({
8585
selectedTool: mockTools[1], // Use the tool with integer type

0 commit comments

Comments
 (0)