Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_datetime_adddays

Add specified days to a date-time variable in MQScript mobile automation, storing the result for scheduling or time-based operations.

Instructions

Add days to date time

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateTimeVariableYesDateTime variable name
daysYesNumber of days to add
resultVariableNoVariable name to store resultnewDate

Implementation Reference

  • The handler function that generates MQScript code for DateTime.AddDays operation and returns a response with the generated script.
    handler: async (args: { dateTimeVariable: string; days: number; resultVariable?: string }) => {
      const { dateTimeVariable, days, resultVariable = 'newDate' } = args;
      const script = `${resultVariable} = DateTime.AddDays(${dateTimeVariable}, ${days})`;
      return {
        content: [
          {
            type: 'text',
            text: `Generated MQScript DateTime add days command:\n\`\`\`\n${script}\n\`\`\`\n\nThis adds ${days} days to "${dateTimeVariable}".`
          }
        ]
      };
    }
  • Defines the input schema for the tool, including required dateTimeVariable and days parameters, and optional resultVariable.
    inputSchema: {
      type: 'object' as const,
      properties: {
        dateTimeVariable: {
          type: 'string',
          description: 'DateTime variable name'
        },
        days: {
          type: 'number',
          description: 'Number of days to add'
        },
        resultVariable: {
          type: 'string',
          description: 'Variable name to store result',
          default: 'newDate'
        }
      },
      required: ['dateTimeVariable', 'days']
    },
  • src/index.ts:32-61 (registration)
    The ALL_TOOLS registry spreads DateTimeCommands (containing mqscript_datetime_adddays) for tool discovery and execution.
    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,
    };
  • src/index.ts:75-88 (registration)
    Registers the generic CallToolRequest handler that looks up the tool by name from ALL_TOOLS and invokes its handler.
    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)}`);
      }
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the action but doesn't disclose behavioral traits like whether it modifies the original variable, creates a new one, handles negative days for subtraction, or deals with time zones. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 just four words, front-loading the core action. There's zero waste or redundancy, making it easy to parse quickly.

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 no annotations, no output schema, and a mutation tool (adding days implies change), the description is incomplete. It doesn't explain the result format, error handling, or side effects. For a tool with three parameters and behavioral implications, more context is needed to be fully helpful.

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 already documents all parameters (dateTimeVariable, days, resultVariable) with clear descriptions. The description adds no additional meaning beyond the schema, such as examples or edge cases. Baseline 3 is appropriate when the schema does the heavy lifting.

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 'Add days to date time' clearly states the action (add) and target (date time), but it's vague about what 'date time' refers to (a variable, a string, etc.) and doesn't distinguish from siblings like 'mqscript_datetime_compare' or 'mqscript_datetime_format'. It's functional but lacks specificity about the context.

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. It doesn't mention prerequisites, such as needing an existing datetime variable, or compare to other datetime tools like 'mqscript_datetime_now' for current time. Usage is implied from the name 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