Skip to main content
Glama

trash_list_custom_formats

List custom formats from TRaSH Guides for Radarr or Sonarr, with optional category filtering by HDR, audio, resolution, and more.

Instructions

List available TRaSH Guides custom formats. Can filter by category: hdr, audio, resolution, source, streaming, anime, unwanted, release, language

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYesWhich service
categoryNoOptional filter by category

Implementation Reference

  • Tool registration/schema for 'trash_list_custom_formats'. Defines the tool's name, description, and inputSchema (requires service enum 'radarr'/'sonarr', optional category filter).
    {
      name: "trash_list_custom_formats",
      description: "List available TRaSH Guides custom formats. Can filter by category: hdr, audio, resolution, source, streaming, anime, unwanted, release, language",
      inputSchema: {
        type: "object" as const,
        properties: {
          service: {
            type: "string",
            enum: ["radarr", "sonarr"],
            description: "Which service",
          },
          category: {
            type: "string",
            description: "Optional filter by category",
          },
        },
        required: ["service"],
      },
    },
  • Handler for the 'trash_list_custom_formats' tool. Extracts service and optional category from args, calls trashClient.listCustomFormats(service, category), and returns formatted JSON with count, formats (up to 50), available categories.
    case "trash_list_custom_formats": {
      const { service, category } = args as { service: TrashService; category?: string };
      const formats = await trashClient.listCustomFormats(service, category);
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            service,
            category: category || 'all',
            count: formats.length,
            formats: formats.slice(0, 50).map(f => ({
              name: f.name,
              categories: f.categories,
              defaultScore: f.defaultScore,
            })),
            note: formats.length > 50 ? `Showing first 50 of ${formats.length}. Use category filter to narrow results.` : undefined,
            availableCategories: ['hdr', 'audio', 'resolution', 'source', 'streaming', 'anime', 'unwanted', 'release', 'language'],
          }, null, 2),
        }],
      };
    }
  • The 'listCustomFormats' method on TrashClient. Fetches CF names from GitHub (cached), fetches each custom format's details in batches of 20, categorizes them via categorizeCustomFormat(), and optionally filters by category. Returns name, categories, and defaultScore for each format.
    async listCustomFormats(service: TrashService, category?: string): Promise<{ name: string; categories: string[]; defaultScore?: number }[]> {
      // Check cache
      let cfNames = cache.getCFList(service);
      if (!cfNames) {
        cfNames = await listGitHubDir(`${service}/cf`);
        cache.setCFList(service, cfNames);
      }
    
      // Fetch details for categorization
      const formats: { name: string; categories: string[]; defaultScore?: number }[] = [];
    
      // Batch fetch - limit to prevent rate limiting
      const batchSize = 20;
      for (let i = 0; i < cfNames.length; i += batchSize) {
        const batch = cfNames.slice(i, i + batchSize);
        const results = await Promise.all(
          batch.map(async name => {
            const cf = await this.getCustomFormat(service, name);
            if (!cf) return null;
            const cats = categorizeCustomFormat(cf.name);
            return {
              name: cf.name,
              categories: cats,
              defaultScore: cf.trash_scores?.default,
            };
          })
        );
        formats.push(...results.filter((f): f is NonNullable<typeof f> => f !== null));
      }
    
      // Filter by category if specified
      if (category) {
        return formats.filter(f => f.categories.includes(category.toLowerCase()));
      }
    
      return formats;
    }
  • The 'categorizeCustomFormat' helper function. Takes a CF name and returns matching categories (hdr, audio, resolution, source, streaming, anime, unwanted, release, language) based on regex patterns defined in CF_CATEGORIES.
    function categorizeCustomFormat(name: string): string[] {
      const categories: string[] = [];
      for (const [category, patterns] of Object.entries(CF_CATEGORIES)) {
        if (patterns.some(p => p.test(name))) {
          categories.push(category);
        }
      }
      return categories.length > 0 ? categories : ['other'];
    }
  • The CF_CATEGORIES constant defining regex patterns used to categorize custom formats into buckets like hdr, audio, resolution, source, streaming, anime, unwanted, release, language.
    const CF_CATEGORIES: Record<string, RegExp[]> = {
      hdr: [/hdr/i, /dv/i, /dolby.*vision/i, /hdr10/i],
      audio: [/atmos/i, /dts/i, /truehd/i, /audio/i, /surround/i, /sound/i, /stereo/i, /mono/i, /aac/i, /flac/i],
      resolution: [/1080p/i, /2160p/i, /720p/i, /4k/i, /480p/i],
      source: [/bluray/i, /web/i, /remux/i, /hdtv/i, /dvd/i, /cam/i, /telesync/i],
      streaming: [/amzn/i, /nf\b/i, /netflix/i, /dsnp/i, /disney/i, /atvp/i, /apple/i, /hmax/i, /hbo/i, /hulu/i, /pcok/i, /peacock/i],
      anime: [/anime/i],
      unwanted: [/lq/i, /x265.*hdtv/i, /extras/i, /3d/i, /upscale/i, /bad.*dual/i],
      release: [/repack/i, /proper/i, /scene/i, /p2p/i],
      language: [/french/i, /german/i, /dutch/i, /multi/i, /language/i],
    };
Behavior3/5

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

No annotations are provided, so the description carries full burden. It describes a read operation (list) without side effects, but lacks disclosure on authentication requirements, rate limits, pagination, or data freshness. The statement is adequate for a simple list tool but leaves behavioral gaps.

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 exceptionally concise with two sentences. The first sentence clearly states the primary purpose, and the second adds the optional filtering capability. No redundant or extraneous text.

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?

For a simple list tool with only two parameters and no output schema, the description provides sufficient context: what the tool does and how to filter. It does not describe return format, but that may be implied. Given the lack of annotations and output schema, the description is nearly complete.

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 coverage is 100%, and description adds value by listing the possible category filter values (hdr, audio, resolution, etc.) beyond the schema's generic string type. For the service parameter, description repeats schema info but adds clarity. Overall, it enhances parameter understanding.

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 lists available TRaSH Guides custom formats and provides a specific verb (List) and resource (custom formats). This distinguishes it from sibling tools like trash_list_profiles. The optional filtering by category further clarifies its functionality.

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 does not explicitly state when to use this tool versus alternatives like trash_list_profiles or trash_get_naming. It provides context for filtering by category but no exclusion criteria or when-not-to-use guidance. The usage is implied but not fully elaborated.

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/aplaceforallmystuff/mcp-arr'

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