                             }
                            })
                            .catch(error => {
                                console.error('Error executing tool:', error);
                                showNotification('Error executing tool', true);
                                
                                // Reset button
                                button.textContent = originalText;
                                button.disabled = false;
                            });
        