Skip to main content
Glama

Compile a MotionSpec to GSAP/CSS

motion_compile
Read-onlyIdempotent

Validates (fail-closed) and deterministically compiles a MotionSpec into vanilla-GSAP JavaScript and CSS, with prefers-reduced-motion enabled by default and a performance-budget report. Same spec always yields identical code.

Instructions

Validates (fail-closed) and deterministically compiles a MotionSpec into vanilla-GSAP JavaScript and CSS, with prefers-reduced-motion enabled by default and a performance-budget report. Same spec always yields identical code. Returns {ok:true, js, css, warnings, report, catalogVersion} or {ok:false, errors, catalogVersion}; css may be null when no CSS is emitted. Read warnings before shipping: explicitly disabling reduced-motion or loop pause controls can compile with accessibility warnings. Does not write files or execute the emitted code.

Input Schema

NameRequiredDescriptionDefault
specYesThe MotionSpec JSON object
specNameNoOptional name used in the artifact header

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive/closed-world, and the description adds substantive behavioral detail on top: fail-closed validation, deterministic output, reduced-motion default, a performance-budget report, and the accessibility-warning caveat. It also explicitly states non-effects (no file writes, no code execution), which is exactly the kind of context annotations can't convey.

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-loaded with the core action and result, then return shape, then caveats. It's dense but nearly every clause carries information; the return-shape enumeration is slightly bulky but justified given there's no output schema.

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

Completeness5/5

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

With no output schema, the description fully specifies the return contract ({ok:true,...} vs {ok:false,...}, css nullable) plus error semantics and side-effect boundaries. Nothing an agent needs to invoke this correctly and interpret results is missing.

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 coverage is 100%, so both parameters are already documented in the schema and the baseline applies. The description adds no detail about the MotionSpec object's internal shape or the specName header behavior beyond what the schema states, so it neither compensates nor detracts.

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?

The description states a specific verb pair ("Validates and deterministically compiles") and a concrete resource transformation (MotionSpec → vanilla-GSAP JS and CSS). It distinguishes itself from the sibling validate/audit tools by emphasizing compilation output, so an agent can tell what this tool uniquely produces.

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

Usage Guidelines3/5

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

The description gives implied usage guidance ("Read warnings before shipping", "Does not write files or execute the emitted code") but never explicitly says when to pick this over motion_validate or motion_audit. An agent must infer the routing from the stated output shape rather than from an explicit when-to-use statement.

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