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")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It only states that the tool retrieves and returns detailed information, omitting details like authentication requirements, rate limits, error handling (e.g., if ID not found), or whether the operation is read-only.

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: one sentence for purpose, followed by a clear parameter documentation and return value hint. No redundant information.

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?

For a simple retrieval tool with one parameter and no output schema, the description covers the basic purpose and parameter. However, it lacks details on the expected return format, error cases, and any prerequisites (e.g., authentication), leaving some gaps for the 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?

With 0% schema description coverage, the description adds basic meaning to the parameter ("ID of the submission to retrieve") beyond the schema's type-only definition. However, the explanation is minimal and does not specify input formats 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 the action (retrieve) and the resource (a specific submission by ID). It effectively distinguishes from sibling tools like get_comment_by_id and get_comments_by_submission, which operate on comments.

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 a submission ID is known, but it does not explicitly specify when to use this tool over alternatives (e.g., search_posts for query-based retrieval). No when-not or alternative guidance is provided.

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