File tree Expand file tree Collapse file tree 2 files changed +5
-27
lines changed
Expand file tree Collapse file tree 2 files changed +5
-27
lines changed Original file line number Diff line number Diff line change @@ -472,6 +472,9 @@ const ToolsTab = ({
472472 ) }
473473 < Button
474474 onClick = { async ( ) => {
475+ // Validate JSON inputs before calling tool
476+ if ( checkValidationErrors ( ) ) return ;
477+
475478 try {
476479 setIsToolRunning ( true ) ;
477480 const meta = metaEntries . reduce < Record < string , unknown > > (
@@ -490,7 +493,7 @@ const ToolsTab = ({
490493 setIsToolRunning ( false ) ;
491494 }
492495 } }
493- disabled = { isToolRunning }
496+ disabled = { isToolRunning || hasValidationErrors }
494497 >
495498 { isToolRunning ? (
496499 < >
@@ -505,32 +508,6 @@ const ToolsTab = ({
505508 ) }
506509 </ Button >
507510 < div className = "flex gap-2" >
508- < Button
509- onClick = { async ( ) => {
510- // Validate JSON inputs before calling tool
511- if ( checkValidationErrors ( ) ) return ;
512-
513- try {
514- setIsToolRunning ( true ) ;
515- await callTool ( selectedTool . name , params ) ;
516- } finally {
517- setIsToolRunning ( false ) ;
518- }
519- } }
520- disabled = { isToolRunning || hasValidationErrors }
521- >
522- { isToolRunning ? (
523- < >
524- < Loader2 className = "w-4 h-4 mr-2 animate-spin" />
525- Running...
526- </ >
527- ) : (
528- < >
529- < Send className = "w-4 h-4 mr-2" />
530- Run Tool
531- </ >
532- ) }
533- </ Button >
534511 < Button
535512 onClick = { async ( ) => {
536513 try {
Original file line number Diff line number Diff line change @@ -835,6 +835,7 @@ describe("ToolsTab", () => {
835835 message : "test message" ,
836836 count : 5 ,
837837 } ,
838+ undefined ,
838839 ) ;
839840 } ) ;
840841
You can’t perform that action at this time.
0 commit comments