Skip to main content
Glama
eliasbiondo

Reddit MCP Server

by eliasbiondo

reddit_get_subreddit_posts

Fetch posts from any Reddit subreddit by specifying category, time filter, and quantity limits to gather community discussions.

Instructions

Get posts from a subreddit listing.

Args: subreddit: Subreddit name without r/ prefix (e.g., 'Python', 'news') limit: Maximum number of posts (default: 25, max: 100) category: Listing category (hot, top, new, rising). Default: hot time_filter: Time window for top listings (hour, day, week, month, year, all). Default: all

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subredditYes
limitNo
categoryNo
time_filterNo

Implementation Reference

  • The handler function for 'reddit_get_subreddit_posts' which uses the PostService to fetch posts and serializes the response.
    async def reddit_get_subreddit_posts(
        subreddit: str,
        ctx: Context,
        limit: int = 25,
        category: str | None = None,
        time_filter: str | None = None,
    ) -> list[dict[str, Any]]:
        try:
            results = await service.get_subreddit_posts(
                subreddit, limit=limit, category=category, time_filter=time_filter
            )
            return McpSerializer.serialize_list(results)
        except Exception as e:
            McpErrorMapper.map(e, "reddit_get_subreddit_posts")
  • Registration of the 'reddit_get_subreddit_posts' tool with its description and arguments using FastMCP.
    @mcp.tool(
        name="reddit_get_subreddit_posts",
        description=(
            "Get posts from a subreddit listing.\n\n"
            "Args:\n"
            "    subreddit: Subreddit name without r/ prefix (e.g., 'Python', 'news')\n"
            "    limit: Maximum number of posts (default: 25, max: 100)\n"
            "    category: Listing category (hot, top, new, rising). Default: hot\n"
            "    time_filter: Time window for top listings "
            "(hour, day, week, month, year, all). Default: all"
        ),
    )

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