describe
Generate AI descriptions of images using vision providers like Gemini, OpenAI, or Claude. Specify detail level and optional prompts for customized analysis.
Instructions
Get an AI-generated description of an image. Supports multiple providers (Gemini, OpenAI, Claude).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Path to the image file | |
| prompt | No | Optional question or instruction for the description | |
| provider | No | Vision provider to use (default: gemini) | |
| detail | No | Level of detail in the description (default: detailed) |
Implementation Reference
- src/tools/describe.ts:44-76 (handler)The handleDescribe function that executes the 'describe' tool: processes input args, converts image to base64, delegates to the selected provider's describe function (gemini, openai, or claude), and returns the generated description as text content.export async function handleDescribe(args: Record<string, unknown>) { const image = args.image as string; const prompt = args.prompt as string | undefined; const provider = (args.provider as Provider) || "gemini"; const detail = (args.detail as "brief" | "detailed") || "detailed"; const { base64, mimeType } = await imageToBase64(image); let description: string; switch (provider) { case "gemini": description = await geminiDescribe(base64, mimeType, prompt, detail); break; case "openai": description = await openaiDescribe(base64, mimeType, prompt, detail); break; case "claude": description = await claudeDescribe(base64, mimeType, prompt, detail); break; default: throw new Error(`Unknown provider: ${provider}`); } return { content: [ { type: "text", text: description, }, ], }; }
- src/tools/describe.ts:14-42 (schema)The describeTool object defines the tool's metadata, including name, description, and inputSchema for parameter validation.export const describeTool: Tool = { name: "describe", description: "Get an AI-generated description of an image. Supports multiple providers (Gemini, OpenAI, Claude).", inputSchema: { type: "object", properties: { image: { type: "string", description: "Path to the image file or URL (http/https)", }, prompt: { type: "string", description: "Optional question or instruction for the description", }, provider: { type: "string", enum: ["gemini", "openai", "claude"], description: "Vision provider to use (default: gemini)", }, detail: { type: "string", enum: ["brief", "detailed"], description: "Level of detail in the description (default: detailed)", }, }, required: ["image"], }, };
- src/index.ts:37-46 (registration)Registration of the describeTool in the MCP server's listTools request handler, making it available for discovery.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ describeTool, detectTool, describeRegionTool, analyzeColorsTool, ], }; });
- src/index.ts:54-56 (registration)Dispatch in the server's CallToolRequestSchema handler that routes 'describe' tool calls to the handleDescribe function.case "describe": return await handleDescribe(args); case "detect":