brickognize_identify_set
Identify LEGO sets from photos of boxes, assembled models, or instruction manuals. Upload an image to get set numbers, names, and confidence scores.
Instructions
Identify a LEGO set from a photograph of its box, assembled model, or instructions. Use instead of brickognize_identify when you know the image shows a LEGO set.
Provide imagePath — absolute path to a local image file (JPEG, PNG, or WebP). Returns matched sets with set numbers, names, confidence scores, and links.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| imagePath | No | Absolute path to a local image file (JPEG, PNG, or WebP). | |
| includeRaw | No | When true, includes the raw Brickognize API response alongside formatted results. Useful for debugging. |
Implementation Reference
- src/tools/predict.ts:7-53 (handler)The `createPredictTool` function acts as a factory/handler that processes image inputs, calls the Brickognize API, and formats the output. The tool 'brickognize_identify_set' uses this generic handler configured with the '/predict/sets/' endpoint.
export function createPredictTool( server: McpServer, name: string, title: string, description: string, endpoint: string, ): void { server.registerTool( name, { title, description, inputSchema: imageInputSchema, annotations: TOOL_ANNOTATIONS, }, async (input) => { try { const { blob, filename } = await resolveImage(input); const raw = await predict(endpoint, blob, filename); const result = mapPredictionResult(raw, input.includeRaw ?? false); return { content: [ { type: "text" as const, text: result.summary, }, { type: "text" as const, text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { isError: true, content: [ { type: "text" as const, text: formatToolError(error), }, ], }; } }, ); } - src/tools/predictSets.ts:4-15 (registration)Registration logic for 'brickognize_identify_set' tool. It calls the generic `createPredictTool` factory with the appropriate name and endpoint.
export function registerIdentifySetTool(server: McpServer): void { createPredictTool( server, "brickognize_identify_set", "Identify LEGO Set", "Identify a LEGO set from a photograph of its box, assembled model, or instructions. " + "Use instead of brickognize_identify when you know the image shows a LEGO set.\n\n" + "Provide imagePath — absolute path to a local image file (JPEG, PNG, or WebP).\n" + "Returns matched sets with set numbers, names, confidence scores, and links.", "/predict/sets/", ); }