Skip to main content
Glama
ilhankilic

YaparAI MCP Server

by ilhankilic

generate_mannequin

Generate realistic AI mannequin photos for clothing and accessories using a product image. Describe the desired model and background to create e-commerce product listings.

Instructions

Generate an AI mannequin / model photo for products.

Upload a product image (clothing, accessory) and the AI will generate a realistic mannequin/model wearing or displaying it. Great for e-commerce product listings. Cost: ~6 credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the desired mannequin/model (e.g., "young woman, studio lighting", "male model, outdoor setting")
image_urlYesURL of the product image

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the generate_mannequin tool. It accepts prompt and image_url parameters, calls the YaparAIClient.generate() with mode='manken_uret' (Turkish for 'mannequin generate'), polls for the result via wait_for_result(), and returns a dict with image_url, job_id, credits_used, and balance_remaining.
    async def generate_mannequin(
        prompt: str,
        image_url: str,
    ) -> dict:
        """
        Generate an AI mannequin / model photo for products.
    
        Upload a product image (clothing, accessory) and the AI will
        generate a realistic mannequin/model wearing or displaying it.
        Great for e-commerce product listings.
        Cost: ~6 credits.
    
        Args:
            prompt: Description of the desired mannequin/model
                (e.g., "young woman, studio lighting", "male model, outdoor setting")
            image_url: URL of the product image
    
        Returns:
            Dict with image_url (mannequin image), job_id, credits_used,
            and balance_remaining.
        """
        client = YaparAIClient()
        job = await client.generate({
            "type": "image",
            "mode": "manken_uret",
            "prompt": prompt,
            "image_url": image_url,
        })
    
        result = await client.wait_for_result(job["job_id"], timeout=90)
        return {
            "status": "success",
            "image_url": result.get("result_url"),
            "job_id": result.get("job_id"),
            "credits_used": job.get("credits_used"),
            "balance_remaining": job.get("balance_remaining"),
        }
  • The docstring for generate_mannequin serves as the input/output schema definition. It documents prompt (description of mannequin/model) and image_url (product image URL) as inputs, and the returned dict fields.
    """
    Generate an AI mannequin / model photo for products.
    
    Upload a product image (clothing, accessory) and the AI will
    generate a realistic mannequin/model wearing or displaying it.
    Great for e-commerce product listings.
    Cost: ~6 credits.
    
    Args:
        prompt: Description of the desired mannequin/model
            (e.g., "young woman, studio lighting", "male model, outdoor setting")
        image_url: URL of the product image
    
    Returns:
        Dict with image_url (mannequin image), job_id, credits_used,
        and balance_remaining.
  • Registration of generate_mannequin as an MCP tool on the FastMCP server instance via mcp.tool(generate_mannequin).
    mcp.tool(generate_mannequin)
  • Import of generate_mannequin from the ecommerce module into the server, enabling it to be registered as an MCP tool.
    generate_mannequin,
  • The YaparAIClient.generate() and YaparAIClient.wait_for_result() helper methods used by generate_mannequin to make the API call and poll for results.
    async def generate(self, request: dict) -> dict:
        """Start a generation job."""
        return await self._request("POST", "/v1/public/generate", json=request)
    
    async def get_job(self, job_id: str) -> dict:
        """Get job status and result."""
        return await self._request("GET", f"/v1/public/jobs/{job_id}")
    
    async def get_balance(self) -> dict:
        """Get credit balance."""
        return await self._request("GET", "/v1/public/balance")
    
    async def get_models(self) -> dict:
        """List available models and their credit costs."""
        return await self._request("GET", "/v1/public/models")
    
    async def wait_for_result(
        self,
        job_id: str,
        timeout: int = 120,
        poll_interval: int = 3,
    ) -> dict:
        """Poll job status until completed or timeout."""
        elapsed = 0
        while elapsed < timeout:
            job = await self.get_job(job_id)
            status = job.get("status", "")
            if status == "succeeded":
                return job
            if status == "failed":
                error = job.get("error_message") or job.get("error") or "Unknown error"
                raise RuntimeError(f"Generation failed: {error}")
            await asyncio.sleep(poll_interval)
            elapsed += poll_interval
        raise TimeoutError(
            f"Job {job_id} is still processing after {timeout}s. "
            f"Use get_job_status('{job_id}') to check later."
        )
Behavior2/5

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

No annotations provided; description lacks behavioral details such as processing time, output format, or reversibility. Only mentions generation and cost.

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?

Two short, focused sentences with bolded first line, no fluff, every sentence adds value.

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?

Given the tool complexity (2 params), output schema present, and description includes cost, it is fairly complete but misses behavioral nuances like output type.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers both parameters with descriptions; description adds no extra semantic meaning beyond cost mention, so baseline 3 is appropriate.

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?

Clearly states the verb 'generate' and the resource 'mannequin/model photo', and distinguishes from siblings like 'generate_image' and 'virtual_try_on' by specifying it's for product images in e-commerce.

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?

Provides clear usage context (upload product image, AI generates model) and mentions cost (~6 credits), but does not explicitly state when not to use or compare with alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ilhankilic/yaparai-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server