Skip to main content
Glama

generate_image

Create AI-generated images from text prompts using VAP (Flux2 Pro) technology. Specify aspect ratios and quality settings for customized visual content generation.

Instructions

Generate an AI image from text prompt using VAP (Flux2 Pro). Returns a task ID for async tracking. Cost: $0.18

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDetailed description of the image to generate. Note: If aspect ratio is mentioned in the prompt (e.g., '16:9', 'widescreen', 'portrait'), also pass it in the aspect_ratio parameter for guaranteed correct dimensions.
aspect_ratioNoOutput image aspect ratio. If the user mentions a specific ratio like '16:9' or 'widescreen' in their prompt, extract and pass it here explicitly for best results.1:1
qualityNoGeneration quality (high costs 1.5x)standard

Implementation Reference

  • Tool handler for MCP request routing; it routes 'generate_image' to the backend API via 'make_request'.
    def handle_tools_call(params: Dict) -> Dict:
        """
        Handle tools/call request.
    
        Directive #240: Special handlers for video tools.
        """
        tool_name = params.get("name", "")
        arguments = params.get("arguments", {})
    
        # ═══════════════════════════════════════════════════════════════════
        # VIDEO TOOL HANDLERS (Directive #240)
        # ═══════════════════════════════════════════════════════════════════
    
        if tool_name == "generate_video":
            return _handle_generate_video(arguments)
    
        if tool_name == "estimate_video_cost":
            return _handle_estimate_video_cost(arguments)
    
        if tool_name == "get_task":
            return _handle_get_task(arguments)
    
        # Default: forward to MCP API
        response = make_request("/tools/call", {
            "name": tool_name,
            "arguments": arguments
        })
        return response

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/elestirelbilinc-sketch/Media-infrastructure'

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