Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_cjson_get

Extract specific values from JSON objects using property paths for use in mobile automation scripts, enabling precise data retrieval during device control operations.

Instructions

Get value from JSON object

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
objectVariableYesJSON object variable name
pathYesProperty path (e.g., "data.items[0].name")
resultVariableNoVariable name to store resultvalue

Implementation Reference

  • The handler function that implements the core logic of the mqscript_cjson_get tool. It constructs an MQScript command to retrieve a value from a JSON object at the specified path and returns a formatted response.
    handler: async (args: { objectVariable: string; path: string; resultVariable?: string }) => { const { objectVariable, path, resultVariable = 'value' } = args; const script = `${resultVariable} = CJson.Get(${objectVariable}, "${path}")`; return { content: [ { type: 'text', text: `Generated MQScript CJson get command:\n\`\`\`\n${script}\n\`\`\`\n\nThis gets value at path "${path}" from object "${objectVariable}".` } ] }; }
  • The input schema defining the parameters for the mqscript_cjson_get tool: required objectVariable and path, optional resultVariable.
    inputSchema: { type: 'object' as const, properties: { objectVariable: { type: 'string', description: 'JSON object variable name' }, path: { type: 'string', description: 'Property path (e.g., "data.items[0].name")' }, resultVariable: { type: 'string', description: 'Variable name to store result', default: 'value' } }, required: ['objectVariable', 'path'] },
  • The complete tool object definition for mqscript_cjson_get as part of CJsonCommands.get object.
    get: { name: 'mqscript_cjson_get', description: 'Get value from JSON object', inputSchema: { type: 'object' as const, properties: { objectVariable: { type: 'string', description: 'JSON object variable name' }, path: { type: 'string', description: 'Property path (e.g., "data.items[0].name")' }, resultVariable: { type: 'string', description: 'Variable name to store result', default: 'value' } }, required: ['objectVariable', 'path'] }, handler: async (args: { objectVariable: string; path: string; resultVariable?: string }) => { const { objectVariable, path, resultVariable = 'value' } = args; const script = `${resultVariable} = CJson.Get(${objectVariable}, "${path}")`; return { content: [ { type: 'text', text: `Generated MQScript CJson get command:\n\`\`\`\n${script}\n\`\`\`\n\nThis gets value at path "${path}" from object "${objectVariable}".` } ] }; } },
  • src/index.ts:56-60 (registration)
    Registration of mqscript_cjson_get by spreading CJsonCommands into the central ALL_TOOLS registry used by the MCP server for tool listing and execution.
    // 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