sonarr_get_naming
Retrieve Sonarr's file and folder naming patterns for TV shows to verify naming configuration.
Instructions
Get file naming configuration from Sonarr (TV). Shows naming patterns for files and folders.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:170-178 (registration)The tool 'sonarr_get_naming' is registered via a dynamic template using addConfigTools('sonarr', ...). The name is constructed as `${serviceName}_get_naming` which produces 'sonarr_get_naming'. The input schema requires no parameters.
{ name: `${serviceName}_get_naming`, description: `Get file naming configuration from ${displayName}. Shows naming patterns for files and folders.`, inputSchema: { type: "object" as const, properties: {}, required: [], }, }, - src/index.ts:1300-1313 (handler)The handler for sonarr_get_naming (and radarr_get_naming, lidarr_get_naming) in the CallToolRequestSchema switch statement. It extracts the service name from the tool name, gets the client, calls client.getNamingConfig(), and returns the naming configuration as JSON.
case "sonarr_get_naming": case "radarr_get_naming": case "lidarr_get_naming": { const serviceName = name.split('_')[0] as keyof typeof clients; const client = clients[serviceName]; if (!client) throw new Error(`${serviceName} not configured`); const naming = await client.getNamingConfig(); return { content: [{ type: "text", text: JSON.stringify(naming, null, 2), }], }; } - src/arr-client.ts:286-306 (schema)The NamingConfig interface defines the response schema for the naming configuration, including fields like renameEpisodes, standardEpisodeFormat, seriesFolderFormat, etc. for Sonarr.
export interface NamingConfig { renameEpisodes?: boolean; replaceIllegalCharacters: boolean; colonReplacementFormat?: string; standardEpisodeFormat?: string; dailyEpisodeFormat?: string; animeEpisodeFormat?: string; seriesFolderFormat?: string; seasonFolderFormat?: string; specialsFolderFormat?: string; multiEpisodeStyle?: number; // Radarr renameMovies?: boolean; movieFolderFormat?: string; standardMovieFormat?: string; // Lidarr renameTracks?: boolean; artistFolderFormat?: string; albumFolderFormat?: string; trackFormat?: string; } - src/arr-client.ts:492-495 (helper)The getNamingConfig() method in the base ArrClient class makes an API call to '/config/naming' and returns a NamingConfig object. This is the helper that actually fetches the naming config from the Sonarr API.
*/ async getNamingConfig(): Promise<NamingConfig> { return this.request<NamingConfig>('/config/naming'); } - src/index.ts:132-198 (registration)The addConfigTools function that dynamically registers config tools including sonarr_get_naming for each configured service (sonarr, radarr, lidarr). Line 201 calls addConfigTools('sonarr', ...) to register the Sonarr-specific tools.
function addConfigTools(serviceName: string, displayName: string) { TOOLS.push( { name: `${serviceName}_get_quality_profiles`, description: `Get detailed quality profiles from ${displayName}. Shows allowed qualities, upgrade settings, and custom format scores.`, inputSchema: { type: "object" as const, properties: {}, required: [], }, }, { name: `${serviceName}_get_health`, description: `Get health check warnings and issues from ${displayName}. Shows any problems detected by the application.`, inputSchema: { type: "object" as const, properties: {}, required: [], }, }, { name: `${serviceName}_get_root_folders`, description: `Get root folders and storage info from ${displayName}. Shows paths, free space, and unmapped folders.`, inputSchema: { type: "object" as const, properties: {}, required: [], }, }, { name: `${serviceName}_get_download_clients`, description: `Get download client configurations from ${displayName}. Shows configured clients and their settings.`, inputSchema: { type: "object" as const, properties: {}, required: [], }, }, { name: `${serviceName}_get_naming`, description: `Get file naming configuration from ${displayName}. Shows naming patterns for files and folders.`, inputSchema: { type: "object" as const, properties: {}, required: [], }, }, { name: `${serviceName}_get_tags`, description: `Get all tags defined in ${displayName}. Tags can be used to organize and filter content.`, inputSchema: { type: "object" as const, properties: {}, required: [], }, }, { name: `${serviceName}_review_setup`, description: `Get comprehensive configuration review for ${displayName}. Returns all settings for analysis: quality profiles, download clients, naming, storage, indexers, health warnings, and more. Use this to analyze the setup and suggest improvements.`, inputSchema: { type: "object" as const, properties: {}, required: [], }, } ); }