Skip to main content
Glama

Find and track a subject

segment_subject

Find and track a subject named in a few words in a ready video or image. Returns a mask Asset ID, white where the subject is on each frame and black elsewhere (a hard edge), and for a video an object track of its box ten times a second, with when it is in the picture, the first time all of it is, and where it is largest. Everything the words fit is in the mask: two people for "person" when two are on screen, so name what sets one apart to get one. Bind the mask with mask= on a clip, link it into an effect that needs a person mask, or move a graphic with the subject by on the track. For a soft cut-out with hair and motion blur, use cutout_subject. at is a source second where you saw the subject (null searches from the start of the range). For a video, pass startTime and endTime with the source range to read: only that range is read, at about 57 credits a minute of it, billed by the second. The mask is black before startTime and ends at endTime, on the footage's source time. null for both reads the whole video. An image takes null for startTime, endTime and at.

Input Schema

NameRequiredDescriptionDefault
atYesA source second where all of the subject is in the picture and nothing covers it, which you checked with preview_frame or read_asset. null picks such a frame itself. An image takes null.
clipIdYesThe film clip that plays this asset, when space or atSpace needs one and several clips play it. null picks the clip that shows the asset at that time.
assetIdYes
atSpaceYesWhat this call's times are. null or source: seconds into the asset file. timeline: seconds of the film, read through the clip that plays the asset then (clipId to pick one).
endTimeYesSource second to stop reading at, or null for the asset's end. null for both reads the whole asset.
subjectYesWhat to find, in a few words: "person", "the dog", "the red car", "the woman in the red coat". null is a person. Everything the words fit is found, so name what sets one apart to get one. Name one kind of thing: words that join two ("the man and the microphone") find neither.
projectIdYesThe project this call runs on without changing the open project. null (or leaving it out) uses the open project. wait_for_jobs takes the projectId of the calls that started the jobs.
startTimeYesSource second to start reading at, or null for the asset's start. Pass the range of the shot you build.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / subject / description
      Previous value: -"What to find, in a few words: \"person\", \"the dog\", \"the red car\", \"the woman in the red coat\". null is a person. Everything the words fit is found, so name what sets one apart to get one."New value: +"What to find, in a few words: \"person\", \"the dog\", \"the red car\", \"the woman in the red coat\". null is a person. Everything the words fit is found, so name what sets one apart to get one. Name one kind of thing: words that join two (\"the man and the microphone\") find neither."
  2. Changed3 schema fields changed
    • addedInput schema / properties / atSpace
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "source",
      +        "timeline"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "What this call's times are. null or source: seconds into the asset file. timeline: seconds of the film, read through the clip that plays the asset then (clipId to pick one)."
      +}
    • addedInput schema / properties / clipId
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "The film clip that plays this asset, when space or atSpace needs one and several clips play it. null picks the clip that shows the asset at that time."
      +}
    • changedInput schema / required
      Previous value: -[
      -  "assetId",
      -  "startTime",
      -  "endTime",
      -  "subject",
      -  "at",
      -  "projectId"
      -]New value: +[
      +  "assetId",
      +  "startTime",
      +  "endTime",
      +  "subject",
      +  "at",
      +  "clipId",
      +  "atSpace",
      +  "projectId"
      +]
  3. Added

TDQS

A4.5/5.0
Behavior5/5

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

Well beyond what annotations say: discloses cost (~57 credits per minute of read range, billed per second), that only the startTime–endTime range is read, that the mask is black outside that range on source time, and that null/null reads the whole video. Also explains matching breadth ('everything the words fit is in the mask') and the hard-edge vs soft-edge tradeoff. Nothing here contradicts readOnlyHint=false / destructiveHint=false — it creates an asset without destroying anything.

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

Conciseness3/5

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

Front-loaded with purpose and return value, but the middle is a dense run-on mixing return description, usage advice, pricing, null semantics and range behavior. Some content is redundant with the schema (startTime/endTime null behavior appears twice), and 'at is a source second...' is buried rather than surfaced.

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 8 required parameters and no output schema, the description carries the return contract itself — mask appearance, per-frame white/black, 10 fps box track, presence timing, first full-visibility frame, largest box — plus cost, range scoping, and the image edge case. An agent has everything needed to call this correctly and to chain its outputs.

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 already 88%, so the baseline is 3; the description still adds value by explaining null behavior for `at` ('null searches from the start of the range'), the null/null whole-video case, and that an image takes null for startTime, endTime and at. It reinforces the subject-phrasing rule (one kind of thing; 'the man and the microphone' finds neither) that also appears in 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?

Uses a specific verb+resource ('Find and track a subject') and immediately states the concrete return: a mask Asset ID (white on subject, black elsewhere, hard edge) plus a 10 Hz object track for video. It also explicitly distinguishes itself from the sibling cutout_subject ('For a soft cut-out with hair and motion blur, use cutout_subject'), so an agent can route without opening either 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?

Names the alternative tool and the exact condition that selects it (soft cut-out with hair/motion blur), and describes downstream uses: binding via mask= on a clip, linking into a person-mask effect, or <follow> on the track. No exclusions are given against other plausible siblings such as find_objects, track_faces, or remove_background, so the routing is clear but not exhaustive.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.