Skip to main content
Glama

face_detection_detect_faces

Detect faces in an image or video.

Use this API to get the list of faces detected in the image or video to use in the face swap photo or face swap video API calls for multi-face swaps.

Note: Face detection is free to use for the near future. Pricing may change in the future.

MCP guidance:

  • This starts an async face-detection task and returns an id. Use the face-detection details endpoint with that id to retrieve detected faces before doing individual face swaps.

  • For *_file_path values, prefer an existing Magic Hour file path or a file_path returned by the upload-URL endpoint after the file bytes are uploaded. Direct public media URLs may work when they are stable, fetchable, and return raw file bytes, but hotlinked URLs can fail; when in doubt, use the presigned upload flow first and pass the returned file_path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetsYesProvide the assets for face detection
confidence_scoreNoConfidence threshold for filtering detected faces. * Higher values (e.g., 0.9) include only faces detected with high certainty, reducing false positives. * Lower values (e.g., 0.3) include more faces, but may increase the chance of incorrect detections.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe id of the task. Use this value in the [get face detection details API](https://docs.magichour.ai/api-reference/files/get-face-detection-details) to get the details of the face detection task.
credits_chargedYesThe credits charged for the task.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

There are no annotations, so the description carries full responsibility for behavioral disclosure. It clearly states that this starts an async task, returns an id, and requires a follow-up details call. It also reveals URL reliability risks, the free/pricing caveat, and preferred file-path handling, going well beyond the minimum.

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 description is front-loaded with a clear one-line summary and then organized into context, pricing, and MCP guidance. It is longer than average but most sentences add operational value. The pricing note is slightly tangential but still useful for cost-sensitive agents, so the length is mostly justified.

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?

Given the async nature of the tool, the description covers the complete invocation flow: start detection, retrieve id, call details endpoint, and then proceed to face swaps. It also provides practical upload guidance and links to relevant docs. With an output schema present, no further return-value explanation is needed.

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?

The input schema already documents both parameters with full coverage. The description adds practical value by explaining how to choose the target_file_path value, warning about hotlinked URLs, and recommending the upload URL flow. Confidence threshold semantics are already well described in the schema, so the description does not need to repeat them.

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 and resource: 'Detect faces in an image or video.' It also names the downstream use case (face swap photo/video APIs), which clearly distinguishes this tool from the many sibling generation tools. An agent can tell exactly what this tool does and why it exists.

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?

The description explicitly says when to use the tool: to get the list of detected faces before making face swap calls for multi-face swaps. The MCP guidance goes further, explaining the async flow and directing the agent to the face-detection details endpoint. File-path guidance also helps choose between direct URLs and the presigned upload flow.

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.

TDQS

A3.6/5.0
Disambiguation3/5

Most generation tools target distinct media types or effects (e.g., clothes changer, head swap, lip sync), but several boundaries blur: ai_image_editor_create_image is a generic edit tool that overlaps conceptually with ai_face_editor_edit_image, ai_image_upscaler_create_image, and background remover. The wait_for_*_project helpers also overlap functionally with the *_projects_retrieve_details status tools, and ai_voice_cloner_create_audio vs. ai_voice_generator_create_audio are easy to confuse by name.

Naming Consistency2/5

Naming conventions are mixed: many tools follow ai_<product>_create_<media>, but others are product-first (animation_create_video, body_swap_create_image) and resource-group tools follow a different noun_verb pattern (audio_projects_retrieve_details, video_projects_delete). Verbs are inconsistent too (create_image, edit_image, detect_faces, retrieve_details, wait_for, fetch), so an agent cannot reliably predict the next tool name.

Tool Count2/5

At 44 tools, the set is heavy: it includes 27 generation tools plus three wait helpers, three status retrieval tools, three delete tools, three fetch helpers, and upload/ping utilities. While the underlying product is broad, many helpers could be consolidated, and the overall surface exceeds the range where each tool earns a clear place.

Completeness3/5

The lifecycle is mostly covered for image, video, and audio projects: create, poll/retrieve, fetch download, delete, and file upload/presigned-URL generation are all present. However, there is no project listing or cancel operation, and face detection only has detect/details with no delete or wait helper, leaving some workflow gaps an agent must work around.