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)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations, the description fails to add behavioral context. It only mentions 'Detailed information' without specifics, and does not disclose potential limitations like rate limits or access restrictions.

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

Conciseness4/5

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

The description is very short and to the point, with no unnecessary words. However, the inclusion of Args/Returns structure is not standard for MCP and could be streamlined.

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 one parameter and no output schema, the description is minimal. It lacks details about return format, limitations, or when to use this tool over siblings, leaving an agent with insufficient information.

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

Parameters2/5

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

Schema description coverage is 0%. The description for 'subreddit_name' merely restates the parameter name ('Name of the subreddit to retrieve') without adding semantic value or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Retrieve a subreddit by name,' which is a specific verb-resource pair. It distinguishes from siblings like search_subreddits by implying retrieval of a single subreddit rather than searching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have a subreddit name, but does not explicitly state when not to use or mention alternatives like search_subreddits. Guidance is minimal.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools

Related Tools