Skip to main content
Glama
liuyang1520

Reddit MCP Server

by liuyang1520

get_subreddit_info

Retrieve subreddit details like description, subscriber count, and rules to analyze community data from Reddit's API.

Instructions

Get information about a subreddit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subredditYesName of the subreddit (without r/ prefix)

Implementation Reference

  • Core handler function that authenticates, makes API request to Reddit for subreddit info, and maps the response to a structured RedditSubreddit object.
    async getSubredditInfo(subreddit: string): Promise<RedditSubreddit> {
      const data = await this.makeRequest(`/r/${subreddit}/about`);
      return this.mapSubreddit(data.data);
    }
  • Zod schema for validating input parameters (subreddit name) to the get_subreddit_info tool.
    const GetSubredditInfoSchema = z.object({
      subreddit: z.string().min(1, "Subreddit name is required"),
    });
  • src/index.ts:150-163 (registration)
    Tool registration in the MCP server's listTools response, defining name, description, and input schema.
    {
      name: 'get_subreddit_info',
      description: 'Get information about a subreddit',
      inputSchema: {
        type: 'object',
        properties: {
          subreddit: {
            type: 'string',
            description: 'Name of the subreddit (without r/ prefix)',
          },
        },
        required: ['subreddit'],
      },
    },
  • MCP dispatch handler case that parses arguments using the schema, calls the RedditClient handler, and formats the JSON response.
    case 'get_subreddit_info': {
      const args = GetSubredditInfoSchema.parse(request.params.arguments);
      const subreddit = await redditClient.getSubredditInfo(args.subreddit);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(subreddit, null, 2),
          },
        ],
      };
    }
  • TypeScript interface defining the output structure for subreddit information returned by the handler.
    export interface RedditSubreddit {
      display_name: string;
      title: string;
      description: string;
      subscribers: number;
      created_utc: number;
      public_description: string;
      url: string;
      over18: boolean;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It doesn't disclose behavioral traits such as whether this is a read-only operation, potential rate limits, authentication needs, error handling (e.g., for non-existent subreddits), or response format. The description is minimal and adds no context beyond the basic purpose.

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, efficient sentence with no wasted words, making it appropriately sized and front-loaded. However, it's overly concise to the point of under-specification, lacking details that would enhance usability without becoming verbose.

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 simplicity (1 parameter, 100% schema coverage) but lack of annotations and output schema, the description is incomplete. It doesn't explain what information is returned (e.g., metadata fields), potential errors, or usage context, leaving gaps for the agent to infer behavior in a Reddit API environment.

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?

Schema description coverage is 100%, with the parameter 'subreddit' clearly documented in the schema as 'Name of the subreddit (without r/ prefix)'. The description adds no additional meaning beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without compensating value.

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

Purpose3/5

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

The description 'Get information about a subreddit' states a clear verb ('Get') and resource ('subreddit'), but it's vague about what specific information is retrieved. It distinguishes from siblings like 'get_subreddit_posts' or 'search_subreddits' by focusing on subreddit metadata rather than content, but lacks specificity about the type of information (e.g., description, subscriber count, rules).

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. It doesn't mention prerequisites (e.g., subreddit existence), exclusions, or comparisons to siblings like 'get_subreddit_posts' (for posts) or 'search_subreddits' (for finding subreddits). The agent must infer usage from the tool name alone.

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

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