Skip to main content
Glama

trim_clip_by_frames

Adjust video or audio clip boundaries in Premiere Pro by adding or removing frames from the start or end point.

Instructions

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

Input Schema

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

Implementation Reference

  • The handler for the 'trim_clip_by_frames' tool. It extracts parameters from the input arguments, calls the runExtendScriptFile helper to execute the corresponding ExtendScript (trimClipByFrames.jsx), and returns success or error response.
    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
        };
      }
    }
  • Input schema defining the parameters and types for the trim_clip_by_frames tool.
    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"]
    }
  • mcp-server.js:146-160 (registration)
    Registration of the trim_clip_by_frames tool in the ListTools response, including name, description, and schema.
    {
      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"]
      }
    },
  • Helper function called by the handler to execute the trimClipByFrames.jsx ExtendScript file. Currently implemented as a stub.
    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 };
    }
  • ExtendScript loader that evaluates and loads the trimClipByFrames.jsx file on CEP panel startup.
    csInterface.evalScript('$.evalFile("trimClipByFrames.jsx")');
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool trims or extends clips, implying mutation, but doesn't describe effects (e.g., whether it modifies the original media or just timeline placement, if changes are undoable, or if it requires specific permissions). It mentions 'in/out point' but doesn't clarify if this refers to timeline edits or source trimming. More context on behavior is needed for safe use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('trim or extend') and resource. It wastes no words, clearly conveying the purpose without unnecessary detail. Every part of the sentence earns its place by specifying the scope ('in/out point', 'by a number of frames').

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a mutation tool with 5 parameters and no annotations or output schema, the description is incomplete. It lacks information on behavioral traits (e.g., side effects, error conditions), usage context, and return values. For a tool that modifies media clips, more guidance is needed to ensure correct and safe invocation by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 5 parameters (sequenceId, clipId, framesDelta, direction, trackType). The description adds minimal value beyond the schema, only implying that 'framesDelta' can be positive or negative for trimming/extending, which is somewhat redundant with the schema's 'positive or negative' note. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('trim or extend') and resource ('video or audio clip'), specifying it operates 'by a number of frames'. It distinguishes itself from siblings like 'get_timeline_clips' or 'export_project' by focusing on editing rather than retrieval or export. However, it doesn't explicitly differentiate from potential similar editing tools not present in the sibling list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active project or sequence), exclusions (e.g., cannot trim beyond clip boundaries), or comparisons with other tools like 'create_sequence' for setup. Usage is implied only through the action described.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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