Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_abs

Calculate the absolute value of a number in mobile automation scripts, ensuring positive results for mathematical operations and conditional logic.

Instructions

Get absolute value of a number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYesNumber to get absolute value of
resultVariableNoVariable name to store resultresult

Implementation Reference

  • The handler function that generates MQScript code for computing the absolute value of a number and returns it as formatted content.
    handler: async (args: { number: number; resultVariable?: string }) => { const { number, resultVariable = 'result' } = args; const script = `${resultVariable} = Abs(${number})`; return { content: [ { type: 'text', text: `Generated MQScript absolute value function:\n\`\`\`\n${script}\n\`\`\`\n\nThis calculates the absolute value of ${number}.` } ] }; }
  • Input schema defining the parameters: number (required) and optional resultVariable for the mqscript_abs tool.
    inputSchema: { type: 'object' as const, properties: { number: { type: 'number', description: 'Number to get absolute value of' }, resultVariable: { type: 'string', description: 'Variable name to store result', default: 'result' } }, required: ['number'] },
  • src/index.ts:40-40 (registration)
    Registration of mqscript_abs tool via spreading MathFunctions into the ALL_TOOLS object, which serves as the central tool registry for MCP server handlers.
    ...MathFunctions,
  • src/index.ts:13-13 (registration)
    Import of MathFunctions containing the mqscript_abs tool definition.
    import { MathFunctions, StringFunctions, TypeConversionFunctions, ArrayFunctions } from './tools/standard-library.js';

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