diff --git a/client/src/App.tsx b/client/src/App.tsx index 81ce70a3b..0ee234b59 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -525,10 +525,18 @@ const App = () => { clearError("resources"); listResources(); }} + clearResources={() => { + setResources([]); + setNextResourceCursor(undefined); + }} listResourceTemplates={() => { clearError("resources"); listResourceTemplates(); }} + clearResourceTemplates={() => { + setResourceTemplates([]); + setNextResourceTemplateCursor(undefined); + }} readResource={(uri) => { clearError("resources"); readResource(uri); @@ -549,6 +557,10 @@ const App = () => { clearError("prompts"); listPrompts(); }} + clearPrompts={() => { + setPrompts([]); + setNextPromptCursor(undefined); + }} getPrompt={(name, args) => { clearError("prompts"); getPrompt(name, args); @@ -568,6 +580,10 @@ const App = () => { clearError("tools"); listTools(); }} + clearTools={() => { + setTools([]); + setNextToolCursor(undefined); + }} callTool={(name, params) => { clearError("tools"); callTool(name, params); diff --git a/client/src/components/ListPane.tsx b/client/src/components/ListPane.tsx index 5fca6a405..90693dd29 100644 --- a/client/src/components/ListPane.tsx +++ b/client/src/components/ListPane.tsx @@ -3,6 +3,7 @@ import { Button } from "./ui/button"; type ListPaneProps = { items: T[]; listItems: () => void; + clearItems: () => void; setSelectedItem: (item: T) => void; renderItem: (item: T) => React.ReactNode; title: string; @@ -13,6 +14,7 @@ type ListPaneProps = { const ListPane = ({ items, listItems, + clearItems, setSelectedItem, renderItem, title, @@ -32,6 +34,14 @@ const ListPane = ({ > {buttonText} +
{items.map((item, index) => (
void; + clearPrompts: () => void; getPrompt: (name: string, args: Record) => void; selectedPrompt: Prompt | null; setSelectedPrompt: (prompt: Prompt) => void; @@ -55,6 +57,7 @@ const PromptsTab = ({ { setSelectedPrompt(prompt); setPromptArgs({}); diff --git a/client/src/components/ResourcesTab.tsx b/client/src/components/ResourcesTab.tsx index b1224f1ae..e94888118 100644 --- a/client/src/components/ResourcesTab.tsx +++ b/client/src/components/ResourcesTab.tsx @@ -16,7 +16,9 @@ const ResourcesTab = ({ resources, resourceTemplates, listResources, + clearResources, listResourceTemplates, + clearResourceTemplates, readResource, selectedResource, setSelectedResource, @@ -28,7 +30,9 @@ const ResourcesTab = ({ resources: Resource[]; resourceTemplates: ResourceTemplate[]; listResources: () => void; + clearResources: () => void; listResourceTemplates: () => void; + clearResourceTemplates: () => void; readResource: (uri: string) => void; selectedResource: Resource | null; setSelectedResource: (resource: Resource | null) => void; @@ -68,6 +72,7 @@ const ResourcesTab = ({ { setSelectedResource(resource); readResource(resource.uri); @@ -90,6 +95,7 @@ const ResourcesTab = ({ { setSelectedTemplate(template); setSelectedResource(null); diff --git a/client/src/components/ToolsTab.tsx b/client/src/components/ToolsTab.tsx index 7b85ccca6..1113ebc1a 100644 --- a/client/src/components/ToolsTab.tsx +++ b/client/src/components/ToolsTab.tsx @@ -18,6 +18,7 @@ import { CompatibilityCallToolResult } from "@modelcontextprotocol/sdk/types.js" const ToolsTab = ({ tools, listTools, + clearTools, callTool, selectedTool, setSelectedTool, @@ -27,6 +28,7 @@ const ToolsTab = ({ }: { tools: Tool[]; listTools: () => void; + clearTools: () => void; callTool: (name: string, params: Record) => void; selectedTool: Tool | null; setSelectedTool: (tool: Tool) => void; @@ -50,7 +52,7 @@ const ToolsTab = ({

Errors:

{parsedResult.error.errors.map((error, idx) => ( -
@@ -108,6 +110,7 @@ const ToolsTab = ({
        (
           <>