Skip to main content
Glama

Face Detection

face_detection_detect_faces

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

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.

Input 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

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.

  1. 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"
      -}
  2. 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"
      +}
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations (readOnlyHint=false, openWorldHint=true, destructiveHint=false) signal a non-read-only external call, but the description adds meaningful behavior: it is asynchronous and returns an id, requires a second call to fetch results, has file-fetching caveats, and is currently free. It does not state rate limits or exact failure modes, keeping it just short of full transparency.

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 core purpose sentence is buried after a multi-bullet MCP guidance block, so the definition is not front-loaded. The guidance and the pricing note are useful, but the ordering and some overlap (file-path advice appears in both the guidance block and effectively repeats the schema) make it less tight than it could be.

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?

With an output schema present, return values needn't be explained, and the description covers the async lifecycle, the required follow-up call, and input-source handling. It is complete for correct invocation, though it could note expected latency or that the id must be polled until completion.

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 genuinely adds value for `target_file_path` by explaining the acceptable sources and steering users toward the upload-URL endpoint. It adds less beyond the schema for `confidence_score`, which is already well documented.

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?

States a specific verb+resource: 'Detect faces in an image or video.' It also distinguishes itself from siblings by naming the retrieval endpoint (face_detection_retrieve_details via 'the face-detection details endpoint') as the follow-up and identifying the face-swap APIs as downstream consumers. An agent can tell this apart from face_swap_* and retrieve_details without opening a 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?

Explicit workflow guidance: this starts an async task returning an `id`, and you must use the details endpoint with that id before doing individual face swaps. It also gives file-path usage rules (existing Magic Hour path vs. upload-URL endpoint's file_path, prefer upload when unsure, hotlinked URLs may fail). When-to-use and the alternative pathway are both covered.

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