list_device_presets
Retrieve available device configurations for responsive website screenshot capture, enabling selection of specific screen sizes and settings.
Instructions
List available device presets with their configurations
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_device_presets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:242-262 (handler)Handler for the 'list_device_presets' tool. It processes the DEVICE_PRESETS constant, formats it into a readable list, and returns it as text content.
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:170-174 (schema)Input schema for the 'list_device_presets' tool, which takes no parameters.
inputSchema: { type: 'object', properties: {}, additionalProperties: false } - index.js:167-175 (registration)Registration of the 'list_device_presets' tool in the tools array used for ListToolsRequest.
{ name: 'list_device_presets', description: 'List available device presets with their configurations', inputSchema: { type: 'object', properties: {}, additionalProperties: false } } - src/utils.js:1-26 (helper)DEVICE_PRESETS constant that provides 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' } };