Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_cjson_parse

Parse JSON strings into structured objects for use in mobile automation scripts, enabling data handling and manipulation during device control operations.

Instructions

Parse JSON string to object

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonStringYesJSON string to parse
resultVariableNoVariable name to store parsed objectjsonObj

Implementation Reference

  • The handler function that executes the tool logic: generates MQScript to parse JSON string into a variable.
    handler: async (args: { jsonString: string; resultVariable?: string }) => { const { jsonString, resultVariable = 'jsonObj' } = args; const script = `${resultVariable} = CJson.Parse("${jsonString}")`; return { content: [ { type: 'text', text: `Generated MQScript CJson parse command:\n\`\`\`\n${script}\n\`\`\`\n\nThis parses JSON string and stores result in "${resultVariable}".` } ] }; }
  • Input schema defining parameters for the tool.
    inputSchema: { type: 'object' as const, properties: { jsonString: { type: 'string', description: 'JSON string to parse' }, resultVariable: { type: 'string', description: 'Variable name to store parsed object', default: 'jsonObj' } }, required: ['jsonString'] },
  • The complete tool definition object for mqscript_cjson_parse, which is spread into the ALL_TOOLS registry in src/index.ts.
    parse: { name: 'mqscript_cjson_parse', description: 'Parse JSON string to object', inputSchema: { type: 'object' as const, properties: { jsonString: { type: 'string', description: 'JSON string to parse' }, resultVariable: { type: 'string', description: 'Variable name to store parsed object', default: 'jsonObj' } }, required: ['jsonString'] }, handler: async (args: { jsonString: string; resultVariable?: string }) => { const { jsonString, resultVariable = 'jsonObj' } = args; const script = `${resultVariable} = CJson.Parse("${jsonString}")`; return { content: [ { type: 'text', text: `Generated MQScript CJson parse command:\n\`\`\`\n${script}\n\`\`\`\n\nThis parses JSON string and stores result in "${resultVariable}".` } ] }; } },
  • src/index.ts:32-61 (registration)
    Registration of all tools including CJsonCommands (containing mqscript_cjson_parse) into the ALL_TOOLS object used by MCP server handlers.
    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, };

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