Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_cint

Converts string values to integers for use in mobile automation scripts, enabling numerical operations and data processing in device control workflows.

Instructions

Convert value to integer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultVariableNoVariable name to store resultresult
valueYesValue to convert to integer

Implementation Reference

  • The handler function that implements the core logic of the 'mqscript_cint' tool. It takes a value and optional resultVariable, generates MQScript code using CInt for integer conversion, and returns a formatted text response with the generated script.
    handler: async (args: { value: string; resultVariable?: string }) => {
      const { value, resultVariable = 'result' } = args;
      const script = `${resultVariable} = CInt(${value})`;
      return {
        content: [
          {
            type: 'text',
            text: `Generated MQScript integer conversion:\n\`\`\`\n${script}\n\`\`\`\n\nThis converts ${value} to integer.`
          }
        ]
      };
    }
  • The input schema defining the parameters for the 'mqscript_cint' tool: required 'value' string and optional 'resultVariable'.
    inputSchema: {
      type: 'object' as const,
      properties: {
        value: {
          type: 'string',
          description: 'Value to convert to integer'
        },
        resultVariable: {
          type: 'string',
          description: 'Variable name to store result',
          default: 'result'
        }
      },
      required: ['value']
    },
  • src/index.ts:32-61 (registration)
    The ALL_TOOLS object spreads TypeConversionFunctions (containing mqscript_cint) into the central tools registry used by listTools and callTool handlers for MCP server registration.
    const ALL_TOOLS = {
      // Basic Commands - 基础命令
      ...TouchCommands,
      ...ControlCommands,
      ...ColorCommands,
      ...OtherCommands,
      
      // Standard Library - 标准库函数
      ...MathFunctions,
      ...StringFunctions,
      ...TypeConversionFunctions,
      ...ArrayFunctions,
      
      // UI Commands - 界面命令
      ...UIControlCommands,
      ...UIPropertyCommands,
      ...FloatingWindowCommands,
      
      // Extension Commands - 扩展命令
      ...ElementCommands,
      ...DeviceCommands,
      ...PhoneCommands,
      ...SysCommands,
      
      // Plugin Commands - 插件命令
      ...CJsonCommands,
      ...DateTimeCommands,
      ...FileCommands,
      ...TuringCommands,
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Convert value to integer' implies a transformation operation but doesn't specify error handling (what happens with non-convertible strings like 'abc'), whether the operation is destructive to the original value, or what permissions might be required. This leaves significant behavioral questions unanswered.

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

Conciseness5/5

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

The description is extremely concise at just three words, front-loading the core functionality with zero wasted language. Every word earns its place by communicating the essential purpose without unnecessary elaboration.

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 and no output schema, the description is insufficiently complete. It doesn't explain what the tool returns (the converted integer value), how errors are handled, or provide context about the conversion process (e.g., base interpretation, truncation behavior). For a type conversion tool in a scripting environment, this leaves too many practical questions unanswered.

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?

The schema description coverage is 100%, with both parameters ('value' and 'resultVariable') clearly documented in the schema. The description adds no additional parameter information beyond what's already in the structured schema, so it meets the baseline score when schema coverage is complete.

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

Purpose4/5

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

The description 'Convert value to integer' clearly states the tool's function with a specific verb ('Convert') and resource ('value to integer'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'mqscript_cbool' or 'mqscript_cstr' which perform similar type conversions, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'mqscript_cbool' (convert to boolean) and 'mqscript_cstr' (convert to string), there's no indication of when integer conversion is appropriate or what happens with non-numeric input values.

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