Skip to main content
Glama
eliasbiondo

Reddit MCP Server

by eliasbiondo

reddit_search

Search Reddit posts by keywords to find relevant discussions, with options to filter results by sort order and limit the number of posts returned.

Instructions

Search all of Reddit for posts matching a query.

Args: query: Search keywords (e.g., 'python web scraping', 'machine learning') 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
queryYes
limitNo
sortNo

Implementation Reference

  • The reddit_search tool handler implementation, which calls the search service and serializes the result.
    async def reddit_search(
        query: str,
        ctx: Context,
        limit: int = 25,
        sort: str | None = None,
    ) -> list[dict[str, Any]]:
        try:
            results = await service.search(query, limit=limit, sort=sort)
            return McpSerializer.serialize_list(results)
        except Exception as e:
            McpErrorMapper.map(e, "reddit_search")
  • The registration of the reddit_search tool using FastMCP.
    @mcp.tool(
        name="reddit_search",
        description=(
            "Search all of Reddit for posts matching a query.\n\n"
            "Args:\n"
            "    query: Search keywords "
            "(e.g., 'python web scraping', 'machine learning')\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