Skip to main content
Glama
Hawstein

MCP Server Reddit

by Hawstein

get_post_content

Retrieve detailed content from Reddit posts including comments with configurable depth and limits for analysis or integration.

Instructions

Get detailed content of a specific post

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
post_idYesID of the post
comment_limitNoNumber of top-level comments to return (default: 10)
comment_depthNoMaximum depth of comment tree (default: 3)

Implementation Reference

  • Primary handler function in RedditServer class that fetches the Reddit post by ID, builds the Post object using helper, retrieves comments, and returns a PostDetail object containing post and comments.
    def get_post_content(self, post_id: str, comment_limit: int = 10, comment_depth: int = 3) -> PostDetail:
        """Get detailed content of a specific post including comments"""
        submission = self.client.p.submission.fetch(post_id)
        post = self._build_post(submission)
    
        # Fetch comments
        comments = self.get_post_comments(post_id, comment_limit)
        
        return PostDetail(post=post, comments=comments)
  • Registration of the get_post_content tool in the MCP server's list_tools() handler, defining name, description, and input schema.
    Tool(
        name=RedditTools.GET_POST_CONTENT.value,
        description="Get detailed content of a specific post",
        inputSchema={
            "type": "object",
            "properties": {
                "post_id": {
                    "type": "string",
                    "description": "ID of the post",
                },
                "comment_limit": {
                    "type": "integer",
                    "description": "Number of top-level comments to return (default: 10)",
                    "default": 10,
                    "minimum": 1,
                    "maximum": 100
                },
                "comment_depth": {
                    "type": "integer",
                    "description": "Maximum depth of comment tree (default: 3)",
                    "default": 3,
                    "minimum": 1,
                    "maximum": 10
                }
            },
            "required": ["post_id"]
        }
    ),
  • Input schema (JSON Schema) for the get_post_content tool, defining parameters post_id (required), comment_limit, and comment_depth.
    inputSchema={
        "type": "object",
        "properties": {
            "post_id": {
                "type": "string",
                "description": "ID of the post",
            },
            "comment_limit": {
                "type": "integer",
                "description": "Number of top-level comments to return (default: 10)",
                "default": 10,
                "minimum": 1,
                "maximum": 100
            },
            "comment_depth": {
                "type": "integer",
                "description": "Maximum depth of comment tree (default: 3)",
                "default": 3,
                "minimum": 1,
                "maximum": 10
            }
        },
        "required": ["post_id"]
    }
  • Dispatch handler in the MCP call_tool() function that handles the get_post_content tool call by parsing arguments and invoking the RedditServer.get_post_content method.
    case RedditTools.GET_POST_CONTENT.value:
        post_id = arguments.get("post_id")
        if not post_id:
            raise ValueError("Missing required argument: post_id")
        comment_limit = arguments.get("comment_limit", 10)
        comment_depth = arguments.get("comment_depth", 3)
        result = reddit_server.get_post_content(post_id, comment_limit, comment_depth)
  • Helper function used by _build_post to extract the content string from a Reddit submission based on its type (link, text, gallery). Called indirectly via the main handler.
    def _get_post_content(self, submission) -> str | None:
        """Helper method to extract post content based on type"""
        if isinstance(submission, redditwarp.models.submission_SYNC.LinkPost):
            return submission.permalink
        elif isinstance(submission, redditwarp.models.submission_SYNC.TextPost):
            return submission.body
        elif isinstance(submission, redditwarp.models.submission_SYNC.GalleryPost):
            return str(submission.gallery_link)
        return 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 'Get detailed content' but doesn't clarify what 'detailed content' includes (e.g., post body, metadata, comments), whether it's a read-only operation, potential rate limits, or error handling. 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 with no wasted words. It's front-loaded with the core purpose ('Get detailed content of a specific post'), making it easy to parse quickly. Every word earns its place, achieving optimal conciseness.

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 complexity (a post retrieval tool with parameters for comments), no annotations, and no output schema, the description is incomplete. It doesn't explain what 'detailed content' entails, how comments are included, or the return format, leaving gaps that could hinder correct tool invocation by an AI agent.

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?

Schema description coverage is 100%, so the schema fully documents all three parameters (post_id, comment_limit, comment_depth) with descriptions, defaults, and constraints. The description adds no additional parameter semantics beyond what the schema provides, meeting the baseline score of 3 for high schema coverage.

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 the resource 'detailed content of a specific post', making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_post_comments' or 'get_frontpage_posts', which might also retrieve post-related data, so it lacks sibling differentiation for a perfect score.

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 like 'get_post_comments' or 'get_frontpage_posts'. It doesn't mention prerequisites, exclusions, or specific contexts, leaving the agent with no usage instructions beyond the basic purpose.

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