Skip to main content
Glama
eliasbiondo

Reddit MCP Server

by eliasbiondo

reddit_search_subreddit

Search for content within a specific Reddit community using keywords, with options to sort results and limit the number of posts returned.

Instructions

Search within a specific subreddit.

Args: subreddit: Subreddit name without r/ prefix (e.g., 'Python', 'MachineLearning') query: Search keywords limit: Maximum number of results to return (default: 25, max: 100) sort: Sort order for results (relevance, hot, top, new, comments)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subredditYes
queryYes
limitNo
sortNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function `reddit_search_subreddit` that processes the tool call by delegating to the search_service and serializing the response.
    async def reddit_search_subreddit(
        subreddit: str,
        query: str,
        ctx: Context,
        limit: int = 25,
        sort: str | None = None,
    ) -> list[dict[str, Any]]:
        try:
            results = await service.search_subreddit(subreddit, query, limit=limit, sort=sort)
            return McpSerializer.serialize_list(results)
        except Exception as e:
            McpErrorMapper.map(e, "reddit_search_subreddit")
  • Registration of the `reddit_search_subreddit` tool using the FastMCP decorator.
    @mcp.tool(
        name="reddit_search_subreddit",
        description=(
            "Search within a specific subreddit.\n\n"
            "Args:\n"
            "    subreddit: Subreddit name without r/ prefix "
            "(e.g., 'Python', 'MachineLearning')\n"
            "    query: Search keywords\n"
            "    limit: Maximum number of results to return "
            "(default: 25, max: 100)\n"
            "    sort: Sort order for results "
            "(relevance, hot, top, new, comments)"
        ),
    )
Behavior3/5

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

With no annotations provided, the description carries the full burden. The term 'Search' implies a read-only operation, which is helpful, but the description lacks disclosure of rate limits, authentication requirements, error behaviors (e.g., private/quarantined subreddits), or what content types are returned. The existence of an output schema mitigates some return-value disclosure needs.

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 efficiently structured with a clear purpose statement front-loaded ('Search within a specific subreddit'), followed by a well-formatted Args section. Every sentence earns its place. Minor deduction only because the Args documentation is slightly verbose, though necessary given the schema's lack of descriptions.

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

Completeness4/5

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

Given the 0% schema coverage, the description successfully documents all 4 parameters with examples and constraints. The presence of an output schema means return values don't need explanation in the description. It adequately covers the tool's scope, though it could mention error cases or sibling distinctions for completeness.

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

Parameters5/5

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

Excellent compensation for 0% schema description coverage. The Args section adds crucial semantics: 'subreddit' includes format guidance ('without r/ prefix') and examples, 'limit' specifies constraints (default: 25, max: 100), and 'sort' enumerates valid options. This provides complete semantic meaning that the schema totally lacks.

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 verb ('Search') and resource ('subreddit'), and the phrase 'within a specific subreddit' effectively distinguishes it from the sibling 'reddit_search' tool (which presumably searches all of Reddit). However, it doesn't specify what content type is being searched (posts, comments, etc.), preventing a 5.

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 usage context by requiring a 'subreddit' parameter, suggesting this is for targeted single-community searches. However, it lacks explicit guidance on when to prefer this over 'reddit_search' (global search) or 'reddit_get_subreddit_posts' (listing vs. searching), and doesn't mention prerequisites like subreddit existence or access requirements.

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

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