Skip to main content
Glama
Hawstein

MCP Server Reddit

by Hawstein

get_frontpage_posts

Retrieve trending posts from the Reddit frontpage to monitor popular discussions and content.

Instructions

Get hot posts from Reddit frontpage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of posts to return (default: 10)

Implementation Reference

  • The core handler function implementing get_frontpage_posts. Fetches hot posts from Reddit's frontpage using redditwarp.Client, builds Post models using _build_post helper, and returns a list of them.
    def get_frontpage_posts(self, limit: int = 10) -> list[Post]:
        """Get hot posts from Reddit frontpage"""
        posts = []
        for subm in self.client.p.front.pull.hot(limit):
            posts.append(self._build_post(subm))
        return posts
  • Pydantic BaseModel schema defining the structure of a Reddit Post, used in the return type of get_frontpage_posts.
    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
  • Registers the get_frontpage_posts tool with the MCP server in the list_tools handler, specifying name, description, and input JSON schema.
        name=RedditTools.GET_FRONTPAGE_POSTS.value,
        description="Get hot posts from Reddit frontpage",
        inputSchema={
            "type": "object",
            "properties": {
                "limit": {
                    "type": "integer",
                    "description": "Number of posts to return (default: 10)",
                    "default": 10,
                    "minimum": 1,
                    "maximum": 100
                }
            }
        }
    ),
  • Key helper function that converts a redditwarp submission object into a structured Post model, called by get_frontpage_posts.
    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)
        )
  • In the MCP call_tool handler, matches on tool name and dispatches to the get_frontpage_posts method with parsed arguments.
    case RedditTools.GET_FRONTPAGE_POSTS.value:
        limit = arguments.get("limit", 10)
        result = reddit_server.get_frontpage_posts(limit)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool gets posts but doesn't mention whether this is a read-only operation, if it requires authentication, rate limits, pagination behavior, or what format the returned posts will have. For a tool that likely makes external API calls, this leaves significant behavioral gaps.

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 extremely concise at just 5 words, front-loading the core purpose without any unnecessary elaboration. Every word earns its place by specifying what's being retrieved ('hot posts') and from where ('Reddit frontpage'). There's zero waste in this minimal but complete statement of function.

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 tool likely interacts with an external API (Reddit) and has no annotations or output schema, the description is insufficiently complete. It doesn't explain what 'hot' means algorithmically, whether results are personalized or global, authentication requirements, rate limits, or return format. For a tool with external dependencies and no structured behavioral hints, more context 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 description mentions no parameters, while the schema has 1 parameter with 100% coverage (including description, default, and constraints). Since schema_description_coverage is high (>80%), the baseline is 3 even without parameter information in the description. The description doesn't add meaning beyond what the schema already provides about the 'limit' parameter.

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 'Get hot posts from Reddit frontpage' clearly states the action (get) and resource (hot posts from Reddit frontpage), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_subreddit_hot_posts' or 'get_subreddit_top_posts', which could cause confusion about when to use this specific tool versus those alternatives.

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_hot_posts' and 'get_subreddit_top_posts' available, there's no indication whether this tool is for the aggregated frontpage versus specific subreddits, or what 'hot' means compared to 'top' or 'new' posts. The lack of context leaves 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