mqscript_device_setvolume
Control mobile device audio volume levels for music, ring, alarm, or notification streams using precise numeric values from 0 to 15.
Instructions
Set device volume
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| streamType | No | Volume stream type | music |
| volume | Yes | Volume level (0-15) |
Implementation Reference
- src/tools/extension-commands.ts:250-262 (handler)The handler function that implements the core logic of the 'mqscript_device_setvolume' tool. It destructures the input arguments, generates the corresponding MQScript command 'Device.SetVolume(volume, streamType)', and returns a formatted text response containing the generated script.handler: async (args: { volume: number; streamType?: string }) => { const { volume, streamType = 'music' } = args; const script = `Device.SetVolume(${volume}, "${streamType}")`; return { content: [ { type: 'text', text: `Generated MQScript set volume command:\n\`\`\`\n${script}\n\`\`\`\n\nThis sets ${streamType} volume to ${volume}.` } ] }; } }
- The input schema defining the parameters for the tool: required 'volume' (number 0-15) and optional 'streamType' (enum with default 'music'). Used for validation in MCP tool calls.inputSchema: { type: 'object' as const, properties: { volume: { type: 'number', description: 'Volume level (0-15)', minimum: 0, maximum: 15 }, streamType: { type: 'string', description: 'Volume stream type', enum: ['music', 'ring', 'alarm', 'notification'], default: 'music' } }, required: ['volume'] },
- src/index.ts:52-52 (registration)The DeviceCommands object containing the 'mqscript_device_setvolume' tool definition is spread into the ALL_TOOLS registry, making it available for listing and execution via the MCP server....DeviceCommands,