Skip to main content
Glama

fill

Enter text into form fields using CSS selectors or element references to automate desktop application testing and interaction.

Instructions

Fill input by ref or selector

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoRef from snapshot
selectorNoCSS selector
valueYesValue
windowNoWindow label (default: focused window)

Implementation Reference

  • The main tool handler for the 'fill' command that validates input (requires ref or selector) and delegates to socketManager.fill()
    fill: async (args: { ref?: number; selector?: string; value: string; window?: string }) => { if (!args.ref && !args.selector) { throw new Error('Either ref or selector must be provided'); } const result = await socketManager.fill(args); return { content: [ { type: 'text' as const, text: result, }, ], }; },
  • Tool schema definition using Zod validation defining the fill tool's name, description, and input parameters (ref, selector, value, window)
    fill: { name: 'fill', description: 'Fill input by ref or selector', inputSchema: z.object({ ref: z.number().optional().describe('Ref from snapshot'), selector: z.string().optional().describe('CSS selector'), value: z.string().describe('Value'), window: z.string().optional().describe('Window label (default: focused window)'), }), },
  • The SocketManager.fill method that sends the 'fill' command to the Tauri app via JSON-RPC socket communication and returns a formatted result message
    async fill(options: { ref?: number; selector?: string; value: string; window?: string }): Promise<string> { const result = await this.sendCommand('fill', options) as { success: boolean; error?: string }; if (!result.success) { throw new Error(result.error || 'Fill failed'); } const target = options.ref ? `ref=${options.ref}` : options.selector; const windowInfo = options.window ? ` in window '${options.window}'` : ''; return `Filled ${target} with "${options.value}"${windowInfo}`; }
  • The 'fill' tool is registered in the DEFAULT_ESSENTIAL_TOOLS array, making it one of the core tools always available in the MCP server
    const DEFAULT_ESSENTIAL_TOOLS = [ 'app_status', 'launch_app', 'stop_app', 'snapshot', 'click', 'fill', 'screenshot', 'navigate', ];

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/DaveDev42/tauri-plugin-mcp'

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