mqscript_cbool
Convert string values to boolean format for use in mobile automation scripts, enabling conditional logic and decision-making in device control operations.
Instructions
Convert value to boolean
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resultVariable | No | Variable name to store result | result |
| value | Yes | Value to convert to boolean |
Implementation Reference
- src/tools/standard-library.ts:604-615 (handler)The handler function that implements the mqscript_cbool tool logic by generating MQScript code for converting a value to boolean and storing it in resultVariable.handler: async (args: { value: string; resultVariable?: string }) => { const { value, resultVariable = 'result' } = args; const script = `${resultVariable} = CBool(${value})`; return { content: [ { type: 'text', text: `Generated MQScript boolean conversion:\n\`\`\`\n${script}\n\`\`\`\n\nThis converts ${value} to boolean.` } ] }; }
- The input schema defining parameters for the mqscript_cbool tool: required 'value' (string), optional 'resultVariable' (string).inputSchema: { type: 'object' as const, properties: { value: { type: 'string', description: 'Value to convert to boolean' }, resultVariable: { type: 'string', description: 'Variable name to store result', default: 'result' } }, required: ['value']
- src/tools/standard-library.ts:586-616 (registration)The tool object registration within TypeConversionFunctions, which is spread into ALL_TOOLS in index.ts for MCP server registration.cBool: { name: 'mqscript_cbool', description: 'Convert value to boolean', inputSchema: { type: 'object' as const, properties: { value: { type: 'string', description: 'Value to convert to boolean' }, resultVariable: { type: 'string', description: 'Variable name to store result', default: 'result' } }, required: ['value'] }, handler: async (args: { value: string; resultVariable?: string }) => { const { value, resultVariable = 'result' } = args; const script = `${resultVariable} = CBool(${value})`; return { content: [ { type: 'text', text: `Generated MQScript boolean conversion:\n\`\`\`\n${script}\n\`\`\`\n\nThis converts ${value} to boolean.` } ] }; } },