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.

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and handles it well: it discloses the async task behavior, the returned id, the need to poll the details endpoint, file-path reliability caveats, and pricing changes. This goes 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a one-sentence purpose, followed by a short use-case note and targeted MCP guidance. The bullets and linked docs keep it scannable without redundant restatement of the schema.

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?

The description covers the essential procedural context: async task lifecycle, how to retrieve results, and how to provide valid input files. Given the output schema exists, return-value details are not required, and the file-upload guidance closes the main practical gap.

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 structured parameter descriptions already carry the baseline. The description adds valuable file-path guidance (prefer upload-returned file_path over hotlinked URLs), which explains common failure modes beyond what the schema states.

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') and then clarifies the output is a list of faces intended for face-swap workflows. It differentiates itself from the sibling retrieve-details tool by explaining that this call starts an async detection task and returns an id, while face_detection_retrieve_details returns the detected faces.

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?

It clearly states when to use the API (before multi-face swaps) and routes the agent to the face-detection details endpoint for face retrieval. It does not explicitly enumerate when-not-to-use cases, but the workflow context is unambiguous enough for tool selection.

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.9/5.0
Disambiguation3/5

Most tools are differentiated by product-specific prefixes (e.g., lip_sync, text_to_video, image_upscaler), but the set contains many overlapping create_image/create_video tools, and generic editors like ai_image_editor_create_image and ai_video_editor_create_video blur boundaries with their more specific counterparts. Face/body swapping tools also occupy a similar conceptual space, requiring careful description reading to avoid misselection.

Naming Consistency4/5

Names generally follow a descriptive snake_case pattern of feature plus action (e.g., text_to_video_create_video, image_projects_delete, wait_for_image_project). Minor inconsistencies like ai_face_editor_edit_image versus the dominant create_image suffix, and the mixed ai_ prefix usage across tools, prevent a perfect score.

Tool Count2/5

44 tools is a large surface for an MCP server, even for a broad media-generation API. The count exceeds the 25+ threshold and creates a heavy selection burden, especially with over a dozen create tools for images and videos.

Completeness4/5

The surface covers the full create-to-download workflow for image, video, and audio: creation, status polling, wait helpers, fetch helpers, delete, and asset upload support. Minor gaps include no list/cancel endpoints and no general project search, but agents can complete core tasks without dead ends.

Resources