Skip to main content
Glama

search

Search across configured *arr libraries and TRaSH Guides reference profiles using natural language queries for media discovery.

Instructions

Search across configured *arr libraries plus TRaSH Guides reference profiles. This is the primary discovery tool for remote MCP clients such as ChatGPT.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural-language search query

Implementation Reference

  • Schema (inputSchema) for the 'search' tool: requires a 'query' string property. Defines the tool's name and input contract.
    {
      name: "search",
      description: "Search across configured *arr libraries plus TRaSH Guides reference profiles. This is the primary discovery tool for remote MCP clients such as ChatGPT.",
      inputSchema: {
        type: "object" as const,
        properties: {
          query: {
            type: "string",
            description: "Natural-language search query",
          },
        },
        required: ["query"],
      },
    },
  • Handler for the 'search' tool in the CallToolRequestSchema switch statement. Extracts 'query' from args, calls runUnifiedSearch(query), and returns results as JSON.
    case "search": {
      const query = (args as { query: string }).query;
      const results = await runUnifiedSearch(query);
      return jsonText({ results });
    }
  • runUnifiedSearch() helper function that performs the actual search logic: searches TRaSH profile names/descriptions, Sonarr series, Radarr movies, and Lidarr artists, returning up to 5 results from each source.
    async function runUnifiedSearch(query: string): Promise<SearchEntry[]> {
      const results: SearchEntry[] = [];
      const trimmedQuery = query.trim();
    
      if (trimmedQuery.length === 0) {
        return results;
      }
    
      const lowerQuery = trimmedQuery.toLowerCase();
    
      for (const service of ["radarr", "sonarr"] as const) {
        const profiles = await trashClient.listProfiles(service);
        results.push(
          ...profiles
            .filter((profile) =>
              profile.name.toLowerCase().includes(lowerQuery) ||
              profile.description?.toLowerCase().includes(lowerQuery)
            )
            .slice(0, 8)
            .map((profile) => ({
              id: `trash-profile:${service}:${profile.name}`,
              title: `${profile.name} (${service})`,
              url: buildResourceUrl(`trash/profile/${service}/${encodeURIComponent(profile.name)}`),
              type: "trash_profile",
              service,
              summary: profile.description?.replace(/<br>/g, " "),
            }))
        );
      }
    
      if (clients.sonarr) {
        const series = await clients.sonarr.searchSeries(trimmedQuery);
        results.push(
          ...series.slice(0, 5).map((item) => ({
            id: `arr:sonarr:series:${item.tvdbId}`,
            title: `${item.title}${item.year ? ` (${item.year})` : ""}`,
            url: buildResourceUrl(`arr/sonarr/series/${item.tvdbId}`),
            type: "series",
            service: "sonarr",
            summary: item.overview?.slice(0, 220),
          }))
        );
      }
    
      if (clients.radarr) {
        const movies = await clients.radarr.searchMovies(trimmedQuery);
        results.push(
          ...movies.slice(0, 5).map((item) => ({
            id: `arr:radarr:movie:${item.tmdbId}`,
            title: `${item.title}${item.year ? ` (${item.year})` : ""}`,
            url: buildResourceUrl(`arr/radarr/movie/${item.tmdbId}`),
            type: "movie",
            service: "radarr",
            summary: item.overview?.slice(0, 220),
          }))
        );
      }
    
      if (clients.lidarr) {
        const artists = await clients.lidarr.searchArtists(trimmedQuery);
        results.push(
          ...artists.slice(0, 5).map((item) => ({
            id: `arr:lidarr:artist:${item.foreignArtistId}`,
            title: item.artistName || item.title,
            url: buildResourceUrl(`arr/lidarr/artist/${item.foreignArtistId}`),
            type: "artist",
            service: "lidarr",
            summary: item.overview?.slice(0, 220),
          }))
        );
      }
    
      return results;
  • src/index.ts:85-126 (registration)
    Registration of tools including 'search' in the TOOLS array. The 'search' tool is listed among the core general tools (arr_status, search, fetch).
    const TOOLS: Tool[] = [
      // General tool available for all
      {
        name: "arr_status",
        description: configuredServices.length > 0
          ? `Get status of all configured *arr services. Currently configured: ${configuredServices.map(s => s.displayName).join(', ')}`
          : "Get status of all supported *arr services. No local *arr services are currently configured, but TRaSH reference tools remain available.",
        inputSchema: {
          type: "object" as const,
          properties: {},
          required: [],
        },
      },
      {
        name: "search",
        description: "Search across configured *arr libraries plus TRaSH Guides reference profiles. This is the primary discovery tool for remote MCP clients such as ChatGPT.",
        inputSchema: {
          type: "object" as const,
          properties: {
            query: {
              type: "string",
              description: "Natural-language search query",
            },
          },
          required: ["query"],
        },
      },
      {
        name: "fetch",
        description: "Fetch a specific item returned by search. Accepts an opaque item id from the search tool.",
        inputSchema: {
          type: "object" as const,
          properties: {
            id: {
              type: "string",
              description: "Opaque result id returned by search",
            },
          },
          required: ["id"],
        },
      },
    ];
Behavior2/5

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

No annotations are provided, so the description carries full responsibility for behavioral disclosure. It does not mention side effects, authentication needs, rate limits, or whether the search is read-only. The agent gains no safety or operational context beyond the basic function.

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 two sentences with no filler: it states the action and the primary use case. Every sentence contributes value, and the length is appropriate for the tool's simplicity.

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 the absence of an output schema and annotations, the description is incomplete. It does not describe return format, limits, or what 'search across' entails. With many sibling search tools, more context is needed to fully guide selection.

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 single parameter 'query' is fully described in the schema (100% coverage), and the description adds no additional meaning beyond the schema's 'Natural-language search query'. Baseline 3 applies since the schema handles the parameter documentation.

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 it searches across *arr libraries and TRaSH Guides, and identifies itself as the primary discovery tool for remote MCP clients. However, it does not explicitly distinguish itself from the sibling tool arr_search_all, which may have overlapping functionality.

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 implies use for remote discovery but provides no guidance on when to use this tool versus the many specific search tools (e.g., sonarr_search, radarr_search). No when-not-to-use or alternative tools are mentioned, leaving the agent without clear decision criteria.

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