Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_cjson_set

Set values in JSON objects using property paths for mobile automation scripting with MQScript MCP Server.

Instructions

Set value in JSON object

Input Schema

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

Implementation Reference

  • Handler function that generates the MQScript 'CJson.Set' command based on input parameters: objectVariable, path, and value. Returns a formatted response with the generated script.
    handler: async (args: { objectVariable: string; path: string; value: string }) => {
      const { objectVariable, path, value } = args;
      const script = `CJson.Set(${objectVariable}, "${path}", "${value}")`;
      return {
        content: [
          {
            type: 'text',
            text: `Generated MQScript CJson set command:\n\`\`\`\n${script}\n\`\`\`\n\nThis sets value "${value}" at path "${path}" in object "${objectVariable}".`
          }
        ]
      };
    }
  • Input schema for the mqscript_cjson_set tool, specifying required string parameters: objectVariable (JSON object var), path (property path), value (value to set).
    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")'
        },
        value: {
          type: 'string',
          description: 'Value to set'
        }
      },
      required: ['objectVariable', 'path', 'value']
    },
  • src/index.ts:64-72 (registration)
    Registration of all tools including mqscript_cjson_set via the ListToolsRequestHandler, which exposes tools from the ALL_TOOLS object (populated with CJsonCommands containing this tool).
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: Object.values(ALL_TOOLS).map(tool => ({
          name: tool.name,
          description: tool.description,
          inputSchema: tool.inputSchema,
        })),
      };
    });
  • src/index.ts:75-88 (registration)
    CallToolRequestHandler that dynamically finds and executes the handler for mqscript_cjson_set by name from ALL_TOOLS.
    server.setRequestHandler(CallToolRequestSchema, async (request: CallToolRequest) => {
      const { name, arguments: args } = request.params;
      
      const tool = Object.values(ALL_TOOLS).find(t => t.name === name);
      if (!tool) {
        throw new Error(`Unknown tool: ${name}`);
      }
      
      try {
        return await tool.handler(args as any || {});
      } catch (error) {
        throw new Error(`Error executing tool ${name}: ${error instanceof Error ? error.message : String(error)}`);
      }
    });
  • src/index.ts:56-60 (registration)
    Inclusion of CJsonCommands (containing mqscript_cjson_set) into the ALL_TOOLS registry object used 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?

With no annotations, the description carries the full burden but only states the basic action without disclosing behavioral traits. It doesn't cover whether the operation mutates the object in-place, handles errors for invalid paths, requires specific permissions, or has side effects, leaving significant gaps for a mutation tool.

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 with a single sentence that directly states the tool's purpose. It's front-loaded and wastes no words, making it efficient for quick understanding, though this brevity contributes to gaps in other dimensions.

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 mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavior, error handling, return values, and usage context, making it insufficient for safe and effective tool invocation by an AI agent.

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 input schema fully documents the three parameters. The description adds no additional meaning beyond implying a 'set' action, which aligns with the schema but doesn't compensate with extra context like path syntax examples or value handling.

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

Purpose3/5

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

The description 'Set value in JSON object' clearly states the action (set) and target (JSON object), but it's vague about the scope and doesn't differentiate from siblings like mqscript_cjson_get. It specifies the resource but lacks detail on what 'set' entails operationally.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context, or exclusions, such as when to choose this over other JSON tools like mqscript_cjson_parse or mqscript_cjson_stringify.

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