reddit_get_user_posts
Retrieve a Reddit user's submitted posts with options to filter by category, time window, and limit results for analysis or monitoring.
Instructions
Get a Reddit user's submitted posts.
Args: username: Reddit username without u/ prefix (e.g., 'spez') limit: Maximum number of posts (default: 25, max: 100) category: Listing category (hot, top, new). Default: new time_filter: Time window for top listings (hour, day, week, month, year, all). Default: all
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | ||
| limit | No | ||
| category | No | ||
| time_filter | No |
Implementation Reference
- The handler function `reddit_get_user_posts` which executes the tool by calling the user service.
async def reddit_get_user_posts( username: str, ctx: Context, limit: int = 25, category: str | None = None, time_filter: str | None = None, ) -> list[dict[str, Any]]: try: results = await service.get_user_posts( username, limit=limit, category=category, time_filter=time_filter ) return McpSerializer.serialize_list(results) except Exception as e: McpErrorMapper.map(e, "reddit_get_user_posts") - Registration of the `reddit_get_user_posts` tool using the FastMCP decorator.
@mcp.tool( name="reddit_get_user_posts", description=( "Get a Reddit user's submitted posts.\n\n" "Args:\n" " username: Reddit username without u/ prefix " "(e.g., 'spez')\n" " limit: Maximum number of posts " "(default: 25, max: 100)\n" " category: Listing category (hot, top, new). " "Default: new\n" " time_filter: Time window for top listings " "(hour, day, week, month, year, all). Default: all" ),