sonarr_get_tags
Retrieve all tags from Sonarr to organize and filter TV content within the *arr media management system.
Instructions
Get all tags defined in Sonarr (TV). Tags can be used to organize and filter content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:930-947 (handler)Handler logic for the sonarr_get_tags tool (and similar for other services). Extracts service name from tool name, retrieves the corresponding client, calls getTags(), and returns formatted JSON with tag count and list of id/label.
case "sonarr_get_tags": case "radarr_get_tags": case "lidarr_get_tags": case "readarr_get_tags": { const serviceName = name.split('_')[0] as keyof typeof clients; const client = clients[serviceName]; if (!client) throw new Error(`${serviceName} not configured`); const tags = await client.getTags(); return { content: [{ type: "text", text: JSON.stringify({ count: tags.length, tags: tags.map(t => ({ id: t.id, label: t.label })), }, null, 2), }], }; } - src/index.ts:154-161 (registration)Dynamic registration of the sonarr_get_tags tool schema in the addConfigTools function, which is called if Sonarr is configured. Defines name, description, and empty input schema.
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: [], }, }, - src/arr-client.ts:571-573 (helper)Helper method in ArrClient base class (inherited by SonarrClient) that fetches tags via API GET /tag endpoint.
async getTags(): Promise<Tag[]> { return this.request<Tag[]>('/tag'); } - src/arr-client.ts:402-404 (helper)Type definition for Tag interface used by getTags() method.
id: number; label: string; } - src/index.ts:174-175 (registration)Conditional call to addConfigTools for Sonarr, which registers sonarr_get_tags if Sonarr client is configured.
// Add config tools for each configured service (except Prowlarr which has different config) if (clients.sonarr) addConfigTools('sonarr', 'Sonarr (TV)');