Skip to main content
Glama
liuyang1520

Reddit MCP Server

by liuyang1520

search_subreddits

Find relevant subreddits by searching names and descriptions to discover communities matching specific topics or interests.

Instructions

Search for subreddits

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for subreddit names/descriptions
limitNoNumber of results to retrieve (1-100)

Implementation Reference

  • MCP tool handler for 'search_subreddits' that validates input with SearchSubredditsSchema and delegates to redditClient.searchSubreddits
    case 'search_subreddits': {
      const args = SearchSubredditsSchema.parse(request.params.arguments);
      const subreddits = await redditClient.searchSubreddits(args.query, args.limit);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(subreddits, null, 2),
          },
        ],
      };
    }
  • Zod schema defining input parameters for the search_subreddits tool: query (required string) and limit (optional number, default 25, 1-100)
    const SearchSubredditsSchema = z.object({
      query: z.string().min(1, "Search query is required"),
      limit: z.number().min(1).max(100).default(25),
    });
  • src/index.ts:268-288 (registration)
    Registration of the 'search_subreddits' tool in the ListTools response, specifying name, description, and JSON input schema
    {
      name: 'search_subreddits',
      description: 'Search for subreddits',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query for subreddit names/descriptions',
          },
          limit: {
            type: 'number',
            description: 'Number of results to retrieve (1-100)',
            minimum: 1,
            maximum: 100,
            default: 25,
          },
        },
        required: ['query'],
      },
    },
  • Core implementation of subreddit search in RedditClient class, making API request to /subreddits/search and mapping results to RedditSubreddit objects
    async searchSubreddits(query: string, limit: number = 25): Promise<RedditSubreddit[]> {
      const data = await this.makeRequest(`/subreddits/search?q=${encodeURIComponent(query)}&limit=${limit}`);
      return data.data.children.map((child: any) => this.mapSubreddit(child.data));
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action 'Search for subreddits' without detailing aspects like rate limits, authentication needs, pagination, or what the search covers (e.g., names, descriptions). For a search tool with zero annotation coverage, this is inadequate.

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 extremely concise with a single sentence, 'Search for subreddits,' which is front-loaded and wastes no words. While efficient, it may be overly brief given the lack of other context, but it earns points for clarity and brevity without redundancy.

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 complexity of a search operation, no annotations, and no output schema, the description is incomplete. It doesn't explain what the search returns, how results are ordered, or any behavioral traits. For a tool with two parameters and no structured output, more context is needed to guide effective use.

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?

Schema description coverage is 100%, with clear documentation for 'query' and 'limit' parameters. The description adds no additional meaning beyond what the schema provides, such as search scope or result format. However, with high schema coverage, the baseline score is 3, as the schema adequately handles parameter semantics.

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

Purpose3/5

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

The description 'Search for subreddits' states the basic action and resource but lacks specificity. It doesn't differentiate from sibling tools like 'search_posts' or 'get_subreddit_info' beyond the resource name. While it's not tautological (it doesn't just repeat the name), it's vague about what 'search' entails compared to alternatives.

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 no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_subreddit_info' (for specific subreddit details) or 'search_posts' (for content within subreddits), nor does it specify prerequisites or exclusions. Usage is implied by the name alone.

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/liuyang1520/reddit-mcp'

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