Skip to main content
Glama

trim_clip_by_frames

Adjust in/out points of video or audio clips in Premiere Pro by a specified number of frames, enabling precise editing control for sequences.

Instructions

Trim or extend the in/out point of a video or audio clip by a number of frames.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clipIdYesID of the clip to trim
directionYesWhich edit point to trim ('in' or 'out')
framesDeltaYesNumber of frames to trim (positive or negative)
sequenceIdYesIndex of the sequence (0-based)
trackTypeYesTrack type ('video' or 'audio')

Implementation Reference

  • mcp-server.js:146-160 (registration)
    Tool registration in listTools handler, including name, description, and input schema definition.
    { name: "trim_clip_by_frames", description: "Trim or extend the in/out point of a video or audio clip by a number of frames.", inputSchema: { type: "object", properties: { sequenceId: { type: "number", description: "Index of the sequence (0-based)" }, clipId: { type: "string", description: "ID of the clip to trim" }, framesDelta: { type: "number", description: "Number of frames to trim (positive or negative)" }, direction: { type: "string", enum: ["in", "out"], description: "Which edit point to trim ('in' or 'out')" }, trackType: { type: "string", enum: ["video", "audio"], description: "Track type ('video' or 'audio')" } }, required: ["sequenceId", "clipId", "framesDelta", "direction", "trackType"] } },
  • Main execution handler for the tool in the CallToolRequest switch statement. Extracts parameters and delegates to ExtendScript via runExtendScriptFile.
    case 'trim_clip_by_frames': { // Dynamically import and call the ExtendScript function const { sequenceId, clipId, framesDelta, direction, trackType } = args; // Here you would use your existing bridge to call the ExtendScript file // For demonstration, we'll assume a function runExtendScriptFile exists const { runExtendScriptFile } = require('./runExtendScriptFile'); const result = await runExtendScriptFile('trimClipByFrames.jsx', 'trimClipByFrames', [sequenceId, clipId, framesDelta, direction, trackType]); if (result && result.success) { return { content: [ { type: 'text', text: `✅ Clip trimmed successfully.` } ] }; } else { return { content: [ { type: 'text', text: `❌ Failed to trim clip: ${result && result.error ? result.error : 'Unknown error'}` } ], isError: true }; } }
  • Helper function used by the handler to execute the actual trimClipByFrames.jsx ExtendScript file containing Premiere Pro automation logic.
    async function runExtendScriptFile(scriptFile, functionName, args) { // TODO: Integrate with your CEP/host communication bridge // For now, just log the call and return a fake success console.log(`[Stub] Would call ExtendScript: ${scriptFile} -> ${functionName}(${args.join(', ')})`); // Simulate async call return { success: true }; }
  • CEP panel bridge loads the trimClipByFrames.jsx ExtendScript file into the Premiere Pro environment.
    csInterface.evalScript('$.evalFile("trimClipByFrames.jsx")');

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jordanl61/premiere-pro-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server