trash_get_quality_sizes
Retrieve TRaSH Guides recommended file size ranges for media quality levels in Radarr or Sonarr to optimize storage and quality settings.
Instructions
Get TRaSH Guides recommended min/max/preferred sizes for each quality level
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service | Yes | Which service | |
| type | No | Content type: 'movie', 'anime' for Radarr; 'series', 'anime' for Sonarr |
Implementation Reference
- src/trash-client.ts:356-384 (handler)Core handler function in TrashClient that fetches, caches, and returns TRaSH quality size recommendations for movies/series/anime from GitHub JSON files.async getQualitySizes(service: TrashService, type?: string): Promise<TrashQualitySize[]> { const sizeTypes = service === 'radarr' ? ['movie', 'anime'] : ['series', 'anime']; const sizes: TrashQualitySize[] = []; for (const sizeType of sizeTypes) { const key = `${service}/${sizeType}`; let size = cache.getQualitySize(key); if (!size) { try { size = await fetchJSON<TrashQualitySize>( `${TRASH_BASE_URL}/${service}/quality-size/${sizeType}.json` ); cache.setQualitySize(key, size); } catch { continue; } } if (!type || size.type === type) { sizes.push(size); } } return sizes; }
- src/index.ts:1815-1836 (handler)MCP server request handler for the tool call, which extracts parameters, invokes trashClient.getQualitySizes, formats the output, and returns the response.case "trash_get_quality_sizes": { const { service, type } = args as { service: TrashService; type?: string }; const sizes = await trashClient.getQualitySizes(service, type); return { content: [{ type: "text", text: JSON.stringify({ service, type: type || 'all', profiles: sizes.map(s => ({ type: s.type, qualities: s.qualities.map(q => ({ quality: q.quality, min: q.min + ' MB/min', preferred: q.preferred === 1999 ? 'unlimited' : q.preferred + ' MB/min', max: q.max === 2000 ? 'unlimited' : q.max + ' MB/min', })), })), }, null, 2), }], }; }
- src/index.ts:673-689 (registration)Registration of the tool in the MCP TOOLS array, defining the name, description, and input schema.name: "trash_get_quality_sizes", description: "Get TRaSH Guides recommended min/max/preferred sizes for each quality level", inputSchema: { type: "object" as const, properties: { service: { type: "string", enum: ["radarr", "sonarr"], description: "Which service", }, type: { type: "string", description: "Content type: 'movie', 'anime' for Radarr; 'series', 'anime' for Sonarr", }, }, required: ["service"], },
- src/trash-client.ts:50-59 (schema)TypeScript interface defining the structure of quality size data returned by the tool.export interface TrashQualitySize { trash_id: string; type: string; qualities: Array<{ quality: string; min: number; preferred: number; max: number; }>; }