Skip to main content
Glama

add_shape

Adds customizable shapes like rectangles, circles, or triangles to Adobe Premiere Pro timelines, specifying type, size, color, position, duration, and track placement for precise video editing.

Instructions

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

Input Schema

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

Implementation Reference

  • Zod input schema for the 'add_shape' tool, defining parameters like shapeType, sequenceId, trackIndex, startTime, duration, and optional properties for color, size, and 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') }) },
  • Dispatch/registration of the 'add_shape' tool handler in the executeTool switch statement.
    return await this.addShape(args);
  • The main handler function for 'add_shape' tool. It generates and executes an ExtendScript via the PremiereProBridge to create a shape using the title system, configure its properties, and insert it as a clip into the specified sequence track and time.
    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); }

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