Skip to main content
Glama

get_submission

Retrieve detailed information about a specific Reddit submission by providing its unique ID. Enables quick access to content for browsing or analysis.

Instructions

Retrieve a specific submission by ID.

Args:
    submission_id: ID of the submission to retrieve

Returns:
    Detailed information about the submission

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
submission_idYes

Implementation Reference

  • The main handler function that implements the 'get_submission' tool logic: fetches a Reddit submission by ID using RedditClient and returns formatted data as SubmissionResult.
    @validate_call(validate_return=True)
    def get_submission(submission_id: str) -> SubmissionResult:
        """
        Retrieve a specific submission by ID.
    
        Args:
            submission_id: ID of the submission to retrieve
    
        Returns:
            Detailed information about the submission
        """
        client = RedditClient.get_instance()
        submission = client.reddit.submission(submission_id)
    
        return SubmissionResult(
            title=submission.title,
            url=submission.url,
            author=None if submission.author is None else submission.author.name,
            subreddit=submission.subreddit.display_name,
            score=submission.score,
            num_comments=submission.num_comments,
            selftext=submission.selftext,
            created_utc=format_utc_timestamp(submission.created_utc),
        )
  • Pydantic BaseModel defining the output schema for the get_submission tool.
    class SubmissionResult(BaseModel):
        """Reddit submission details"""
    
        title: str = Field(description="Title of the submission")
        url: str = Field(description="URL of the submission")
        author: str | None = Field(description="Username of the author, or None if deleted")
        subreddit: str = Field(description="Name of the subreddit")
        score: int = Field(description="Number of upvotes minus downvotes")
        num_comments: int = Field(description="Number of comments on the submission")
        selftext: str = Field(description="Text content of the submission")
        created_utc: str = Field(description="UTC timestamp when submission was created")
  • Imports get_submission and includes it in the __all__ and 'tools' list, which is used for registering tools to the MCP server.
    from .get_submission import get_submission
    from .get_subreddit import get_subreddit
    from .get_comments import get_comments_by_submission, get_comment_by_id
    from .search_posts import search_posts
    from .search_subreddits import search_subreddits
    
    __all__ = [
        "get_submission",
        "get_subreddit",
        "get_comments_by_submission",
        "get_comment_by_id",
        "search_posts",
        "search_subreddits",
    ]
    
    # Registry of all available tools
    tools = [
        get_submission,
        get_subreddit,
        get_comments_by_submission,
        get_comment_by_id,
        search_posts,
        search_subreddits,
    ]
  • The MCP server setup function that imports the 'tools' list and registers each tool (including get_submission) to the FastMCP instance.
    from mcp.server.fastmcp import FastMCP
    from .tools import tools
    import logging
    
    
    def serve():
        logger = logging.getLogger("mcp")
    
        mcp = FastMCP("Reddit")
    
        for tool in tools:
            logger.info(f"Registering tool: {tool.__name__}")
            mcp.tool()(tool)
    
        logger.info("Starting MCP server...")
        mcp.run(transport="stdio")
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 'Retrieve' but doesn't disclose behavioral traits such as whether this is a read-only operation, if it requires authentication, rate limits, error handling, or what 'Detailed information' includes. This leaves significant gaps for an agent to understand how to use it effectively.

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 appropriately sized with three sentences: purpose, parameter, and return value. It's front-loaded with the main action, and each sentence adds value without redundancy. Minor improvements could include merging the Args/Returns sections into a single line for brevity.

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 nested objects) but lack of annotations and output schema, the description is minimally adequate. It covers the basic purpose and parameter but misses behavioral context and output details, which are crucial for a retrieval tool. It's complete enough to avoid being inadequate but has clear gaps.

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 0%, so the description must compensate. It adds meaning by specifying that 'submission_id' is the 'ID of the submission to retrieve', which clarifies the parameter's purpose beyond the schema's title 'Submission Id'. However, it doesn't provide format details (e.g., string format, examples) or constraints, leaving some ambiguity.

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 specific submission by ID'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'get_comment_by_id' or 'get_comments_by_submission', which follow similar patterns for comments versus submissions.

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 'search_posts' or 'get_comments_by_submission'. It mentions retrieving by ID but doesn't specify prerequisites (e.g., needing a known submission ID) or exclusions (e.g., not for bulk retrieval).

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