Skip to main content
Glama

detect_fingerprint

Check media for prior registration using fingerprint matching against your indexed library at varying detection depths to identify copyright infringement.

Instructions

Detect whether media has been previously registered or seen, using fingerprint matching. Compares against your indexed library at varying depth. Tiers: exact (hash match), quick (perceptual hash), perceptual (visual similarity), compositional (scene structure), full (all tiers). Returns results immediately.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
media_urlNoPublic URL of the media to check
mediaNoBase64-encoded media content to check
tagsNoTags to scope the detection to
tierNoDetection depth — controls thoroughness vs speed. Default: quick

Implementation Reference

  • The main handler function that executes the detect_fingerprint tool. It accepts media_url, media (base64), tags, and tier parameters, constructs a request body, calls the API via api.post('/api/v1/detect', body), and returns the JSON response with error handling.
    async (params) => {
      try {
        const body: Record<string, unknown> = {};
        if (params.media_url) body.media_url = params.media_url;
        if (params.media) body.media = params.media;
        if (params.tags) body.tags = params.tags;
        if (params.tier) body.tier = params.tier;
    
        const result = await api.post("/api/v1/detect", body);
        return {
          content: [
            { type: "text" as const, text: JSON.stringify(result, null, 2) },
          ],
        };
      } catch (err) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Error: ${err instanceof Error ? err.message : String(err)}`,
            },
          ],
          isError: true as const,
        };
      }
    },
  • Input schema definition for the detect_fingerprint tool using Zod validation. Defines optional parameters: media_url (URL string), media (base64 string), tags (string array), and tier (enum with values: exact, quick, perceptual, compositional, full).
      media_url: z
        .string()
        .url()
        .optional()
        .describe("Public URL of the media to check"),
      media: z
        .string()
        .optional()
        .describe("Base64-encoded media content to check"),
      tags: z
        .array(z.string())
        .optional()
        .describe("Tags to scope the detection to"),
      tier: z
        .enum(["exact", "quick", "perceptual", "compositional", "full"])
        .optional()
        .describe("Detection depth — controls thoroughness vs speed. Default: quick"),
    },
  • Complete registration function that registers the detect_fingerprint tool with the MCP server. Includes the tool name, description, schema, and handler function.
    export function register(server: McpServer, api: ApiClient): void {
      server.tool(
        "detect_fingerprint",
        "Detect whether media has been previously registered or seen, using fingerprint matching. " +
          "Compares against your indexed library at varying depth. " +
          "Tiers: exact (hash match), quick (perceptual hash), perceptual (visual similarity), " +
          "compositional (scene structure), full (all tiers). Returns results immediately.",
        {
          media_url: z
            .string()
            .url()
            .optional()
            .describe("Public URL of the media to check"),
          media: z
            .string()
            .optional()
            .describe("Base64-encoded media content to check"),
          tags: z
            .array(z.string())
            .optional()
            .describe("Tags to scope the detection to"),
          tier: z
            .enum(["exact", "quick", "perceptual", "compositional", "full"])
            .optional()
            .describe("Detection depth — controls thoroughness vs speed. Default: quick"),
        },
        async (params) => {
          try {
            const body: Record<string, unknown> = {};
            if (params.media_url) body.media_url = params.media_url;
            if (params.media) body.media = params.media;
            if (params.tags) body.tags = params.tags;
            if (params.tier) body.tier = params.tier;
    
            const result = await api.post("/api/v1/detect", body);
            return {
              content: [
                { type: "text" as const, text: JSON.stringify(result, null, 2) },
              ],
            };
          } catch (err) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `Error: ${err instanceof Error ? err.message : String(err)}`,
                },
              ],
              isError: true as const,
            };
          }
        },
      );
    }
  • src/index.ts:13-13 (registration)
    Import statement for the detect_fingerprint tool's register function from the tools module.
    import { register as detectFingerprint } from "./tools/detect-fingerprint.js";
  • src/index.ts:55-55 (registration)
    Registration call that invokes detectFingerprint(server, api) to register the tool with the MCP server instance.
    detectFingerprint(server, api);

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/sidearmDRM/mcp-server'

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