Skip to main content
Glama

add_shape

Add shapes like rectangles, circles, or triangles to Adobe Premiere Pro timelines with precise timing, positioning, and sizing controls.

Instructions

Adds a shape (rectangle, circle, etc.) to the timeline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shapeTypeYesThe type of shape to add
sequenceIdYesThe sequence to add the shape to
trackIndexYesThe video track to place the shape on
startTimeYesThe time in seconds when the shape should appear
durationYesHow long the shape should remain on screen in seconds
colorNoThe hex color code for the shape
sizeNoShape size
positionNoShape position on screen

Implementation Reference

  • The handler function that implements the 'add_shape' tool. It constructs and executes an ExtendScript via the bridge to create a shape layer in Premiere Pro using the legacy title system, add properties like color/size/position, and insert it into the specified sequence track.
    private async addShape(args: any): Promise<any> { const script = ` try { var sequence = app.project.getSequenceByID("${args.sequenceId}"); if (!sequence) { JSON.stringify({ success: false, error: "Sequence not found" }); return; } var track = sequence.videoTracks[${args.trackIndex}]; if (!track) { JSON.stringify({ success: false, error: "Video track not found" }); return; } // Create a shape using the legacy title system var shapeItem = app.project.createNewTitle("Shape"); if (!shapeItem) { JSON.stringify({ success: false, error: "Failed to create shape" }); return; } // Add shape to title var shape = shapeItem.addShape("${args.shapeType}"); if (shape) { ${args.color ? `shape.fillColor = "${args.color}";` : ''} ${args.size ? ` shape.width = ${args.size.width || 100}; shape.height = ${args.size.height || 100}; ` : ''} ${args.position ? ` shape.x = ${args.position.x || 50}; shape.y = ${args.position.y || 50}; ` : ''} } // Insert the shape into the timeline var shapeClip = track.insertClip(shapeItem, new Time("${args.startTime}s")); shapeClip.end = new Time(shapeClip.start.seconds + ${args.duration}); JSON.stringify({ success: true, message: "Shape added successfully", shapeType: "${args.shapeType}", clipId: shapeClip.nodeId, startTime: ${args.startTime}, duration: ${args.duration}, trackIndex: ${args.trackIndex} }); } catch (e) { JSON.stringify({ success: false, error: e.toString() }); } `; return await this.bridge.executeScript(script); }
  • Input schema (Zod) for the 'add_shape' tool, defining parameters like shapeType, sequenceId, trackIndex, startTime, duration, and optional color, size, position.
    name: 'add_shape', description: 'Adds a shape (rectangle, circle, etc.) to the timeline.', inputSchema: z.object({ shapeType: z.enum(['rectangle', 'circle', 'triangle']).describe('The type of shape to add'), sequenceId: z.string().describe('The sequence to add the shape to'), trackIndex: z.number().describe('The video track to place the shape on'), startTime: z.number().describe('The time in seconds when the shape should appear'), duration: z.number().describe('How long the shape should remain on screen in seconds'), color: z.string().optional().describe('The hex color code for the shape'), size: z.object({ width: z.number().optional().describe('Width in pixels'), height: z.number().optional().describe('Height in pixels') }).optional().describe('Shape size'), position: z.object({ x: z.number().optional().describe('Horizontal position (0-100)'), y: z.number().optional().describe('Vertical position (0-100)') }).optional().describe('Shape position on screen') }) },
  • Registration of the 'add_shape' tool in the executeTool switch statement, dispatching to the addShape handler.
    return await this.addShape(args);

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/hetpatel-11/Adobe_Premiere_Pro_MCP'

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