Skip to main content
Glama

sonarr_search

Search for TV series to add to your Sonarr media library by entering a show name. This tool helps you find and manage television content within the *arr media management system.

Instructions

Search for TV series to add to Sonarr

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termYesSearch term (show name)

Implementation Reference

  • Core handler implementation in SonarrClient.searchSeries: makes API call to Sonarr's /series/lookup endpoint with the search term.
    /**
     * Search for series
     */
    async searchSeries(term: string): Promise<SearchResult[]> {
      return this['request']<SearchResult[]>(`/series/lookup?term=${encodeURIComponent(term)}`);
    }
  • MCP server tool handler for 'sonarr_search': validates Sonarr client, calls searchSeries(term), limits to top 10 results, returns formatted JSON.
    case "sonarr_search": {
      if (!clients.sonarr) throw new Error("Sonarr not configured");
      const term = (args as { term: string }).term;
      const results = await clients.sonarr.searchSeries(term);
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            count: results.length,
            results: results.slice(0, 10).map(r => ({
              title: r.title,
              year: r.year,
              tvdbId: r.tvdbId,
              overview: r.overview?.substring(0, 200) + (r.overview && r.overview.length > 200 ? '...' : ''),
            })),
          }, null, 2),
        }],
      };
    }
  • src/index.ts:193-205 (registration)
    Tool registration in TOOLS array (conditional on Sonarr client configured) with name, description, and input schema requiring 'term' string.
      name: "sonarr_search",
      description: "Search for TV series to add to Sonarr",
      inputSchema: {
        type: "object" as const,
        properties: {
          term: {
            type: "string",
            description: "Search term (show name)",
          },
        },
        required: ["term"],
      },
    },
  • Input schema definition for sonarr_search tool: object with required 'term' string property.
      inputSchema: {
        type: "object" as const,
        properties: {
          term: {
            type: "string",
            description: "Search term (show name)",
          },
        },
        required: ["term"],
      },
    },
  • Base ArrClient.request method used by searchSeries to perform authenticated API requests to the *arr service.
    protected async request<T>(endpoint: string, options: RequestInit = {}): Promise<T> {
      const url = `${this.config.url}/api/${this.apiVersion}${endpoint}`;
      const headers: Record<string, string> = {
        'Content-Type': 'application/json',
        'X-Api-Key': this.config.apiKey,
        ...(options.headers as Record<string, string> || {}),
      };
    
      const response = await fetch(url, {
        ...options,
        headers,
      });
    
      if (!response.ok) {
        const text = await response.text();
        throw new Error(`${this.serviceName} API error: ${response.status} ${response.statusText} - ${text}`);
      }
    
      return response.json() as Promise<T>;
    }
    
    /**
     * Get system status
     */
    async getStatus(): Promise<SystemStatus> {
      return this.request<SystemStatus>('/system/status');
    }
Behavior2/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 states the tool searches for TV series 'to add to Sonarr', implying a read-only search operation, but doesn't disclose behavioral traits like whether it requires authentication, rate limits, what the search returns (e.g., list of shows with details), or how results are formatted. This is inadequate for a tool with no annotation coverage.

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 a single, efficient sentence: 'Search for TV series to add to Sonarr'. It's appropriately sized, front-loaded with the core purpose, and contains no wasted words. Every part of the sentence contributes meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what the search returns (e.g., list of TV shows with IDs, titles, years), how results are structured, or any behavioral context like authentication needs. For a search tool in a complex media server environment, this leaves significant gaps for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'term' parameter documented as 'Search term (show name)'. The description adds no additional parameter semantics beyond what the schema provides. With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search for TV series to add to Sonarr'. It specifies the action (search), resource (TV series), and context (Sonarr). However, it doesn't explicitly differentiate from sibling tools like 'sonarr_search_episode' or 'sonarr_search_missing', which are also search tools in the same domain.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal usage guidance. It implies this tool is for searching TV series, but doesn't specify when to use it versus alternatives like 'sonarr_search_episode' or 'sonarr_search_missing'. No explicit when/when-not instructions or prerequisites are mentioned.

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