Skip to main content
Glama

add_frame

Adds an empty frame at the end of an animation or duplicates an existing frame directly after it, with an optional duration in milliseconds.

Instructions

Add a frame: an empty one goes at the end, a copy goes right after the frame it copies.

Args:
    duration_ms: The new frame's duration in milliseconds (default 100). With
        `copy_from` it is set on the copy; the frame copied keeps its own.
    copy_from: If given (1-based), the new frame duplicates that frame and is
        **inserted directly after it**, so every later frame is renumbered: on a red,
        blue sprite, `copy_from=1` gives red, red, blue, the copy being frame 2 and
        blue moving from 2 to 3. Copying the last frame moves nothing. Tags follow
        their frames: one that covered the copied frame grows by one to take in the
        copy, and one after it moves up by one. Must name an existing frame: an
        out-of-range number is rejected, not clamped. Without `copy_from` the new
        frame is empty, goes at the end, and nothing moves.

Returns `newFrame`, the number of the frame this call added (with `copy_from`, always
`copy_from + 1`), and the new `frameCount`. `inserted` says whether existing frames
were renumbered; when they were, `renumbered_from` is the first number affected: every
frame that had that number or a higher one before the call is one higher after it, so
a caller holding frame numbers from before the call adds one to each of those.

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": {
      "filename": "<filename>"
    },
    "name": "add_frame"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYes
copy_fromNo
duration_msNoDefault: 100.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.10.0
    • removedInput schema / properties / copy_from / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / copy_from / default
      Removed value: -null
    • removedInput schema / properties / copy_from / title
      Removed value: -"Copy From"
    • addedInput schema / properties / copy_from / type
      Added value: +"integer"
    • addedInput schema / properties / duration_ms / description
      Added value: +"Default: 100."
    • removedInput schema / properties / duration_ms / title
      Removed value: -"Duration Ms"
    • removedInput schema / properties / filename / title
      Removed value: -"Filename"
    • removedInput schema / title
      Removed value: -"add_frameArguments"
  2. First observedv0.7.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare a non-readonly, non-destructive, closed-world mutation, and the description adds real behavioral context beyond them: tag growth/relocation semantics, renumbering of all later frames with a worked red/blue example, and the exact consequence for callers holding stale frame numbers. It does not mention whether the change is undoable or what happens on a frame-count limit.

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 two-mode rule, and the ordering example plus tag rules are genuinely load-bearing rather than filler. The renumbering paragraph restates the same idea twice (the ffmpeg-style example and the 'adds one to each' rule), which is slightly redundant but defensible for a subtle side effect.

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 documents return values (newFrame, frameCount, inserted, renumbered_from) and their invariants. For a three-parameter insertion tool with non-obvious index shifting, nothing an agent needs to call it correctly is missing except the filename parameter's meaning.

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 only 33% and the description carries most of the load: duration_ms default behavior (and that it applies to the copy, not the source) plus detailed copy_from semantics including 1-based indexing and rejection of invalid values. The required `filename` parameter is never explained, leaving one gap.

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 concrete verb and resource ('Add a frame') and immediately distinguishes its two modes: an empty frame appended at the end versus a copy inserted directly after the source frame. An agent can tell this apart from move_frame or remove_frame without opening a schema.

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

Usage Guidelines4/5

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

Gives explicit guidance on choosing between the two modes ('Without `copy_from` the new frame is empty, goes at the end, and nothing moves') and states the precondition that copy_from must name an existing frame, with out-of-range numbers rejected rather than clamped. It never names a sibling alternative (e.g. duplicate_frame), so the exclusion side is missing.

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