Skip to main content
Glama
NazarLysyi

Brickognize MCP Server

by NazarLysyi

brickognize_identify_fig

Identify LEGO minifigures from uploaded photos. Upload an image file to get minifigure names, IDs, confidence scores, and reference links.

Instructions

Identify a LEGO minifigure from a photograph. Use instead of brickognize_identify when you know the image shows a minifigure.

Provide imagePath — absolute path to a local image file (JPEG, PNG, or WebP). Returns matched minifigures with IDs, names, confidence scores, and links.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imagePathNoAbsolute path to a local image file (JPEG, PNG, or WebP).
includeRawNoWhen true, includes the raw Brickognize API response alongside formatted results. Useful for debugging.

Implementation Reference

  • The createPredictTool function is the handler that executes the logic for brickognize_identify_fig (and other predict tools), including image resolution, API prediction, and result mapping.
    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),
                },
              ],
            };
          }
        },
      );
    }
  • The registerIdentifyFigTool function registers the brickognize_identify_fig tool with the MCP server using the createPredictTool handler.
    export function registerIdentifyFigTool(server: McpServer): void {
      createPredictTool(
        server,
        "brickognize_identify_fig",
        "Identify LEGO Minifigure",
        "Identify a LEGO minifigure from a photograph. " +
          "Use instead of brickognize_identify when you know the image shows a minifigure.\n\n" +
          "Provide imagePath — absolute path to a local image file (JPEG, PNG, or WebP).\n" +
          "Returns matched minifigures with IDs, names, confidence scores, and links.",
        "/predict/figs/",
      );
    }

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/NazarLysyi/brickognize-mcp'

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