mqscript_device_setbrightness
Adjust screen brightness on mobile devices by specifying a level from 0 to 255 for automation scripts.
Instructions
Set screen brightness
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| brightness | Yes | Brightness level (0-255) |
Implementation Reference
- src/tools/extension-commands.ts:214-225 (handler)The tool handler function that receives the brightness value and generates the corresponding MQScript command `Device.SetBrightness(brightness)` along with a descriptive response.handler: async (args: { brightness: number }) => { const { brightness } = args; const script = `Device.SetBrightness(${brightness})`; return { content: [ { type: 'text', text: `Generated MQScript set brightness command:\n\`\`\`\n${script}\n\`\`\`\n\nThis sets screen brightness to ${brightness}.` } ] }; }
- The input schema defining the required 'brightness' parameter as a number between 0 and 255.inputSchema: { type: 'object' as const, properties: { brightness: { type: 'number', description: 'Brightness level (0-255)', minimum: 0, maximum: 255 } }, required: ['brightness'] },
- src/tools/extension-commands.ts:199-226 (registration)The complete tool registration object within DeviceCommands, which is spread into the ALL_TOOLS registry.setBrightness: { name: 'mqscript_device_setbrightness', description: 'Set screen brightness', inputSchema: { type: 'object' as const, properties: { brightness: { type: 'number', description: 'Brightness level (0-255)', minimum: 0, maximum: 255 } }, required: ['brightness'] }, handler: async (args: { brightness: number }) => { const { brightness } = args; const script = `Device.SetBrightness(${brightness})`; return { content: [ { type: 'text', text: `Generated MQScript set brightness command:\n\`\`\`\n${script}\n\`\`\`\n\nThis sets screen brightness to ${brightness}.` } ] }; } },
- src/index.ts:54-54 (registration)Spreading DeviceCommands into ALL_TOOLS object used for tool lookup and registration in MCP server handlers....SysCommands,