Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_cjson_stringify

Convert MQScript object variables to JSON strings for data serialization and storage in mobile automation workflows.

Instructions

Convert object to JSON string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
objectVariableYesObject variable name to convert
resultVariableNoVariable name to store JSON stringjsonString

Implementation Reference

  • The async handler function for the 'mqscript_cjson_stringify' tool. It generates an MQScript command to stringify a JSON object into a string and stores it in the specified variable.
    handler: async (args: { objectVariable: string; resultVariable?: string }) => {
      const { objectVariable, resultVariable = 'jsonString' } = args;
      const script = `${resultVariable} = CJson.Stringify(${objectVariable})`;
      return {
        content: [
          {
            type: 'text',
            text: `Generated MQScript CJson stringify command:\n\`\`\`\n${script}\n\`\`\`\n\nThis converts object "${objectVariable}" to JSON string in "${resultVariable}".`
          }
        ]
      };
    }
  • The input schema for the tool, defining required 'objectVariable' and optional 'resultVariable'.
    inputSchema: {
      type: 'object' as const,
      properties: {
        objectVariable: {
          type: 'string',
          description: 'Object variable name to convert'
        },
        resultVariable: {
          type: 'string',
          description: 'Variable name to store JSON string',
          default: 'jsonString'
        }
      },
      required: ['objectVariable']
    },
  • src/index.ts:56-60 (registration)
    Registration of CJsonCommands (containing mqscript_cjson_stringify) by spreading into the ALL_TOOLS object used by the MCP server for tool listing and execution.
    // Plugin Commands - 插件命令
    ...CJsonCommands,
    ...DateTimeCommands,
    ...FileCommands,
    ...TuringCommands,
  • src/index.ts:16-16 (registration)
    Import of CJsonCommands from plugin-commands.ts, which defines the mqscript_cjson_stringify tool.
    import { CJsonCommands, DateTimeCommands, FileCommands, TuringCommands } from './tools/plugin-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 the full burden of behavioral disclosure. 'Convert object to JSON string' implies a read-only transformation, but it doesn't specify error handling (e.g., for non-serializable objects), performance characteristics, or side effects like variable creation. The description is minimal and lacks critical behavioral context for safe invocation.

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 with zero wasted words. It's front-loaded with the core purpose and avoids unnecessary elaboration, making it easy to parse quickly. Every word earns its place by directly conveying the tool's function.

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 lack of annotations and output schema, the description is incomplete for a tool that performs data transformation. It doesn't explain the return value (e.g., where the JSON string is stored or how to access it), error conditions, or dependencies on other tools. For a 2-parameter tool with no structured support, more context is needed for reliable use.

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%, so the schema fully documents both parameters (objectVariable and resultVariable) with clear descriptions. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints. This meets the baseline of 3 for high schema coverage.

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 object to JSON string' clearly states the verb ('convert') and resource ('object to JSON string'), making the purpose immediately understandable. It distinguishes from siblings like mqscript_cjson_parse (which does the reverse) and mqscript_cjson_get/set (which manipulate JSON). However, it doesn't specify the exact scope or limitations beyond the basic conversion.

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 prerequisites (e.g., needing an existing object variable), compare it to similar tools like mqscript_cjson_parse for the inverse operation, or indicate any context-specific constraints. Usage is implied from the name and description but not explicitly stated.

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