Skip to main content
Glama

send_command_to_electron

Send JavaScript commands to Electron applications using Chrome DevTools Protocol. Interact with UI elements, execute scripts, navigate routes, and debug page structures for automation and testing purposes.

Instructions

Send JavaScript commands to any running Electron application via Chrome DevTools Protocol.

Enhanced UI interaction commands:

  • 'find_elements': Analyze all interactive elements (buttons, inputs, selects) with their properties

  • 'click_by_text': Click elements by their visible text, aria-label, or title

  • 'click_by_selector': Securely click elements by CSS selector

  • 'fill_input': Fill input fields by selector, placeholder text, or associated label

  • 'select_option': Select dropdown options by value or text

  • 'send_keyboard_shortcut': Send keyboard shortcuts like 'Ctrl+N', 'Meta+N', 'Enter', 'Escape'

  • 'navigate_to_hash': Safely navigate to hash routes (e.g., '#create', '#settings')

  • 'get_page_structure': Get organized overview of page elements (buttons, inputs, selects, links)

  • 'debug_elements': Get debugging info about buttons and form elements on the page

  • 'verify_form_state': Check current form state and validation status

  • 'get_title', 'get_url', 'get_body_text': Basic page information

  • 'eval': Execute custom JavaScript code with enhanced error reporting

IMPORTANT: Arguments must be passed as an object with the correct properties:

Examples:

  • click_by_selector: {"selector": "button.submit-btn"}

  • click_by_text: {"text": "Submit"}

  • fill_input: {"placeholder": "Enter name", "value": "John Doe"}

  • fill_input: {"selector": "#email", "value": "user@example.com"}

  • send_keyboard_shortcut: {"text": "Enter"}

  • eval: {"code": "document.title"}

Use 'get_page_structure' or 'debug_elements' first to understand available elements, then use specific interaction commands.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoArguments for the command - must be an object with appropriate properties based on the command type
commandYesCommand to send to the Electron process
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by disclosing behavioral traits: it explains the enhanced UI interaction capabilities, emphasizes secure clicking ('Securely click'), safe navigation ('Safely navigate'), and enhanced error reporting for eval. However, it doesn't mention authentication needs, rate limits, or what happens on command failure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections: purpose statement, command listing, argument format explanation, examples, and usage guidance. While comprehensive, some redundancy exists (e.g., listing all commands could be more concise). Every sentence adds value, but it's slightly longer than optimal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (multiple command types, nested parameters) and no output schema, the description does well by explaining command behaviors, argument structures, and usage patterns. However, it doesn't describe return values or error responses, which would be helpful since there's no output schema. The coverage is strong but not fully complete for such a multifaceted tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds significant value by explaining the command types and their required argument structures with concrete examples. It clarifies that 'Arguments must be passed as an object with the correct properties' and provides specific mappings between commands and their parameter needs (e.g., click_by_selector requires selector, fill_input requires value).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Send JavaScript commands to any running Electron application via Chrome DevTools Protocol' - a specific verb ('Send') with clear resource ('JavaScript commands to Electron application'). It distinguishes from siblings like get_electron_window_info (info gathering), read_electron_logs (log reading), and take_screenshot (screenshot capture) by focusing on interactive command execution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use specific commands: 'Use get_page_structure or debug_elements first to understand available elements, then use specific interaction commands.' It also distinguishes between different command types (e.g., click_by_text vs click_by_selector) and provides clear examples for when to use each approach.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/halilural/electron-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server