Skip to main content
Glama
tandat8503

Reddit MCP Server

by tandat8503

get_user_profile

Retrieve detailed Reddit user profile information, including karma, account age, gold status, moderator status, and profile link, by providing the username without the 'u/' prefix.

Instructions

👤 Get Reddit user profile information 🎯 What it does: Fetches detailed profile info for any Reddit user 📝 Required: username (Reddit username without u/ prefix) 💡 Examples: • Get profile: {"username": "spez"} • Check user: {"username": "AwkwardTension4482"} • View profile: {"username": "gallowboob"} 🔍 Output: User info with karma, account age, gold status, moderator status, and profile link

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesReddit username to get profile information

Implementation Reference

  • MCP tool handler for get_user_profile: extracts username from params, calls redditAPI.getUserProfile, handles errors, formats user data with formatUserProfile, and returns standardized MCP success response.
    createToolHandler(async (params: z.infer<typeof SimpleUserProfileSchema>) => {
        const { username } = params;
        
        const result = await redditAPI.getUserProfile(username);
    
        if (!result.success) {
          return createErrorResponse("Error getting user profile", result.error);
        }
    
        const data = result.data;
        if (!data || !data.data) {
          return createErrorResponse("User profile not found");
        }
    
        const user = data.data;
        const userInfo = formatUserProfile(user);
        
        return createSuccessResponse(userInfo);
    })
  • src/index.ts:527-557 (registration)
    Registers the get_user_profile tool with the MCP server, providing name, description, input schema (SimpleUserProfileSchema), and handler function.
    server.tool(
      "get_user_profile",
      "👤 Get Reddit user profile information\n" +
      "🎯 What it does: Fetches detailed profile info for any Reddit user\n" +
      "📝 Required: username (Reddit username without u/ prefix)\n" +
      "💡 Examples:\n" +
      "   • Get profile: {\"username\": \"spez\"}\n" +
      "   • Check user: {\"username\": \"AwkwardTension4482\"}\n" +
      "   • View profile: {\"username\": \"gallowboob\"}\n" +
      "🔍 Output: User info with karma, account age, gold status, moderator status, and profile link",
      SimpleUserProfileSchema.shape,
      createToolHandler(async (params: z.infer<typeof SimpleUserProfileSchema>) => {
          const { username } = params;
          
          const result = await redditAPI.getUserProfile(username);
    
          if (!result.success) {
            return createErrorResponse("Error getting user profile", result.error);
          }
    
          const data = result.data;
          if (!data || !data.data) {
            return createErrorResponse("User profile not found");
          }
    
          const user = data.data;
          const userInfo = formatUserProfile(user);
          
          return createSuccessResponse(userInfo);
      })
    );
  • Zod schema for input validation of get_user_profile tool: requires 'username' string parameter.
    export const SimpleUserProfileSchema = z.object({
      username: z.string().describe("Reddit username to get profile information")
    });
  • Helper method in RedditAPIService that makes the actual API request to fetch user profile data from Reddit's /user/{username}/about.json endpoint.
    async getUserProfile(username: string): Promise<ApiCallResult> {
      return this.makeRequest<{ data: RedditUser }>(
        `/user/${username}/about.json`,
      );
    }
  • Helper function to format RedditUser data into a human-readable markdown string with emojis, used in the tool handler.
    function formatUserProfile(user: RedditUser): string {
      const name = user.name || 'Unknown';
      const linkKarma = user.link_karma || 0;
      const commentKarma = user.comment_karma || 0;
      const createdDate = user.created_utc ? new Date(user.created_utc * 1000).toLocaleDateString() : 'Unknown';
      const isGold = user.is_gold || false;
      const isMod = user.is_mod || false;
      const hasVerifiedEmail = user.has_verified_email || false;
      
      let result = `👤 **u/${name}**\n`;
      result += `📊 Link Karma: ${linkKarma.toLocaleString()}\n`;
      result += `💬 Comment Karma: ${commentKarma.toLocaleString()}\n`;
      result += `📅 Created: ${createdDate}\n`;
      result += `🥇 Gold: ${isGold ? 'Yes' : 'No'}\n`;
      result += `🛡️ Moderator: ${isMod ? 'Yes' : 'No'}\n`;
      result += `✅ Verified Email: ${hasVerifiedEmail ? 'Yes' : 'No'}\n`;
      result += `🔗 Profile: https://reddit.com/user/${name}\n`;
      
      return result;
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing what information is returned (karma, account age, gold status, moderator status, profile link). It also clarifies the username format requirement ('without u/ prefix'), which is valuable behavioral context not in the schema. It doesn't mention rate limits or authentication needs, but provides solid operational transparency.

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 efficiently structured with emoji-labeled sections, each sentence earns its place. It's front-loaded with the core purpose, then provides requirements, examples, and output details without redundancy. The information density is high with zero wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read operation with no annotations and no output schema, the description does an excellent job covering what the tool does, parameter requirements, examples, and expected output format. The only minor gap is the lack of explicit guidance on when to use versus sibling tools, but otherwise it's quite complete for this complexity level.

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

Parameters4/5

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

With 100% schema description coverage for the single parameter, the baseline would be 3. However, the description adds significant value by clarifying the username format ('without u/ prefix') and providing multiple concrete examples of valid usernames, which goes beyond what the schema provides about parameter semantics.

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 explicitly states 'Fetches detailed profile info for any Reddit user' with a clear verb ('Fetches') and resource ('profile info for any Reddit user'). It distinguishes from sibling tools like get_subreddit_info by focusing specifically on user profiles rather than subreddits or posts.

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 provides implied usage through examples and the 'Required' section, showing this is for fetching user profiles. However, it doesn't explicitly state when to use this tool versus alternatives (like search_reddit for finding users) or provide exclusion criteria for when not to use it.

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

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