Skip to main content
Glama

list_algorithms

Discover available algorithms for media protection, watermarking, and AI content disruption. Filter by category or media type to identify valid algorithm IDs before execution.

Instructions

List available algorithms for media protection, watermarking, and AI content disruption. Returns algorithm IDs, names, supported media types, and descriptions. Use this to discover valid algorithm IDs before calling run_algorithm. Filter by category (open = research algorithms, proprietary = Sidearm bundles) or media_type (image, video, audio, text, pdf, gif).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by algorithm category
media_typeNoFilter by supported media type

Implementation Reference

  • The handler function that executes the list_algorithms tool logic. It calls the API endpoint '/api/v1/algorithms' with optional category and media_type filters, then returns the JSON result or handles errors gracefully.
    async ({ category, media_type }) => {
      try {
        const result = await api.get("/api/v1/algorithms", {
          category,
          media_type,
        });
        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,
        };
      }
    },
  • The input schema definition for list_algorithms using Zod. Defines two optional parameters: 'category' (enum: 'open' or 'proprietary') and 'media_type' (enum: 'image', 'video', 'audio', 'text', 'pdf', 'gif').
    {
      category: z
        .enum(["open", "proprietary"])
        .optional()
        .describe("Filter by algorithm category"),
      media_type: z
        .enum(["image", "video", "audio", "text", "pdf", "gif"])
        .optional()
        .describe("Filter by supported media type"),
    },
  • The registration function that registers the list_algorithms tool with the MCP server. Includes the tool name, description, schema, and handler function.
    export function register(server: McpServer, api: ApiClient): void {
      server.tool(
        "list_algorithms",
        "List available algorithms for media protection, watermarking, and AI content disruption. " +
          "Returns algorithm IDs, names, supported media types, and descriptions. " +
          "Use this to discover valid algorithm IDs before calling run_algorithm. " +
          "Filter by category (open = research algorithms, proprietary = Sidearm bundles) " +
          "or media_type (image, video, audio, text, pdf, gif).",
        {
          category: z
            .enum(["open", "proprietary"])
            .optional()
            .describe("Filter by algorithm category"),
          media_type: z
            .enum(["image", "video", "audio", "text", "pdf", "gif"])
            .optional()
            .describe("Filter by supported media type"),
        },
        async ({ category, media_type }) => {
          try {
            const result = await api.get("/api/v1/algorithms", {
              category,
              media_type,
            });
            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:6-6 (registration)
    Import of the list_algorithms register function from the tools module.
    import { register as listAlgorithms } from "./tools/list-algorithms.js";
  • src/index.ts:40-40 (registration)
    Invocation of listAlgorithms to register the tool with the MCP server instance.
    listAlgorithms(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