Skip to main content
Glama
Hawstein

MCP Server Reddit

by Hawstein

get_subreddit_hot_posts

Retrieve trending posts from any Reddit community to monitor popular discussions and content.

Instructions

Get hot posts from a specific subreddit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subreddit_nameYesName of the subreddit (e.g. 'Python', 'news')
limitNoNumber of posts to return (default: 10)

Implementation Reference

  • The core handler function that fetches hot posts from the specified subreddit using redditwarp client, builds Post objects using helper, and returns the list.
    def get_subreddit_hot_posts(self, subreddit_name: str, limit: int = 10) -> list[Post]:
        """Get hot posts from a specific subreddit"""
        posts = []
        for subm in self.client.p.subreddit.pull.hot(subreddit_name, limit):
            posts.append(self._build_post(subm))
        return posts
  • Pydantic model defining the structure of a Post, used as the return type for get_subreddit_hot_posts (list[Post]).
    class Post(BaseModel):
        id: str
        title: str
        author: str
        score: int
        subreddit: str
        url: str
        created_at: str
        comment_count: int
        post_type: PostType
        content: str | None
  • Tool registration in MCP server's list_tools(), including name, description, and input schema validation.
    Tool(
        name=RedditTools.GET_SUBREDDIT_HOT_POSTS.value,
        description="Get hot posts from a specific subreddit",
        inputSchema={
            "type": "object",
            "properties": {
                "subreddit_name": {
                    "type": "string",
                    "description": "Name of the subreddit (e.g. 'Python', 'news')",
                },
                "limit": {
                    "type": "integer",
                    "description": "Number of posts to return (default: 10)",
                    "default": 10,
                    "minimum": 1,
                    "maximum": 100
                }
            },
            "required": ["subreddit_name"]
        }
    ),
  • Dispatch logic in MCP server's call_tool() that validates arguments and invokes the handler function.
    case RedditTools.GET_SUBREDDIT_HOT_POSTS.value:
        subreddit_name = arguments.get("subreddit_name")
        if not subreddit_name:
            raise ValueError("Missing required argument: subreddit_name")
        limit = arguments.get("limit", 10)
        result = reddit_server.get_subreddit_hot_posts(subreddit_name, limit)
  • Helper function used by the handler to construct Post models from raw redditwarp submission objects.
    def _build_post(self, submission) -> Post:
        """Helper method to build Post object from submission"""
        return Post(
            id=submission.id36,
            title=submission.title,
            author=submission.author_display_name or '[deleted]',
            score=submission.score,
            subreddit=submission.subreddit.name,
            url=submission.permalink,
            created_at=submission.created_at.astimezone().isoformat(),
            comment_count=submission.comment_count,
            post_type=self._get_post_type(submission),
            content=self._get_post_content(submission)
        )
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It doesn't mention whether this is a read-only operation (implied by 'Get'), rate limits, authentication requirements, or what the return format looks like (e.g., list of posts with titles, scores, etc.).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's perfectly front-loaded and wastes no space.

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?

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'hot' means algorithmically, what data is returned, or any behavioral constraints. Given the context of multiple sibling tools with different sorting methods, more completeness is needed.

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?

The schema has 100% description coverage, providing clear documentation for both parameters. The description adds no additional parameter semantics beyond what's already in the schema, so it meets the baseline of 3 for adequate coverage without adding value.

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 action ('Get') and resource ('hot posts from a specific subreddit'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from siblings like 'get_subreddit_new_posts' or 'get_subreddit_top_posts', which would require mentioning the 'hot' sorting algorithm specifically.

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. With siblings like 'get_subreddit_new_posts' and 'get_subreddit_top_posts' available, there's no indication that this tool retrieves posts sorted by Reddit's 'hot' algorithm rather than other sorting methods.

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

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