File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import {
1010 CallToolResultSchema ,
1111} from "@modelcontextprotocol/sdk/types.js" ;
1212import { AlertCircle , Send } from "lucide-react" ;
13- import { useState } from "react" ;
13+ import { useEffect , useState } from "react" ;
1414import ListPane from "./ListPane" ;
1515
1616import { CompatibilityCallToolResult } from "@modelcontextprotocol/sdk/types.js" ;
@@ -31,12 +31,15 @@ const ToolsTab = ({
3131 clearTools : ( ) => void ;
3232 callTool : ( name : string , params : Record < string , unknown > ) => void ;
3333 selectedTool : Tool | null ;
34- setSelectedTool : ( tool : Tool ) => void ;
34+ setSelectedTool : ( tool : Tool | null ) => void ;
3535 toolResult : CompatibilityCallToolResult | null ;
3636 nextCursor : ListToolsResult [ "nextCursor" ] ;
3737 error : string | null ;
3838} ) => {
3939 const [ params , setParams ] = useState < Record < string , unknown > > ( { } ) ;
40+ useEffect ( ( ) => {
41+ setParams ( { } ) ;
42+ } , [ selectedTool ] ) ;
4043
4144 const renderToolResult = ( ) => {
4245 if ( ! toolResult ) return null ;
@@ -110,7 +113,10 @@ const ToolsTab = ({
110113 < ListPane
111114 items = { tools }
112115 listItems = { listTools }
113- clearItems = { clearTools }
116+ clearItems = { ( ) => {
117+ clearTools ( ) ;
118+ setSelectedTool ( null ) ;
119+ } }
114120 setSelectedItem = { setSelectedTool }
115121 renderItem = { ( tool ) => (
116122 < >
You can’t perform that action at this time.
0 commit comments