Skip to main content
Glama

register_media

Register media on the Sidearm platform to establish provenance and apply protection against unauthorized use, with options for indexing, watermarking, and adversarial hardening.

Instructions

Register and protect media on the Sidearm platform. Modes: register (provenance signing only), search_ready (register + vector indexing), standard (search_ready + watermarks + AI-training poison), maximum (standard + style cloaking + adversarial hardening). Returns the created media object.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
media_urlNoPublic URL of the media to register
mediaNoBase64-encoded media content to register
modeNoProtection level. Default: standard
expires_atNoISO 8601 datetime when this registration expires
tagsNoTags for organizing and filtering

Implementation Reference

  • The main handler function that executes the register_media tool. It processes the input parameters, constructs a request body, calls the API to register media at /api/v1/media endpoint, and returns the result formatted as MCP content.
    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.mode) body.mode = params.mode;
        if (params.expires_at) body.expires_at = params.expires_at;
        if (params.tags) body.tags = params.tags;
    
        const result = await api.post("/api/v1/media", 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,
        };
      }
    },
  • Zod schema definition for the register_media tool's input parameters, including optional fields for media_url (public URL), media (base64 content), mode (protection level: register/search_ready/standard/maximum), expires_at (ISO 8601 datetime), and tags (array of strings).
      media_url: z
        .string()
        .url()
        .optional()
        .describe("Public URL of the media to register"),
      media: z
        .string()
        .optional()
        .describe("Base64-encoded media content to register"),
      mode: z
        .enum(["register", "search_ready", "standard", "maximum"])
        .optional()
        .describe("Protection level. Default: standard"),
      expires_at: z
        .string()
        .optional()
        .describe("ISO 8601 datetime when this registration expires"),
      tags: z
        .array(z.string())
        .optional()
        .describe("Tags for organizing and filtering"),
    },
  • The register function that defines and registers the register_media tool with the MCP server, including tool name, description, schema, and handler function.
    export function register(server: McpServer, api: ApiClient): void {
      server.tool(
        "register_media",
        "Register and protect media on the Sidearm platform. " +
          "Modes: register (provenance signing only), search_ready (register + vector indexing), " +
          "standard (search_ready + watermarks + AI-training poison), " +
          "maximum (standard + style cloaking + adversarial hardening). Returns the created media object.",
        {
          media_url: z
            .string()
            .url()
            .optional()
            .describe("Public URL of the media to register"),
          media: z
            .string()
            .optional()
            .describe("Base64-encoded media content to register"),
          mode: z
            .enum(["register", "search_ready", "standard", "maximum"])
            .optional()
            .describe("Protection level. Default: standard"),
          expires_at: z
            .string()
            .optional()
            .describe("ISO 8601 datetime when this registration expires"),
          tags: z
            .array(z.string())
            .optional()
            .describe("Tags for organizing and filtering"),
        },
        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.mode) body.mode = params.mode;
            if (params.expires_at) body.expires_at = params.expires_at;
            if (params.tags) body.tags = params.tags;
    
            const result = await api.post("/api/v1/media", 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:15-15 (registration)
    Import statement for the register_media tool registration function from tools/register-media.js
    import { register as registerMedia } from "./tools/register-media.js";
  • src/index.ts:59-59 (registration)
    Call to register the register_media tool with the MCP server and API client
    registerMedia(server, api);
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool creates a media object and outlines behavioral traits like different protection modes (e.g., watermarks, AI-training poison, adversarial hardening). However, it lacks details on permissions, rate limits, error handling, or whether the operation is idempotent, which are important for a mutation tool.

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 a concise breakdown of modes and the return value. Every sentence earns its place by providing essential information without redundancy, making it efficient and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mutation with multiple protection modes), no annotations, and no output schema, the description is moderately complete. It covers the purpose, modes, and return value, but lacks details on error cases, side effects, or how it interacts with sibling tools, leaving gaps for an AI agent to infer behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 value by explaining the semantics of the 'mode' parameter with detailed level definitions (register, search_ready, standard, maximum), which goes beyond the schema's enum list. It also clarifies the return value ('Returns the created media object'), compensating for the lack of output 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 verb 'register and protect' with the resource 'media on the Sidearm platform', and distinguishes this tool from siblings like 'protect_media' by specifying it's for initial registration with protection levels. It provides specific details about different modes, making the purpose explicit and distinct.

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 implies usage by detailing different protection modes (register, search_ready, standard, maximum), which helps guide when to use each level. However, it doesn't explicitly state when to use this tool versus alternatives like 'protect_media' or 'update_media', or mention any prerequisites or exclusions, leaving some ambiguity.

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