Skip to main content
Glama

Add gradient fill / stroke

add_gradient_fill

Adds a linear or radial gradient fill or stroke to a shape group in After Effects; note that color stops cannot be set via scripting, so edit them in the AE UI.

Instructions

Add a Gradient Fill (or Gradient Stroke with asStroke=true) to a shape group: linear/radial type, start/end points, highlight, opacity. LIMITATION: After Effects scripting cannot set gradient color stops (the Colors property is not scriptable and rejects expressions), so the gradient keeps AE's default white-to-black ramp; 'colors' is accepted but reported as not applied (colorsApplied=false). Edit colors in the AE UI, or use add_fill for a solid color.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "layer": "<layer>"
    },
    "name": "add_gradient_fill"
  }
}

Input Schema

NameRequiredDescriptionDefault
compNoComposition name, 'Folder/Name' path, or item id. Omit to use the active composition.
nameNoName for the item.
typeNoGradient type (default linear).
layerYesLayer: 1-based index, layer name, or {id}/{index}/{name}. 'selected' = first selected layer.
widthNoGradient stroke width px (asStroke only).
colorsNoDesired color stops (NOT applied: AE scripting limitation, see description).
lineCapNoStroke line cap.
opacityNoOpacity 0-100.
asStrokeNoCreate a Gradient Stroke instead of a Gradient Fill.
endPointNoEnd point in group coordinates (default [100,0]).
fillRuleNoFill rule for overlapping paths / holes (default nonzero).
lineJoinNoStroke line join.
groupPathNoShape group path inside the layer's Contents: '/'-separated Vector Group names (or 1-based indexes), e.g. 'Logo' or 'Logo/Circle'. Omit or '' for the Contents root. A leading 'Contents/' is accepted. Use list_shape_contents to see names.
startPointNoStart point in group coordinates (default [0,0]).
highlightAngleNoRadial highlight angle degrees.
highlightLengthNoRadial highlight length %.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Goes well beyond the annotations (readOnly=false, destructive=false) by disclosing the critical AE scripting limitation: color stops are silently not applied and the result reports colorsApplied=false. That is exactly the kind of deceptive-success behavior an agent must know about. It stops short of describing the general return payload or failure modes for a bad groupPath.

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

Conciseness4/5

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

Front-loads the core action, then the limitation, then the alternative — good ordering with no filler. It is dense (parenthetical asides, nested quote marks) but every sentence carries decision-relevant information for a 16-parameter tool.

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

Completeness4/5

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

For a 16-parameter mutation tool with no output schema, the description covers purpose, the dominant failure mode, the returned colorsApplied flag, and the alternative tool. It omits the broader return shape and error behavior for an unresolvable groupPath, which keeps it from being fully complete.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining the semantics of the two non-obvious parameters — asStroke deciding fill vs stroke, and 'colors' being accepted-but-ignored. Start/end points, highlight and opacity are named but not elaborated beyond the schema.

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

Purpose5/5

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

States a specific verb plus resource ('Add a Gradient Fill ... to a shape group') and enumerates the controllable aspects (type, start/end points, highlight, opacity). It also names the sibling it is not — 'use add_fill for a solid color' — so an agent can distinguish it from add_fill/add_stroke without opening the schema.

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

Usage Guidelines5/5

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

Gives an explicit alternative with its selecting condition ('use add_fill for a solid color') and an explicit fallback when the colors feature is unusable ('Edit colors in the AE UI'). The asStroke flag is flagged inline as the switch to the stroke variant, so the agent knows how to reach the related behavior.

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

Deploy Server

Other Tools