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 no extra credits: it is part of the message 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.

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": {
      "assetId": "<assetId>",
      "startTime": "<startTime>",
      "endTime": "<endTime>",
      "subject": "<subject>",
      "at": "<at>",
      "clipId": "<clipId>",
      "atSpace": "<atSpace>",
      "projectId": "<projectId>"
    },
    "name": "segment_subject"
  }
}

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.6/5.0
Behavior5/5

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

Well beyond the supplied annotations, it discloses cost and timing behavior: reading a restricted range costs no extra credits and billing is by the second, the mask is black before startTime and terminates at endTime on source time, and nulls mean the whole video for video but must be null for an image. It also declares the return shape (mask asset, per-frame box track, first fully-visible moment, largest appearance), which annotations do not cover.

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?

It is front-loaded with purpose and outputs, but the middle section is a dense run-on mixing range semantics, credit policy, and mask timing, and one clause is garbled ('it is part of the message a minute of it, billed by the second'), forcing the reader to reconstruct intent. The information mostly earns its place, yet the packaging costs clarity.

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?

With eight required parameters, no output schema, and no destructive behavior, the description covers what an agent needs: return artifacts, how to consume them, null conventions across video versus image, and cost. The only soft spot is the muddled credit/billing sentence, which slightly obscures the exact cost model for partial-range reads.

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 88%, so the baseline is 3, and the description genuinely adds meaning beyond it: at is framed as the second where you saw the subject, startTime/endTime as 'the range of the shot you build', and subject as a single-kind-of-thing phrase (joined concepts like 'the man and the microphone' find neither). Minor drift exists, since the schema says at=null picks a frame itself while the description says it 'searches from the start of the range'.

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 opens with a specific verb plus resource ('Find and track a subject named in a few words in a ready video or image') and immediately enumerates the concrete artifacts returned: a mask Asset ID (white subject, black elsewhere, hard edge) and, for video, an object track of the box at ten times a second with in-frame timing. It explicitly distinguishes itself from the sibling cutout_subject, so an agent can tell the two apart 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 Guidelines5/5

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

It names the alternative and the selecting condition ('For a soft cut-out with hair and motion blur, use cutout_subject'), and gives a when-to-do-what for disambiguation inside the tool: 'two people for "person" when two are on screen, so name what sets one apart to get one.' It also spells out downstream consumption paths (bind with mask= on a clip, feed an effect needing a person mask, or drive a graphic with <follow> on the track).

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.