Skip to main content
Glama
NazarLysyi

Brickognize MCP Server

by NazarLysyi

brickognize_health

Check if the Brickognize image recognition API is online and responsive before attempting LEGO identification tasks.

Instructions

Check whether the Brickognize image recognition API is online and responsive. Call this before recognition if you suspect the service might be down. Takes no parameters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual implementation of the Brickognize health check API call.
    export async function checkHealth(): Promise<HealthResponse> {
      const res = await fetch(`${BASE_URL}/health/`, {
        signal: AbortSignal.timeout(10_000),
      });
    
      if (!res.ok) {
        throw apiError(res.status, await res.text());
      }
    
      const data = await res.json();
    
      if (typeof data !== "object" || data === null) {
        throw unexpectedResponse("health endpoint did not return an object");
      }
    
      return data as HealthResponse;
    }
  • Registration of the 'brickognize_health' tool.
    export function registerHealthTool(server: McpServer): void {
      server.registerTool(
        "brickognize_health",
        {
          title: "Brickognize Health Check",
          description:
            "Check whether the Brickognize image recognition API is online and responsive. " +
            "Call this before recognition if you suspect the service might be down. Takes no parameters.",
          annotations: TOOL_ANNOTATIONS,
        },
        async () => {
          try {
            const health = await checkHealth();
            return {
              content: [{ type: "text" as const, text: JSON.stringify(health, null, 2) }],
            };
          } catch (error) {
            return {
              isError: true,
              content: [{ type: "text" as const, text: formatToolError(error) }],
            };
          }
        },
      );
    }

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