list_device_presets
Retrieve available device presets and their configurations to streamline screenshot captures for specific devices or responsive layouts using the Screenshot MCP server.
Instructions
List available device presets with their configurations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:242-262 (handler)The handler function that executes the 'list_device_presets' tool logic, formatting the DEVICE_PRESETS into a readable text response.case 'list_device_presets': const presetsList = Object.entries(DEVICE_PRESETS).map(([name, config]) => ({ name, ...config })); return { content: [ { type: 'text', text: 'Available device presets:\n\n' + presetsList.map(preset => `**${preset.name}**\n` + `- Dimensions: ${preset.width}x${preset.height}\n` + `- Scale: ${preset.deviceScaleFactor}x\n` + `- Mobile: ${preset.isMobile}\n` + `- Touch: ${preset.hasTouch}\n` ).join('\n') } ] };
- index.js:167-175 (registration)The tool registration entry in the tools array used for ListToolsRequest, defining name, description, and input schema.{ name: 'list_device_presets', description: 'List available device presets with their configurations', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }
- index.js:170-174 (schema)The input schema for the 'list_device_presets' tool, which takes no parameters.inputSchema: { type: 'object', properties: {}, additionalProperties: false }
- src/utils.js:1-26 (helper)The DEVICE_PRESETS constant providing the device configurations listed by the tool handler.export const DEVICE_PRESETS = { mobile: { width: 375, height: 667, deviceScaleFactor: 2, isMobile: true, hasTouch: true, userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15A372 Safari/604.1' }, tablet: { width: 768, height: 1024, deviceScaleFactor: 2, isMobile: true, hasTouch: true, userAgent: 'Mozilla/5.0 (iPad; CPU OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15A372 Safari/604.1' }, desktop: { width: 1920, height: 1080, deviceScaleFactor: 1, isMobile: false, hasTouch: false, userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' } };