Skip to main content
Glama
Hawstein

MCP Server Reddit

by Hawstein

get_subreddit_rising_posts

Retrieve trending posts from any subreddit to identify content gaining popularity before it reaches the front page.

Instructions

Get rising 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 main handler function that fetches rising posts from the specified subreddit using the redditwarp SYNC client and constructs Post objects using the _build_post helper.
    def get_subreddit_rising_posts(self, subreddit_name: str, limit: int = 10) -> list[Post]:
        """Get rising posts from a specific subreddit"""
        posts = []
        for subm in self.client.p.subreddit.pull.rising(subreddit_name, limit):
            posts.append(self._build_post(subm))
        return posts
  • Input schema definition for the tool, specifying required 'subreddit_name' parameter and optional 'limit'.
    Tool(
        name=RedditTools.GET_SUBREDDIT_RISING_POSTS.value,
        description="Get rising 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"]
        }
    ),
  • Registration and dispatch logic in the call_tool handler that validates arguments and invokes the get_subreddit_rising_posts method.
    case RedditTools.GET_SUBREDDIT_RISING_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_rising_posts(subreddit_name, limit)
  • Supporting helper function that converts a redditwarp submission object into a structured Post model instance, used by the handler.
    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)
        )
  • Pydantic model defining the output structure of Post objects returned by the tool.
    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
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but doesn't mention any behavioral traits such as rate limits, authentication requirements, pagination, or what the return format looks like. This is a significant gap for a tool with no annotation coverage.

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 wasted words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'rising' means in Reddit's context, the return format, or any behavioral aspects like error handling. For a tool with two parameters and multiple siblings, more context is needed to be fully helpful.

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 description coverage is 100%, with clear descriptions for both parameters ('subreddit_name' and 'limit'), including defaults and constraints. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 without compensating or detracting.

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 ('Get') and resource ('rising posts from a specific subreddit'), making the purpose immediately understandable. It distinguishes itself from siblings like 'get_subreddit_hot_posts' or 'get_subreddit_new_posts' by specifying 'rising' posts, though it doesn't explicitly contrast with them in the text.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'get_subreddit_hot_posts' and 'get_subreddit_new_posts', the description lacks any context about what 'rising' means or when it's preferred over other listing tools, leaving usage decisions ambiguous.

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