get_selection_info
Retrieve details about selected clips or time range in Adobe Premiere Pro for advanced automation, workflow optimization, and AI integration with the Premiere Pro MCP Server.
Instructions
Get information about currently selected clips or time range
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp-server.js:696-748 (handler)The core handler function for the 'get_selection_info' tool. Fetches current selection data from the Premiere Pro CEP extension API at localhost:3001/api/selection, processes the response (clips, time range, etc.), handles no-selection and error cases, and returns formatted MCP content.async getSelectionInfo() { try { const response = await fetch('http://localhost:3001/api/selection'); if (!response.ok) throw new Error(`HTTP ${response.status}: ${response.statusText}`); const data = await response.json(); if (data.error) { return { content: [ { type: 'text', text: `⚠️ ${data.error}`, }, ], }; } if (data.selection_type === 'none') { return { content: [ { type: 'text', text: `🎯 **Selection Info**\n\nNo clips or time range currently selected.`, }, ], }; } const selectedClips = data.selected_clips.map(clip => `• **${clip.clip_name}** (${clip.track_type}${clip.track_number})` ).join('\n'); return { content: [ { type: 'text', text: `🎯 **Selection Info**\n\n**Type:** ${data.selection_type}\n**Selected Clips:**\n${selectedClips}\n\n**Time Range:** ${data.selection_in} → ${data.selection_out}\n**Duration:** ${data.selection_duration}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `❌ **Failed to get selection info**\n\nError: ${error.message}`, }, ], isError: true, }; } }
- mcp-server.js:122-126 (schema)Input schema definition for the get_selection_info tool. It defines an empty object schema, indicating the tool takes no input parameters.inputSchema: { type: "object", properties: {}, required: [] }
- mcp-server.js:119-127 (registration)Registration of the get_selection_info tool in the ListToolsRequestSchema handler's tools array. Includes name, description, and input schema.{ name: "get_selection_info", description: "Get information about currently selected clips or time range", inputSchema: { type: "object", properties: {}, required: [] } },
- mcp-server.js:249-250 (registration)Dispatch registration in the CallToolRequestSchema handler's switch statement, routing tool calls named 'get_selection_info' to the getSelectionInfo() method.case 'get_selection_info': return await this.getSelectionInfo();