$npx -y skills add imsus/pi-extension-minimax-coding-plan-mcp --skill minimax-image-understandingAnalyze images using AI with the understand_image tool
| 1 | # MiniMax Image Understanding Skill |
| 2 | |
| 3 | Use this skill when you need to analyze, describe, or extract information from images. |
| 4 | |
| 5 | ## How to Use |
| 6 | |
| 7 | Call the `understand_image` tool directly with a prompt and image URL: |
| 8 | |
| 9 | ``` |
| 10 | understand_image({ |
| 11 | prompt: "Your question about the image", |
| 12 | image_url: "https://example.com/image.png" |
| 13 | }) |
| 14 | ``` |
| 15 | |
| 16 | ## When to Use |
| 17 | |
| 18 | Use `understand_image` when: |
| 19 | |
| 20 | - **Screenshots**: Error messages, UI issues, code in screenshots |
| 21 | - **Visual content**: Photos, diagrams, charts, graphs |
| 22 | - **Documents**: Extracting text from images (OCR), understanding layouts |
| 23 | - **UI/UX analysis**: Evaluating designs, identifying components |
| 24 | - **Visual debugging**: Understanding visual bugs or layout issues |
| 25 | |
| 26 | ## When NOT to Use |
| 27 | |
| 28 | Do NOT use `understand_image` when: |
| 29 | |
| 30 | - **Image is already described** in the conversation |
| 31 | - **The image is a simple icon** or emoji you recognize |
| 32 | - **No image is provided** or the image URL is inaccessible |
| 33 | - **Redundant with existing context** (e.g., file contents already visible) |
| 34 | |
| 35 | ## Usage |
| 36 | |
| 37 | ``` |
| 38 | understand_image({ |
| 39 | prompt: "What do you see in this image?", |
| 40 | image_url: "https://example.com/screenshot.png" |
| 41 | }) |
| 42 | ``` |
| 43 | |
| 44 | ## API Details |
| 45 | |
| 46 | **Endpoint**: `POST {api_host}/v1/coding_plan/vlm` |
| 47 | |
| 48 | **Request Body**: |
| 49 | ```json |
| 50 | { |
| 51 | "prompt": "Your question about the image", |
| 52 | "image_url": "data:image/jpeg;base64,/9j/4AAQ..." |
| 53 | } |
| 54 | ``` |
| 55 | |
| 56 | **Response Format**: |
| 57 | ```json |
| 58 | { |
| 59 | "content": "AI analysis of the image...", |
| 60 | "base_resp": { |
| 61 | "status_code": 0, |
| 62 | "status_msg": "success" |
| 63 | } |
| 64 | } |
| 65 | ``` |
| 66 | |
| 67 | ## Image Processing |
| 68 | |
| 69 | The tool automatically handles three types of image inputs: |
| 70 | |
| 71 | 1. **HTTP/HTTPS URLs**: Downloads the image and converts to base64 |
| 72 | - Example: `https://example.com/image.jpg` |
| 73 | |
| 74 | 2. **Local file paths**: Reads local files and converts to base64 |
| 75 | - Absolute: `/Users/username/Documents/image.png` |
| 76 | - Relative: `images/photo.png` |
| 77 | - Removes `@` prefix if present |
| 78 | |
| 79 | 3. **Base64 data URLs**: Passes through existing base64 data |
| 80 | - Example: `data:image/png;base64,iVBORw0KGgo...` |
| 81 | |
| 82 | ## Image Formats |
| 83 | |
| 84 | Supported: |
| 85 | - **JPEG** (.jpg, .jpeg) |
| 86 | - **PNG** (.png) |
| 87 | - **WebP** (.webp) |
| 88 | |
| 89 | Not supported: |
| 90 | - PDF, GIF, PSD, SVG, and other formats |
| 91 | |
| 92 | ## Crafting Effective Prompts |
| 93 | |
| 94 | ### For Descriptions |
| 95 | - "Describe what's in this image in detail" |
| 96 | - "What is the main subject of this image?" |
| 97 | - "Describe the visual style and composition" |
| 98 | |
| 99 | ### For Code/Technical |
| 100 | - "What code is shown in this screenshot?" |
| 101 | - "Extract all text from this image" |
| 102 | - "Identify the UI framework/components used" |
| 103 | |
| 104 | ### For Analysis |
| 105 | - "Analyze this UI design. What is working well and what could be improved?" |
| 106 | - "What emotions or mood does this image convey?" |
| 107 | - "Compare this design to Material Design principles" |
| 108 | |
| 109 | ### For OCR/Text Extraction |
| 110 | - "Extract all text from this image" |
| 111 | - "Read the error message in this screenshot" |
| 112 | - "What does the label say in this image?" |
| 113 | |
| 114 | ## Examples |
| 115 | |
| 116 | ### Error Analysis |
| 117 | ``` |
| 118 | understand_image({ |
| 119 | prompt: "What is the error message and where is it located in this screenshot?", |
| 120 | image_url: "./error-screenshot.png" |
| 121 | }) |
| 122 | ``` |
| 123 | |
| 124 | ### Code Screenshot |
| 125 | ``` |
| 126 | understand_image({ |
| 127 | prompt: "What code is shown in this screenshot? Please transcribe it exactly.", |
| 128 | image_url: "https://example.com/code.png" |
| 129 | }) |
| 130 | ``` |
| 131 | |
| 132 | ### Design Review |
| 133 | ``` |
| 134 | understand_image({ |
| 135 | prompt: "Analyze this UI design. What is working well and what could be improved?", |
| 136 | image_url: "https://example.com/mockup.png" |
| 137 | }) |
| 138 | ``` |
| 139 | |
| 140 | ### OCR |
| 141 | ``` |
| 142 | understand_image({ |
| 143 | prompt: "Extract all text from this image", |
| 144 | image_url: "/Users/username/Documents/scan.png" |
| 145 | }) |
| 146 | ``` |
| 147 | |
| 148 | ## Tips |
| 149 | |
| 150 | 1. **Be specific** in your prompt about what you want to know |
| 151 | 2. **Mention format** if you need structured output (e.g., "list all elements") |
| 152 | 3. **Include context** if the image is part of a larger task |
| 153 | 4. **For screenshots**, specify if you need full-page or just a specific area |
| 154 | 5. **Complex analysis** may trigger a confirmation prompt (analyze, extract, describe, recognize, transcribe, read) |
| 155 | |
| 156 | ## Error Handling |
| 157 | |
| 158 | - **Status code 1004**: Authentication error - check API key and region |
| 159 | - **Status code 2038**: Real-name verification required |
| 160 | - **Invalid image**: File doesn't exist or URL is inaccessible |
| 161 | - **Unsupported format**: Image format not in JPEG, PNG, WebP |