Skip to main content
Glama

detect_membership

Determine if your protected content was used to train a suspect AI model by running membership inference with watermark detection and statistical analysis methods.

Instructions

Run membership inference to determine whether your protected content was used to train a suspect AI model. Provide content IDs (from your registered media) and the model to test. Methods: pattern (watermark detection), statistical (distribution analysis), combined (both). Returns a job_id — use check_job to poll for results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
content_idsYesUUIDs of your registered media to test against the suspect model
suspect_modelYesIdentifier or name of the AI model suspected of training on your content
methodNoInference method. Default: combined
tagsNoTags for organizing and filtering

Implementation Reference

  • Main implementation of the detect_membership tool. Contains the server.tool registration and the async handler function that executes the membership inference logic by calling the API endpoint /api/v1/detect/membership with the provided parameters.
    export function register(server: McpServer, api: ApiClient): void {
      server.tool(
        "detect_membership",
        "Run membership inference to determine whether your protected content was used to train " +
          "a suspect AI model. Provide content IDs (from your registered media) and the model to test. " +
          "Methods: pattern (watermark detection), statistical (distribution analysis), " +
          "combined (both). Returns a job_id — use check_job to poll for results.",
        {
          content_ids: z
            .array(z.string())
            .min(1)
            .describe("UUIDs of your registered media to test against the suspect model"),
          suspect_model: z
            .string()
            .describe("Identifier or name of the AI model suspected of training on your content"),
          method: z
            .enum(["pattern", "statistical", "combined"])
            .optional()
            .describe("Inference method. Default: combined"),
          tags: z
            .array(z.string())
            .optional()
            .describe("Tags for organizing and filtering"),
        },
        async (params) => {
          try {
            const body: Record<string, unknown> = {
              content_ids: params.content_ids,
              suspect_model: params.suspect_model,
            };
            if (params.method) body.method = params.method;
            if (params.tags) body.tags = params.tags;
    
            const result = await api.post("/api/v1/detect/membership", body);
            const res = result as { job_id: string };
    
            return {
              content: [
                {
                  type: "text" as const,
                  text:
                    `Membership inference job created.\n\n` +
                    `Job ID: ${res.job_id}\n\n` +
                    `Use check_job with this job_id to poll for results.`,
                },
              ],
            };
          } catch (err) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `Error: ${err instanceof Error ? err.message : String(err)}`,
                },
              ],
              isError: true as const,
            };
          }
        },
      );
    }
  • Zod schema definition for the detect_membership tool input parameters, including content_ids (array of UUIDs), suspect_model (string identifier), method (enum: pattern, statistical, combined, optional), and tags (array of strings, optional).
    {
      content_ids: z
        .array(z.string())
        .min(1)
        .describe("UUIDs of your registered media to test against the suspect model"),
      suspect_model: z
        .string()
        .describe("Identifier or name of the AI model suspected of training on your content"),
      method: z
        .enum(["pattern", "statistical", "combined"])
        .optional()
        .describe("Inference method. Default: combined"),
      tags: z
        .array(z.string())
        .optional()
        .describe("Tags for organizing and filtering"),
    },
  • Async handler function that processes the detect_membership request. Validates parameters, constructs the request body, calls the API client's post method to /api/v1/detect/membership, and returns formatted results with the job_id or error message.
    async (params) => {
      try {
        const body: Record<string, unknown> = {
          content_ids: params.content_ids,
          suspect_model: params.suspect_model,
        };
        if (params.method) body.method = params.method;
        if (params.tags) body.tags = params.tags;
    
        const result = await api.post("/api/v1/detect/membership", body);
        const res = result as { job_id: string };
    
        return {
          content: [
            {
              type: "text" as const,
              text:
                `Membership inference job created.\n\n` +
                `Job ID: ${res.job_id}\n\n` +
                `Use check_job with this job_id to poll for results.`,
            },
          ],
        };
      } catch (err) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Error: ${err instanceof Error ? err.message : String(err)}`,
            },
          ],
          isError: true as const,
        };
      }
    },
  • src/index.ts:14-14 (registration)
    Import statement for the detect_membership register function from the tools module.
    import { register as detectMembership } from "./tools/detect-membership.js";
  • src/index.ts:56-56 (registration)
    Registration call that registers the detect_membership tool with the MCP server instance.
    detectMembership(server, api);
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses key behavioral traits: it's an inference operation (not destructive), returns a job_id for asynchronous processing, and mentions three methods (pattern, statistical, combined). However, it lacks details on rate limits, authentication needs, or error handling.

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 appropriately sized and front-loaded, with every sentence earning its place: first sentence states purpose, second specifies inputs and methods, third explains the return value and follow-up action. No wasted words.

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 complexity (asynchronous inference with multiple methods) and no output schema, the description is mostly complete—it explains the purpose, inputs, methods, and that results require polling via check_job. However, it could better address error cases or output format details.

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 already documents all parameters well. The description adds minimal value by briefly mentioning the methods (pattern, statistical, combined) and that content_ids are from registered media, but does not provide additional syntax or format details beyond the schema.

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 ('run membership inference', 'determine') and resources ('protected content', 'suspect AI model'), distinguishing it from siblings like detect_ai or detect_fingerprint by focusing on training data detection rather than general AI detection or fingerprinting.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (to test if registered media was used in training a suspect model) and mentions an alternative tool (check_job for polling results), but does not explicitly state when not to use it or compare it to other siblings like detect_ai.

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