Skip to main content
Glama

Swap face in video

swap_face_in_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.

Swaps faces in an existing video: all faces with a reference image, or selected faces using detect_faces results. Starts a background job that costs credits; returns a project id for wait_for_video_project. Before choosing settings, read get_account_info and the current parameter constraints. A listed model, resolution, duration or count is not necessarily available together or on this account. Preserve explicit requirements and all supplied inputs; explain a genuine block instead of submitting an incompatible request. Account balance alone does not prove a request is affordable. Use the named attachment fields first for ChatGPT files. Ask which file goes where if their roles are unclear. If a file fails, ask the user to attach it again and keep the requested settings.

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": {
      "start_seconds": "<start_seconds>",
      "end_seconds": "<end_seconds>",
      "assets": "<assets>"
    },
    "name": "swap_face_in_video"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoOptional project name for identifying this output. Omit to use the API's default project name.Face Swap - dateTime
styleNoStyle of the face swap video.
videoNoAttach the video from ChatGPT for this input. Set assets.video_source to file.
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.
source_faceNoAttach the source face from ChatGPT for this input.
start_secondsYesStart time of your clip (seconds). Must be ≥ 0.
replacement_facesNoAttached image files. Set image_index in each matching entry to its position in this list, starting at 1.

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. Changed6 schema fields changed
    • addedInput schema / properties / assets / properties / face_mappings / items / oneOf
      Added value: +[
      +  {
      +    "required": [
      +      "new_face"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "image_index"
      +    ]
      +  }
      +]
    • addedInput schema / properties / assets / properties / face_mappings / items / properties / image_index
      Added value: +{
      +  "description": "Position in replacement_faces, starting at 1. Use exactly one attachment index or new_face.",
      +  "maximum": 5,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedInput schema / properties / assets / properties / face_mappings / items / required
      Previous value: -[
      -  "original_face",
      -  "new_face"
      -]New value: +[
      +  "original_face"
      +]
    • addedInput schema / properties / replacement_faces
      Added value: +{
      +  "description": "Attached image files. Set image_index in each matching entry to its position in this list, starting at 1.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "download_url": {
      +        "description": "Exact HTTPS download URL supplied for the native ChatGPT attachment, including its signed query.",
      +        "title": "Download Url",
      +        "type": "string"
      +      },
      +      "file_id": {
      +        "description": "Native ChatGPT file identifier paired with download_url; not a local filesystem path.",
      +        "title": "File Id",
      +        "type": "string"
      +      },
      +      "file_name": {
      +        "default": "",
      +        "description": "Original attachment filename, when supplied by ChatGPT.",
      +        "title": "File Name",
      +        "type": "string"
      +      },
      +      "mime_type": {
      +        "default": "",
      +        "description": "Attachment MIME type, when supplied by ChatGPT.",
      +        "title": "Mime Type",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "download_url",
      +      "file_id"
      +    ],
      +    "title": "ChatGPTFile",
      +    "type": "object"
      +  },
      +  "maxItems": 5,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / source_face
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Attach the source face from ChatGPT for this input.",
      +  "properties": {
      +    "download_url": {
      +      "description": "Exact HTTPS download URL supplied for the native ChatGPT attachment, including its signed query.",
      +      "title": "Download Url",
      +      "type": "string"
      +    },
      +    "file_id": {
      +      "description": "Native ChatGPT file identifier paired with download_url; not a local filesystem path.",
      +      "title": "File Id",
      +      "type": "string"
      +    },
      +    "file_name": {
      +      "default": "",
      +      "description": "Original attachment filename, when supplied by ChatGPT.",
      +      "title": "File Name",
      +      "type": "string"
      +    },
      +    "mime_type": {
      +      "default": "",
      +      "description": "Attachment MIME type, when supplied by ChatGPT.",
      +      "title": "Mime Type",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "download_url",
      +    "file_id"
      +  ],
      +  "title": "ChatGPTFile",
      +  "type": "object"
      +}
    • addedInput schema / properties / video
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Attach the video from ChatGPT for this input. Set assets.video_source to file.",
      +  "properties": {
      +    "download_url": {
      +      "description": "Exact HTTPS download URL supplied for the native ChatGPT attachment, including its signed query.",
      +      "title": "Download Url",
      +      "type": "string"
      +    },
      +    "file_id": {
      +      "description": "Native ChatGPT file identifier paired with download_url; not a local filesystem path.",
      +      "title": "File Id",
      +      "type": "string"
      +    },
      +    "file_name": {
      +      "default": "",
      +      "description": "Original attachment filename, when supplied by ChatGPT.",
      +      "title": "File Name",
      +      "type": "string"
      +    },
      +    "mime_type": {
      +      "default": "",
      +      "description": "Attachment MIME type, when supplied by ChatGPT.",
      +      "title": "Mime Type",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "download_url",
      +    "file_id"
      +  ],
      +  "title": "ChatGPTFile",
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / name / description
      Previous value: -"Give your video a custom name for easy identification."New value: +"Optional project name for identifying this output. Omit to use the API's default project name."
  3. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare it is a non-idempotent, non-destructive, open-world write. The description adds behavior the annotations cannot convey: it launches a background job, consumes credits, returns a project id rather than the finished video, and that advertised models/resolutions/durations may not be jointly available or available on this account. The affordability caveat is an unusually useful disclosure for a credit-spending call.

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?

Most sentences carry real operational value, but the opening policy sentence displaces the actual purpose statement, and the trailing file-retry/reattachment guidance is somewhat verbose relative to its importance. Dense but not padded with repetition.

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?

For an 8-parameter, nested-object, credit-spending async tool with an output schema, the description covers cost, asynchrony, prerequisites, follow-up, and file handling. It leaves the asset-role disambiguation partly to the schema, which is a minor gap given how rich that schema already is.

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; the description earns a step above by explaining the practical semantics of the two-mode switch and by directing the agent to prefer named attachment fields over raw paths and to ask when file roles are unclear. It does not touch start/end seconds or style versioning, but those are already fully documented 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?

The second sentence gives a precise verb and resource ("Swaps faces in an existing video") and immediately distinguishes the two operating modes: all faces via a reference image, or selected faces using detect_faces output. An agent can tell this apart from photo-based siblings and from detect_faces without opening the 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 states explicit prohibited uses (impersonation, deception, sexual content, minors), names prerequisite tools to consult before choosing settings (get_account_info, detect_faces, parameter constraints), and names the follow-up tool for the returned project id (wait_for_video_project). It also gives a fallback behavior when file roles are ambiguous, so the agent knows what to do rather than guess.

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.