Skip to main content
Glama

Swap faces in an existing video

face_swap_create_video

Use only with the user's own likeness or content they are authorized to use. Do not use for impersonation, deception, sexual content, or content involving minors.

MCP guidance:

  • Starts an async video job; returns id and credits_charged. For finished results, call wait_for_video_project with that id or poll GET /v1/video-projects/{id} until complete, error, or canceled. Results include downloads; wait helpers add exact_download_urls. Preserve signed URLs and query parameters; never append expiration metadata.

  • For *_file_path, use an existing Magic Hour path or the upload-URL endpoint's file_path after uploading raw bytes to its presigned URL. Direct public media URLs may work if stable and fetchable as raw bytes; hotlinked URLs can fail. Prefer the upload-URL endpoint when unsure.

Requires start_seconds, end_seconds and assets.video_source with its matching assets.video_file_path or assets.youtube_url. Use assets.image_file_path for all-faces mode, or assets.face_mappings for individual-faces mode after face detection. Generation consumes credits; the queued video charge is an estimate, with the final charge available on the completed project.

Input Schema

NameRequiredDescriptionDefault
nameNoGive your video a custom name for easy identification.Face Swap - dateTime
styleNoStyle of the face swap video.
assetsYesProvide the assets for face swap. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
end_secondsYesEnd time of your clip (seconds). Must be greater than start_seconds.
start_secondsYesStart time of your clip (seconds). Must be ≥ 0.

Output Schema

NameRequiredDescriptionDefault
idYesUnique ID of the video. Use it with the [Get video Project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch status and downloads.
credits_chargedYesThe amount of credits deducted from your account to generate the video. If the status is not 'complete', this value is an estimate and may be adjusted upon completion based on the actual FPS of the output video. If video generation fails, credits will be refunded, and this field will be updated to include the refund.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / assets / properties / face_mappings / items / properties / new_face / description
      Previous value: -"The face image that will be used to replace the face in the `original_face`. This value is either\n- a direct URL to the video file\n- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).\n\nSee the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.\n"New value: +"The face image that will be used to replace the face in the `original_face`. This value is either\n- a direct URL to the file. The URL path must end in a supported file extension.\n- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).\n\nSee the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.\n"
    • changedInput schema / properties / assets / properties / image_file_path / description
      Previous value: -"The path of the input image with the face to be swapped.  The value is required if `face_swap_mode` is `all-faces`.\n\nThis value is either\n- a direct URL to the video file\n- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).\n\nSee the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.\n"New value: +"The path of the input image with the face to be swapped.  The value is required if `face_swap_mode` is `all-faces`.\n\nThis value is either\n- a direct URL to the file. The URL path must end in a supported file extension.\n- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).\n\nSee the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.\n"
    • changedInput schema / properties / assets / properties / video_file_path / description
      Previous value: -"Your video file. Required if `video_source` is `file`. This value is either\n- a direct URL to the video file\n- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).\n\nSee the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.\n"New value: +"Your video file. Required if `video_source` is `file`. This value is either\n- a direct URL to the file. The URL path must end in a supported file extension.\n- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).\n\nSee the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.\n"
  2. Changed3 schema fields changed
    • addedInput schema / properties / assets / example
      Added value: +{
      +  "face_swap_mode": "all-faces",
      +  "image_file_path": "api-assets/id/1234.png",
      +  "video_file_path": "api-assets/id/1234.mp4",
      +  "video_source": "file"
      +}
    • changedInput schema / properties / assets / properties / image_file_path / example
      Previous value: -"image/id/1234.png"New value: +"api-assets/id/1234.png"
    • changedInput schema / properties / end_seconds / example
      Previous value: -15New value: +5
  3. Changed1 schema field changed
    • changedInput schema / properties / assets / properties / face_swap_mode / description
      Previous value: -"Choose how to swap faces:\n**all-faces** (recommended) — swap all detected faces using one source image (`source_file_path` required)\n+- **individual-faces** — specify exact mappings using `face_mappings`"New value: +"Choose how to swap faces:\n- **all-faces** (recommended) — swap all detected faces using one source image (`source_file_path` required)\n- **individual-faces** — specify exact mappings using `face_mappings`"
  4. Changed1 schema field changed
    • removedInput schema / properties / context
      Removed value: -{
      -  "description": "Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\"",
      -  "type": "string"
      -}
  5. Changed1 schema field changed
    • addedInput schema / properties / context
      Added value: +{
      +  "description": "Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\"",
      +  "type": "string"
      +}
  6. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only declare readOnly=false and openWorld=true; the description adds the behavior that matters — the call is a queued job returning id and credits_charged, credits are charged (estimate now, final on completion), and signed download URLs must be preserved verbatim. It stops short of noting concurrency limits or typical job duration.

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?

Structure is good — the safety constraint leads, then a bulleted 'MCP guidance' block for the job lifecycle and file-path handling. It is slightly long, with a few restated points (file-path rules appear twice), but no sentence is pure 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 a credit-consuming async mutation with nested assets, the description covers lifecycle, follow-up tooling, credits, URL handling, and the mode-dependent required fields. An output schema exists, yet the description still names the key return fields, so an agent has everything needed to call it and act on the result.

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 100%, so the baseline is 3, but the description goes further by stating the cross-field conditionals: start_seconds/end_seconds plus assets.video_source with its matching video_file_path or youtube_url, and image_file_path for all-faces vs face_mappings for individual-faces. That conditional framing is the part of the schema that is hardest to infer.

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?

The title and body together make clear this is an asynchronous face-swap job on an existing video, and the parameter prose reinforces the video-source model. It never explicitly contrasts itself with the sibling face_swap_photo_create_image or character_replace_create_video, so sibling differentiation is left to the tool name.

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 states the async pattern and names the follow-up tool explicitly ('call wait_for_video_project with that id or poll ... until complete, error, or canceled'), plus concrete guidance on when to prefer the upload-URL endpoint over direct public URLs. It also gives explicit when-not-to-use boundaries around authorization, impersonation, sexual content, and minors.

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.

Resources