Skip to main content
Glama

Swap face in photo

swap_face_in_photo

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 a supplied photo using a source face image or selected face mappings. Costs 10 credits; output size depends on subscription. Returns a project id for wait_for_image_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.

Input Schema

NameRequiredDescriptionDefault
nameNoOptional project name for identifying this output. Omit to use the API's default project name.Face Swap - dateTime
assetsNoProvide the assets for face swap photo
source_faceNoAttach the source face from ChatGPT for this input.
target_imageNoAttach the target image from ChatGPT for this input.
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 image. Use it with the [Get image Project API](https://docs.magichour.ai/api-reference/image-projects/get-image-details) to fetch status and downloads.
credits_chargedYesThe amount of credits deducted from your account to generate the image. We charge credits right when the request is made. If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • addedInput schema / anyOf
      Added value: +[
      +  {
      +    "required": [
      +      "target_image"
      +    ]
      +  },
      +  {
      +    "properties": {
      +      "assets": {
      +        "required": [
      +          "target_file_path"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "assets"
      +    ]
      +  }
      +]
    • 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"
      +]
    • removedInput schema / properties / assets / required
      Removed value: -[
      -  "target_file_path"
      -]
    • 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 / target_image
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Attach the target image 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"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "assets"
      -]
  2. Changed1 schema field changed
    • changedInput schema / properties / name / description
      Previous value: -"Give your image 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.1/5.0
Behavior5/5

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

Beyond the annotations (which only say non-read-only, non-destructive, open-world, non-idempotent), the description discloses the 10-credit cost, that output size depends on the subscription, that the response carries a project id for wait_for_image_project, and that availability of models/resolutions varies by account. It also sets a failure-recovery behavior for bad attachments. This is materially useful context an agent cannot get from the structured fields.

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?

The purpose sentence is buried behind a policy preamble, so the definition is not front-loaded on what the tool does. Sentences such as 'Preserve explicit requirements and all supplied inputs' and 'Account balance alone does not prove a request is affordable' are general policy boilerplate that could be trimmed without losing tool-specific information.

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 a costly, account-dependent generative tool with an output schema and a required follow-up call, the description covers cost, result retrieval, attachment handling, and constraint-checking prerequisites. The one gap is guidance on how this differs from the other face-editing siblings, which matters given the crowded tool set.

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 a 3 is the baseline, but the description adds real routing meaning: prefer the named attachment fields (source_face, target_image, replacement_faces) over the assets path fields, and ask the user to disambiguate when roles are unclear. That resolves genuine ambiguity in a nested schema with two alternative input shapes.

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 description states a specific verb and resource: 'Swaps faces in a supplied photo using a source face image or selected face mappings.' It names the two input modes, which clarifies scope. However, it never distinguishes itself from nearby siblings such as swap_head_in_photo or edit_face_in_photo, so an agent must infer the boundary.

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?

There is explicit operational guidance: read get_account_info before choosing settings, treat listed parameters as not necessarily co-available, and use the named attachment fields first for ChatGPT files. It also routes the agent to wait_for_image_project for the result. What's missing is a 'use this instead of X' comparison against the sibling face-editing tools.

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.