Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_element_settext

Set text content to UI elements in mobile automation scripts using element IDs or selectors to populate fields and update interface components.

Instructions

Set text to UI element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementIdYesElement ID or selector
textYesText to set

Implementation Reference

  • The handler function that generates MQScript code `Element.SetText(elementId, text)` and returns a formatted text response describing the generated script.
    handler: async (args: { elementId: string; text: string }) => { const { elementId, text } = args; const script = `Element.SetText("${elementId}", "${text}")`; return { content: [ { type: 'text', text: `Generated MQScript set element text command:\n\`\`\`\n${script}\n\`\`\`\n\nThis sets text of element "${elementId}" to "${text}".` } ] }; }
  • Input schema defining the required 'elementId' (string) and 'text' (string) parameters for the tool.
    inputSchema: { type: 'object' as const, properties: { elementId: { type: 'string', description: 'Element ID or selector' }, text: { type: 'string', description: 'Text to set' } }, required: ['elementId', 'text'] },
  • The complete tool definition object for 'mqscript_element_settext' within ElementCommands, which is imported and registered in the MCP server.
    setText: { name: 'mqscript_element_settext', description: 'Set text to UI element', inputSchema: { type: 'object' as const, properties: { elementId: { type: 'string', description: 'Element ID or selector' }, text: { type: 'string', description: 'Text to set' } }, required: ['elementId', 'text'] }, handler: async (args: { elementId: string; text: string }) => { const { elementId, text } = args; const script = `Element.SetText("${elementId}", "${text}")`; return { content: [ { type: 'text', text: `Generated MQScript set element text command:\n\`\`\`\n${script}\n\`\`\`\n\nThis sets text of element "${elementId}" to "${text}".` } ] }; } },
  • src/index.ts:50-54 (registration)
    Registration of ElementCommands (containing the tool) into the ALL_TOOLS registry used by the MCP server for tool listing and execution.
    // Extension Commands - 扩展命令 ...ElementCommands, ...DeviceCommands, ...PhoneCommands, ...SysCommands,
  • src/index.ts:15-15 (registration)
    Import of ElementCommands from extension-commands.ts into the main MCP server index.ts.
    import { ElementCommands, DeviceCommands, PhoneCommands, SysCommands } from './tools/extension-commands.js';

Other 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/allegiant/MQScript_MCP'

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