Skip to main content
Glama

get_subreddit

Retrieve detailed information about a specific subreddit by providing its name. Use this tool to browse, search, and read subreddit content through the Reddit MCP server.

Instructions

Retrieve a subreddit by name.

Args:
    subreddit_name: Name of the subreddit to retrieve

Returns:
    Detailed information about the subreddit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subreddit_nameYes

Implementation Reference

  • The main handler function that retrieves subreddit details using RedditClient and returns a structured SubredditResult.
    @validate_call(validate_return=True)
    def get_subreddit(subreddit_name: str) -> SubredditResult:
        """
        Retrieve a subreddit by name.
    
        Args:
            subreddit_name: Name of the subreddit to retrieve
    
        Returns:
            Detailed information about the subreddit
        """
        client = RedditClient.get_instance()
        subreddit = client.reddit.subreddit(subreddit_name)
    
        return SubredditResult(
            display_name=subreddit.display_name,
            title=subreddit.title,
            description=subreddit.description,
            public_description=subreddit.public_description,
            subscribers=subreddit.subscribers,
            created_utc=subreddit.created_utc,
            over18=subreddit.over18,
            url=subreddit.url,
        )
  • Pydantic BaseModel defining the output schema for the get_subreddit tool.
    class SubredditResult(BaseModel):
        """Subreddit details"""
    
        display_name: str = Field(description="Display name of the subreddit")
        title: str = Field(description="Title of the subreddit")
        description: str = Field(description="Full subreddit description")
        public_description: str = Field(description="Short public description")
        subscribers: int = Field(description="Number of subscribers")
        created_utc: float = Field(description="UTC timestamp when subreddit was created")
        over18: bool = Field(description="Whether the subreddit is NSFW")
        url: str = Field(description="URL of the subreddit")
  • The 'tools' list collects all tool functions, including get_subreddit, for registration in the MCP server.
    tools = [
        get_submission,
        get_subreddit,
        get_comments_by_submission,
        get_comment_by_id,
        search_posts,
        search_subreddits,
    ]
  • Loop that registers each tool from the 'tools' list using FastMCP's tool decorator.
    for tool in tools:
        logger.info(f"Registering tool: {tool.__name__}")
        mcp.tool()(tool)
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. It states the action ('Retrieve') and return ('Detailed information'), but doesn't disclose behavioral traits such as authentication needs, rate limits, error handling, or what 'detailed information' entails. This leaves significant gaps 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 appropriately sized and front-loaded, with a clear purpose statement followed by structured Args and Returns sections. Every sentence earns its place without redundancy, making it efficient and well-organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and parameter but lacks details on behavior, usage context, and output specifics, leaving room for improvement in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 1 parameter, the description compensates by explaining the parameter's purpose ('Name of the subreddit to retrieve'), adding meaningful context beyond the schema's basic type. This is sufficient for the single parameter, though it doesn't detail format or constraints.

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 ('Retrieve') and resource ('a subreddit by name'), making the purpose specific and understandable. It distinguishes from siblings like 'search_subreddits' by focusing on retrieval of a single subreddit rather than searching, though it doesn't explicitly name 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?

No guidance is provided on when to use this tool versus alternatives like 'search_subreddits' for finding subreddits or other siblings for different data types. The description implies usage for retrieving a known subreddit by name but lacks explicit context or exclusions.

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

Related 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/GridfireAI/reddit-mcp'

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