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);
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it compares against an indexed library, operates at varying depth tiers, and returns results immediately. It doesn't mention rate limits, authentication needs, or error conditions, but covers the core operational behavior adequately.

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 front-loaded with the core purpose, followed by operational details and tier explanations. Every sentence earns its place by adding necessary context without redundancy. It's appropriately sized for a tool with 4 parameters and no annotations.

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 (4 parameters, no output schema, no annotations), the description is mostly complete. It explains what the tool does, how it works, and the tier system. However, it doesn't describe the return format or error handling, which would be helpful for an agent invoking it.

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 baseline is 3. The description adds some value by explaining the tier parameter's purpose ('controls thoroughness vs speed') and listing the tier options, but doesn't provide additional semantics beyond what the schema already documents for parameters like media_url or tags.

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 tool's purpose with specific verbs ('detect', 'compare') and resources ('media', 'fingerprint matching', 'indexed library'). It distinguishes from siblings like 'check_job' or 'search_media' by focusing on fingerprint-based detection rather than status checking or general searching.

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

Usage Guidelines3/5

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

The description implies usage context through the tier system (e.g., 'exact' for hash matches, 'quick' for speed), but doesn't explicitly state when to use this tool versus alternatives like 'detect_ai' or 'search_media'. No guidance on prerequisites or exclusions is provided.

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

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