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

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)"
        ),
    )

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