Skip to main content
Glama

get_submission

Retrieve a specific Reddit post or comment using its unique submission ID to access content details and metadata.

Instructions

Accéder à une soumission

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
submission_idYesL'ID de la soumission à récupérer

Implementation Reference

  • Main handler function for the 'get_submission' tool. Fetches submission data from Reddit client, formats it using formatPostInfo, and returns structured content.
    export async function getSubmission(params: { submission_id: string }) {
      const { submission_id } = params;
      const client = getRedditClient();
    
      if (!client) {
        throw new McpError(
          ErrorCode.InternalError,
          "Reddit client not initialized"
        );
      }
    
      try {
        console.log(`[Tool] Getting submission ${submission_id}`);
        const submission = await client.getSubmission(submission_id);
        const formattedSubmission = formatPostInfo(submission);
    
        return {
          content: [
            {
              type: "text",
              text: `
    # Soumission Reddit
    
    ## Détails de la soumission
    - Titre: ${formattedSubmission.title}
    - Type: ${formattedSubmission.type}
    - Auteur: u/${formattedSubmission.author}
    - Subreddit: r/${formattedSubmission.subreddit}
    
    ## Contenu
    ${formattedSubmission.content}
    
    ## Statistiques
    - Score: ${formattedSubmission.stats.score.toLocaleString()}
    - Ratio de votes positifs: ${(formattedSubmission.stats.upvoteRatio * 100).toFixed(1)}%
    - Commentaires: ${formattedSubmission.stats.comments.toLocaleString()}
    
    ## Métadonnées
    - Posté: ${formattedSubmission.metadata.posted}
    - Drapeaux: ${formattedSubmission.metadata.flags.length ? formattedSubmission.metadata.flags.join(", ") : "Aucun"}
    - Flair: ${formattedSubmission.metadata.flair}
    
    ## Liens
    - Post complet: ${formattedSubmission.links.fullPost}
    - Lien court: ${formattedSubmission.links.shortLink}
    
    ## Analyse d'engagement
    ${formattedSubmission.engagementAnalysis}
    
    ## Meilleur moment pour s'engager
    ${formattedSubmission.bestTimeToEngage}
              `,
            },
          ],
        };
      } catch (error) {
        console.error(`[Error] Error getting submission: ${error}`);
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to fetch submission: ${error}`
        );
      }
    }
  • src/index.ts:264-276 (registration)
    Registration of the 'get_submission' tool in the ListTools handler, including name, description, and input schema.
      name: "get_submission",
      description: "Accéder à une soumission",
      inputSchema: {
        type: "object",
        properties: {
          submission_id: {
            type: "string",
            description: "L'ID de la soumission à récupérer",
          },
        },
        required: ["submission_id"],
      },
    },
  • src/index.ts:483-486 (registration)
    Dispatcher case in CallToolRequestSchema handler that routes calls to the getSubmission tool function.
    case "get_submission":
      return await tools.getSubmission(
        toolParams as { submission_id: string }
      );
  • Helper method in RedditClient class that delegates to getPost for fetching submission data.
    async getSubmission(submissionId: string): Promise<RedditPost> {
      // Cette méthode est similaire à getPost, mais optimisée pour les submissions
      return await this.getPost(submissionId);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states 'access a submission', which implies a read operation but fails to detail critical traits like whether it's safe (non-destructive), requires authentication, has rate limits, or what the return format includes (e.g., submission data, error handling). This leaves the agent with insufficient information about how the tool behaves.

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 a single, concise phrase ('Accéder à une soumission') that is front-loaded and wastes no words. However, it is overly brief to the point of under-specification, lacking necessary details for effective tool use. While efficient in structure, it sacrifices completeness for brevity.

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 tool's complexity (a read operation with one parameter) and the absence of annotations and output schema, the description is incomplete. It does not explain what 'access' entails, the return values, or behavioral aspects like safety or authentication needs. For a tool in a Reddit context with multiple siblings, more context is required to guide the agent adequately.

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 input schema has 100% description coverage, with the single parameter 'submission_id' clearly documented as 'L'ID de la soumission à récupérer' (The ID of the submission to retrieve). The description adds no additional meaning beyond this, such as format examples or constraints. Given the high schema coverage, a baseline score of 3 is appropriate as the schema adequately handles parameter semantics.

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

Purpose2/5

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

The description 'Accéder à une soumission' (Access a submission) is a tautology that essentially restates the tool name 'get_submission' in French. It provides a vague purpose without specifying what 'access' entails (e.g., retrieve details, view content, fetch metadata) or distinguishing it from sibling tools like 'get_reddit_post' or 'get_comments_by_submission'. This lack of specificity makes it minimally informative.

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 offers no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing a valid submission_id), exclusions, or comparisons to siblings such as 'get_reddit_post' or 'get_comments_by_submission', leaving the agent without context for selection. This absence of usage instructions is a significant gap.

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/samy-clivolt/reddit-mcp-server'

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