@@ -13,11 +13,10 @@ import {
1313 ListToolsResult ,
1414 Tool ,
1515} from "@modelcontextprotocol/sdk/types.js" ;
16- import { AlertCircle , Copy , Send , CheckCheck } from "lucide-react" ;
17- import { useCallback , useEffect , useState } from "react" ;
16+ import { AlertCircle , Send } from "lucide-react" ;
17+ import { useEffect , useState } from "react" ;
1818import ListPane from "./ListPane" ;
1919import JsonView from "./JsonView" ;
20- import { toast } from 'react-toastify'
2120
2221const ToolsTab = ( {
2322 tools,
@@ -45,20 +44,6 @@ const ToolsTab = ({
4544 setParams ( { } ) ;
4645 } , [ selectedTool ] ) ;
4746
48- const [ copied , setCopied ] = useState ( false )
49-
50- const handleCopy = useCallback ( ( ) => {
51- try {
52- navigator . clipboard . writeText ( JSON . stringify ( toolResult ) )
53- setCopied ( true )
54- setTimeout ( ( ) => {
55- setCopied ( false )
56- } , 500 )
57- } catch ( error ) {
58- toast . error ( `There was an error coping result into the clipboard: ${ error instanceof Error ? error . message : String ( error ) } ` )
59- }
60- } , [ toolResult ] )
61-
6247 const renderToolResult = ( ) => {
6348 if ( ! toolResult ) return null ;
6449
@@ -68,8 +53,7 @@ const ToolsTab = ({
6853 return (
6954 < >
7055 < h4 className = "font-semibold mb-2" > Invalid Tool Result:</ h4 >
71- < div className = "p-4 border rounded relative" >
72- < Copy className = "size-4 text-primary" />
56+ < div className = "p-4 border rounded" >
7357 < JsonView data = { toolResult } />
7458 </ div >
7559 < h4 className = "font-semibold mb-2" > Errors:</ h4 >
@@ -92,12 +76,7 @@ const ToolsTab = ({
9276 { structuredResult . content . map ( ( item , index ) => (
9377 < div key = { index } className = "mb-2" >
9478 { item . type === "text" && (
95- < div className = "p-4 border rounded relative" >
96- < Button size = "icon" variant = "ghost" className = "absolute top-2 right-2" onClick = { handleCopy } >
97- { copied ?
98- < CheckCheck className = "size-4 dark:text-green-700 text-green-600" />
99- : < Copy className = "size-4 text-foreground" /> }
100- </ Button >
79+ < div className = "p-4 border rounded" >
10180 < JsonView data = { item . text } />
10281 </ div >
10382 ) }
@@ -255,7 +234,7 @@ const ToolsTab = ({
255234 ...params ,
256235 [ key ] :
257236 prop . type === "number" ||
258- prop . type === "integer"
237+ prop . type === "integer"
259238 ? Number ( e . target . value )
260239 : e . target . value ,
261240 } )
0 commit comments