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,
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. 'Get value from JSON object' implies a read-only operation, but it doesn't specify error handling (e.g., what happens if the path doesn't exist), performance characteristics, or side effects like variable storage. For a tool with 3 parameters and no annotations, this leaves significant gaps in understanding its behavior beyond basic functionality.

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 a single, efficient sentence ('Get value from JSON object') that is front-loaded and wastes no words. It directly conveys the core action without unnecessary elaboration, making it easy to parse and understand quickly. Every word earns its place in defining the tool's purpose.

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 the complexity of a JSON extraction tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain the return format, error conditions, or how the resultVariable interacts with the system. While the schema covers parameter basics, the lack of behavioral and output details makes it inadequate for full understanding, especially compared to more detailed sibling tools in the list.

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 clear descriptions for all parameters (e.g., 'JSON object variable name', 'Property path', 'Variable name to store result'). The description 'Get value from JSON object' adds minimal semantic context beyond the schema, such as implying extraction via a path, but doesn't elaborate on path syntax or variable usage. Baseline 3 is appropriate since the schema does the heavy lifting.

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 'Get value from JSON object' clearly states the verb ('Get') and resource ('value from JSON object'), making the purpose immediately understandable. It distinguishes from obvious siblings like 'mqscript_cjson_set' (which sets values) and 'mqscript_cjson_parse' (which parses JSON strings), though it doesn't explicitly mention these distinctions. The purpose is specific but could be slightly more detailed about the extraction mechanism.

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. It doesn't mention sibling tools like 'mqscript_cjson_set' for setting values or 'mqscript_cjson_parse' for creating JSON objects from strings, nor does it specify prerequisites such as requiring a parsed JSON object. Usage is implied by the tool name and description but lacks explicit context or exclusions.

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