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';
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action but lacks behavioral details: it doesn't disclose if this requires specific permissions, whether it's destructive (likely yes, as it sets text), error conditions, or side effects. The description is minimal and misses key operational context.

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 a single, efficient sentence with no wasted words. It's front-loaded and direct, though it could benefit from more detail without sacrificing brevity.

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

Completeness2/5

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

Given no annotations, no output schema, and a mutation tool (implied by 'set'), the description is incomplete. It doesn't cover behavioral traits, return values, or usage context, leaving significant gaps for an AI agent to understand and invoke the tool correctly.

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

Parameters3/5

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

Schema description coverage is 100%, with clear parameter descriptions in the schema. The description adds no additional meaning beyond the schema, such as format examples or constraints. Baseline 3 is appropriate since the schema adequately documents parameters.

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

Purpose3/5

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

The description 'Set text to UI element' clearly indicates the action (set) and target (UI element), but it's vague about scope and lacks differentiation from siblings like mqscript_element_gettext. It doesn't specify what type of UI elements or context (e.g., mobile automation, web interface).

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives is provided. It doesn't mention prerequisites (e.g., needing an element ID from another tool), compare to siblings like mqscript_element_gettext, or specify contexts where it's appropriate.

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

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