Skip to main content
Glama

Replace a person in a video

replace_person

Replace a person in a video with someone from a picture, keeping the scene, the camera and the moves: put the user into a trend clip, or swap two people for two others. The new video is as long as the video, in whole seconds, or as startSeconds to endSeconds of it: pass the part a clip plays, and only that part is charged. It answers at once with a Job ID and the media is made in the background: start every generation you need, keep working, then call wait_for_jobs with all their Job IDs to get each Asset ID for patch_film. Uses credits for each second of the video: about 0.11 credits a second at standard and about 0.15 credits a second at pro, so a 10-second clip uses 2 credits at standard.

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": {
      "videoAssetId": "<videoAssetId>",
      "startSeconds": "<startSeconds>",
      "endSeconds": "<endSeconds>",
      "references": "<references>",
      "prompt": "<prompt>",
      "quality": "<quality>",
      "keepSound": "<keepSound>",
      "projectId": "<projectId>"
    },
    "name": "replace_person"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptYesWho replaces whom. Call the video @Video1 and the pictures @Image1 to @Image4 in their order: "Replace the man on the left in @Video1 with the person in @Image1, and the woman on the right with the person in @Image2. Keep everything else the same." Up to 2000 characters.
qualityYesstandard for most videos. pro keeps faces, hands and fine detail sharper, and uses more credits.
keepSoundYesnull or true (the default) keeps the video's sound, such as the song of a dance trend. false makes the new video silent.
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.
endSecondsYesSource second of videoAssetId where the part replace_person uses ends. null for both uses the whole video.
referencesYes1 to 4 pictures of the people to put in, in this order, each in one of these forms: asset:ID, an image asset as it is; asset:ID#t=14.6, the frame of a video asset at 14.6 seconds; film:#t=3.2, the frame of the edit at 3.2 seconds. Use the IDs search_assets gives. A face and clothes come from the picture.
startSecondsYesSource second of videoAssetId where the part to use starts, with endSeconds: the part a clip plays (its offset to offset + duration). Only that part is sent and charged. null for both uses the whole video.
videoAssetIdYesThe video to recast: a ready video asset at least 720 pixels on each side. What is recast (the whole video, or startSeconds to endSeconds of it) is 3 to 10 seconds.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / endSeconds
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Source second of videoAssetId where the part replace_person uses ends. null for both uses the whole video."
      +}
    • addedInput schema / properties / startSeconds
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Source second of videoAssetId where the part to use starts, with endSeconds: the part a clip plays (its offset to offset + duration). Only that part is sent and charged. null for both uses the whole video."
      +}
    • changedInput schema / properties / videoAssetId / description
      Previous value: -"The video to recast: a ready video asset of 3 to 10 seconds, at least 720 pixels on each side."New value: +"The video to recast: a ready video asset at least 720 pixels on each side. What is recast (the whole video, or startSeconds to endSeconds of it) is 3 to 10 seconds."
    • changedInput schema / required
      Previous value: -[
      -  "videoAssetId",
      -  "references",
      -  "prompt",
      -  "quality",
      -  "keepSound",
      -  "projectId"
      -]New value: +[
      +  "videoAssetId",
      +  "startSeconds",
      +  "endSeconds",
      +  "references",
      +  "prompt",
      +  "quality",
      +  "keepSound",
      +  "projectId"
      +]
  2. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations only cover the generic safety profile (not read-only, not destructive, not idempotent, open-world), while the description adds the genuinely non-obvious behavior: it returns a Job ID immediately and does the media work in the background, so concurrent submissions are expected. It also quantifies cost (~0.11 credits/sec standard, ~0.15 pro, with a worked 10-second example) and states that only the requested sub-range is charged, which an agent cannot get from the annotations.

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?

The purpose is front-loaded and nearly every clause carries information (cost, async flow, range charging, resolution/length limits). It is written as one breathless colon-chained paragraph, which hurts scannability for eight required parameters, but there is little outright filler.

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?

For an eight-parameter, credit-consuming, asynchronous generation tool with no output schema, the description covers the whole lifecycle: submit, receive Job ID, wait_for_jobs, then patch_film with the Asset ID. Combined with the constraints (>=720px per side, 3-10s recast range, up to 2000-char prompt), nothing an agent needs to call this correctly 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% and the property descriptions already document quality tradeoffs, keepSound default, references ordering/notation, and startSeconds/endSeconds semantics. The description reinforces the range meaning with the charging consequence ('only that part is charged'), but otherwise largely restates what the schema already carries, so baseline 3 is appropriate.

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

Purpose4/5

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

Opens with a specific verb and resource -- replace a person in a video with a face from a picture -- and clarifies what is preserved (scene, camera, moves), which makes the transformation tangible. It does not, however, distinguish itself from the similarly named siblings replace_component and replace_film, so an agent must infer which replace* tool applies.

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?

Supplies concrete use cases (put the user into a trend clip, swap two people for two others) and, importantly, gives the downstream workflow: fire all generations, keep working, then call wait_for_jobs with the Job IDs to get Asset IDs for patch_film. It stops short of explicit when-not-to-use guidance or naming the sibling alternatives.

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.