Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_file_exists

Check if a file exists at a specified path to verify file availability before performing mobile automation operations.

Instructions

Check if file exists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesFile path to check
resultVariableNoVariable name to store resultfileExists

Implementation Reference

  • The handler function that implements the mqscript_file_exists tool logic by generating an MQScript command to check file existence and formatting the response.
    handler: async (args: { filePath: string; resultVariable?: string }) => {
      const { filePath, resultVariable = 'fileExists' } = args;
      const script = `${resultVariable} = File.Exists("${filePath}")`;
      return {
        content: [
          {
            type: 'text',
            text: `Generated MQScript file exists command:\n\`\`\`\n${script}\n\`\`\`\n\nThis checks if file "${filePath}" exists and stores result in "${resultVariable}".`
          }
        ]
      };
    }
  • Input schema defining parameters for the mqscript_file_exists tool: filePath (required) and optional resultVariable.
    inputSchema: {
      type: 'object' as const,
      properties: {
        filePath: {
          type: 'string',
          description: 'File path to check'
        },
        resultVariable: {
          type: 'string',
          description: 'Variable name to store result',
          default: 'fileExists'
        }
      },
      required: ['filePath']
    },
  • Registration of the mqscript_file_exists tool as part of FileCommands export, including name, description, schema, and handler.
    exists: {
      name: 'mqscript_file_exists',
      description: 'Check if file exists',
      inputSchema: {
        type: 'object' as const,
        properties: {
          filePath: {
            type: 'string',
            description: 'File path to check'
          },
          resultVariable: {
            type: 'string',
            description: 'Variable name to store result',
            default: 'fileExists'
          }
        },
        required: ['filePath']
      },
      handler: async (args: { filePath: string; resultVariable?: string }) => {
        const { filePath, resultVariable = 'fileExists' } = args;
        const script = `${resultVariable} = File.Exists("${filePath}")`;
        return {
          content: [
            {
              type: 'text',
              text: `Generated MQScript file exists command:\n\`\`\`\n${script}\n\`\`\`\n\nThis checks if file "${filePath}" exists and stores result in "${resultVariable}".`
            }
          ]
        };
      }
    },
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. It states the action ('check') but doesn't disclose behavioral traits such as whether it's read-only (implied but not explicit), error conditions (e.g., invalid paths), performance implications, or output format. This leaves gaps in understanding how the tool behaves beyond the basic check.

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 three words ('Check if file exists'), which is front-loaded and wastes no space. Every word contributes directly to the purpose, making it efficient and easy to parse.

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. It doesn't explain what the tool returns (e.g., boolean, error message) or how results are stored via 'resultVariable'. For a tool with no structured behavioral data, more context is needed to fully understand its operation and integration.

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 input schema has 100% description coverage, with clear documentation for both parameters ('filePath' and 'resultVariable'). The description doesn't add any meaning beyond what the schema provides, as it doesn't elaborate on parameter usage or constraints. Given the high schema coverage, the baseline score of 3 is appropriate.

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 'Check if file exists' clearly states the verb ('check') and resource ('file'), making the purpose understandable. However, it's somewhat vague about what 'exists' means in this context (e.g., file system existence vs. some other state) and doesn't distinguish from siblings like 'mqscript_file_read' or 'mqscript_file_delete' beyond the basic action.

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 (e.g., file permissions), error handling, or comparisons to siblings like 'mqscript_file_read' (which might implicitly check existence). The description lacks context for decision-making.

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