Skip to main content
Glama
NazarLysyi

Brickognize MCP Server

by NazarLysyi

Identify LEGO Item

brickognize_identify
Read-onlyIdempotent

Identify LEGO items from photos to get part, set, or minifigure details with confidence scores and marketplace links.

Instructions

Identify any LEGO item (part, set, minifigure, or sticker) from a photograph. Use this when the item type is unknown or the image may contain multiple types.

Provide imagePath — absolute path to a local image file (JPEG, PNG, or WebP). Returns top matches with confidence scores, IDs, names, categories, and links to BrickLink/BrickOwl.

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 `brickognize_identify` tool is registered using `registerIdentifyTool`, which wraps the `createPredictTool` utility with the `/predict/` endpoint.
    export function registerIdentifyTool(server: McpServer): void {
      createPredictTool(
        server,
        "brickognize_identify",
        "Identify LEGO Item",
        "Identify any LEGO item (part, set, minifigure, or sticker) from a photograph. " +
          "Use this when the item type is unknown or the image may contain multiple types.\n\n" +
          "Provide imagePath — absolute path to a local image file (JPEG, PNG, or WebP).\n" +
          "Returns top matches with confidence scores, IDs, names, categories, and links to BrickLink/BrickOwl.",
        "/predict/",
      );
    }
  • The handler for the tool (within `createPredictTool`) processes the input image, calls the Brickognize API using the `predict` function, and maps the result.
    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 actual network request to the Brickognize API is performed by this function.
    export async function predict(
      endpoint: string,
      imageBlob: Blob,
      filename: string,
    ): Promise<RawSearchResults> {
      const form = new FormData();
      form.append("query_image", imageBlob, filename);
    
      const res = await fetch(`${BASE_URL}${endpoint}`, {
        method: "POST",
        body: form,
        signal: AbortSignal.timeout(60_000),
      });
    
      if (!res.ok) {
        const body = await res.text();
        throw apiError(res.status, body);
      }
    
      const data = await res.json();
    
      if (!data || typeof data.listing_id !== "string" || !Array.isArray(data.items)) {
        throw unexpectedResponse("missing listing_id or items array");
      }
    
      return data as RawSearchResults;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already provide strong behavioral hints (readOnly, openWorld, idempotent, non-destructive). The description adds valuable context beyond this: it specifies the return format ('top matches with confidence scores, IDs, names, categories, and links to BrickLink/BrickOwl') and mentions the tool's capability to handle multiple item types, which is not covered by annotations. No contradiction with annotations exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise and well-structured. The first sentence states the core purpose, the second provides usage guidelines, and the third outlines parameters and return values. Every sentence adds essential information with zero waste, making it easy for an AI agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (image-based identification with multiple item types), rich annotations (covering safety and behavior), and no output schema, the description is largely complete. It explains the purpose, usage context, input requirements, and return format. However, it lacks details on error handling or limitations (e.g., image quality requirements), leaving minor gaps for an agent to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both parameters (imagePath and includeRaw). The description mentions imagePath with format details (JPEG, PNG, or WebP) but adds no new semantic information beyond what's in the schema. For includeRaw, it explains its purpose ('useful for debugging'), which slightly enhances understanding but is largely redundant with the schema's description. Baseline 3 is appropriate given high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'identify' and the resource 'LEGO item (part, set, minifigure, or sticker)' from a photograph. It explicitly distinguishes this tool from its siblings by stating 'when the item type is unknown or the image may contain multiple types,' contrasting with the specialized sibling tools for specific item types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'when the item type is unknown or the image may contain multiple types.' This clearly differentiates it from the sibling tools (brickognize_identify_fig, brickognize_identify_part, brickognize_identify_set) that are for specific known item types, offering clear alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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