Skip to main content
Glama

sonarr_search

Search TheTVDB for TV series by title to add them to Sonarr for automated downloads.

Instructions

Search TheTVDB for new series to add to Sonarr

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (series title)
limitNoMax results to return (default: 200)

Implementation Reference

  • The sonarrSearch method on ArrMCPFunctions class — the actual handler that executes the sonarr_search tool logic. It takes query and optional limit, calls client.searchSeries, and returns mapped results with truncation.
    async sonarrSearch(args: {
      query: string;
      limit?: number;
    }): Promise<Record<string, unknown>> {
      const client = this.ensureSonarr();
      const limit = args.limit || ARR_PREVIEW_LIMIT;
      try {
        const results = await client.searchSeries(args.query);
        return {
          success: true,
          query: args.query,
          totalResults: results.length,
          results: results.slice(0, limit).map((r) => ({
            tvdbId: r.tvdbId,
            title: r.title,
            year: r.year,
            status: r.status,
            network: r.network,
            runtime: r.runtime,
            genres: r.genres,
            certification: r.certification,
            seasonCount: r.seasons?.length || 0,
            overview: r.overview ? truncate(r.overview, SUMMARY_PREVIEW_LENGTH) : undefined,
          })),
          showing: Math.min(limit, results.length),
        };
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : String(error),
        };
      }
    }
  • Input schema definition for sonarr_search tool, specifying required 'query' (string) and optional 'limit' (number) parameters with descriptions.
    {
      name: "sonarr_search",
      description: "Search TheTVDB for new series to add to Sonarr",
      inputSchema: {
        type: "object" as const,
        properties: {
          query: { type: "string", description: "Search query (series title)" },
          limit: { type: "number", description: "Max results to return (default: 200)", default: 200 },
        },
        required: ["query"],
      },
    },
  • Registration of sonarr_search tool in ToolRegistry, wiring the schema name to the arrFunctions.sonarrSearch handler.
    registry.register("sonarr_search", (args) =>
      arrFunctions.sonarrSearch({ query: args.query as string, limit: args.limit as number | undefined }).then(wrapResponse)
    );
  • The SonarrClient.searchSeries method that performs the actual HTTP GET to /series/lookup?term=... on the Sonarr API.
    async searchSeries(query: string): Promise<SonarrSearchResult[]> {
      const { data } = await this.http.get("/series/lookup", {
        params: { term: query },
      });
      return ensureArray(data);
    }
  • TypeScript interface SonarrSearchResult defining the shape of data returned from the Sonarr series lookup API.
    export interface SonarrSearchResult {
      tvdbId: number;
      title: string;
      overview: string;
      status: string;
      images: Array<{ coverType: string; remoteUrl: string }>;
      seasons: Array<{ seasonNumber: number; monitored: boolean }>;
      year: number;
      network: string;
      runtime: number;
      genres: string[];
      ratings: { votes: number; value: number };
      certification: string;
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must convey behavioral traits. It indicates an external search (TheTVDB) but does not confirm read-only semantics, mention side effects, or discuss prerequisites like authentication or rate limits. The description is neutral and not contradictory.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence with no wasted words. It could be slightly more informative (e.g., specifying the return type), but its conciseness is effective for a straightforward search tool.

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

Completeness3/5

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

The tool is simple (2 parameters, no output schema), but the description does not clarify what the search returns (e.g., a list of series objects). While the purpose is clear, the lack of output schema places a burden on the description to hint at the response, which it fails to do.

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?

Since schema description coverage is 100% and the existing descriptions ('Search query (series title)', 'Max results to return (default: 200)') are adequate, the tool description adds no additional meaning. Per guidelines, baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the action ('Search'), the target resource ('TheTVDB'), and the purpose ('for new series to add to Sonarr'). This verb-resource combination distinguishes it from siblings like 'sonarr_get_series' (lists existing series) and 'radarr_search' (searches movies), making the tool's role unambiguous.

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

Usage Guidelines3/5

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

The description implies when to use the tool (when searching for new series to add to Sonarr) but offers no explicit guidance on when not to use it or alternatives (e.g., 'sonarr_trigger_search' for episode searches). The purpose is clear but lacks explicit exclusion or comparison to siblings.

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/niavasha/plex-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server