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
| Name | Required | Description | Default |
|---|---|---|---|
| content_ids | Yes | UUIDs of your registered media to test against the suspect model | |
| suspect_model | Yes | Identifier or name of the AI model suspected of training on your content | |
| method | No | Inference method. Default: combined | |
| tags | No | Tags for organizing and filtering |
Implementation Reference
- src/tools/detect-membership.ts:5-65 (handler)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, }; } }, ); } - src/tools/detect-membership.ts:12-28 (schema)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"), }, - src/tools/detect-membership.ts:29-63 (handler)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);