Skip to main content
Glama

trash_get_profile

Retrieve a specific TRaSH Guides quality profile with custom format scores, quality settings, and implementation details for Radarr or Sonarr media management.

Instructions

Get a specific TRaSH Guides quality profile with all custom format scores, quality settings, and implementation details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYesWhich service
profileYesProfile name (e.g., 'remux-web-1080p', 'uhd-bluray-web', 'hd-bluray-web')

Implementation Reference

  • src/index.ts:615-631 (registration)
    Tool registration for trash_get_profile including name, description, and input schema.
    name: "trash_get_profile",
    description: "Get a specific TRaSH Guides quality profile with all custom format scores, quality settings, and implementation details",
    inputSchema: {
      type: "object" as const,
      properties: {
        service: {
          type: "string",
          enum: ["radarr", "sonarr"],
          description: "Which service",
        },
        profile: {
          type: "string",
          description: "Profile name (e.g., 'remux-web-1080p', 'uhd-bluray-web', 'hd-bluray-web')",
        },
      },
      required: ["service", "profile"],
    },
  • Main handler for trash_get_profile: extracts arguments, calls trashClient.getProfile, handles errors, formats and returns profile data as JSON.
    case "trash_get_profile": {
      const { service, profile: profileName } = args as { service: TrashService; profile: string };
      const profile = await trashClient.getProfile(service, profileName);
      if (!profile) {
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              error: `Profile '${profileName}' not found for ${service}`,
              hint: "Use trash_list_profiles to see available profiles",
            }, null, 2),
          }],
          isError: true,
        };
      }
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            name: profile.name,
            description: profile.trash_description?.replace(/<br>/g, '\n'),
            trash_id: profile.trash_id,
            upgradeAllowed: profile.upgradeAllowed,
            cutoff: profile.cutoff,
            minFormatScore: profile.minFormatScore,
            cutoffFormatScore: profile.cutoffFormatScore,
            language: profile.language,
            qualities: profile.items.map(i => ({
              name: i.name,
              allowed: i.allowed,
              items: i.items,
            })),
            customFormats: Object.entries(profile.formatItems || {}).map(([name, trashId]) => ({
              name,
              trash_id: trashId,
            })),
          }, null, 2),
        }],
      };
    }
  • Core helper function getProfile in TrashClient: checks cache, fetches JSON from TRaSH GitHub repo if needed, caches result.
    async getProfile(service: TrashService, profileName: string): Promise<TrashQualityProfile | null> {
      const key = `${service}/${profileName}`;
      const cached = cache.getProfile(key);
      if (cached) return cached;
    
      try {
        const profile = await fetchJSON<TrashQualityProfile>(
          `${TRASH_BASE_URL}/${service}/quality-profiles/${profileName}.json`
        );
        cache.setProfile(key, profile);
        return profile;
      } catch {
        return null;
      }
    }
  • Import of trashClient singleton and TrashService type used by the tool.
    import { trashClient, TrashService } from "./trash-client.js";
  • TrashQualityProfile interface defining the structure of profile data returned by the tool.
    export interface TrashQualityProfile {
      trash_id: string;
      name: string;
      trash_description?: string;
      group?: number;
      upgradeAllowed: boolean;
      cutoff: string;
      minFormatScore: number;
      cutoffFormatScore: number;
      minUpgradeFormatScore: number;
      language: string;
      items: Array<{
        name: string;
        allowed: boolean;
        items?: string[];
      }>;
      formatItems: Record<string, string>;
    }

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