fetch_batch_post_details
Retrieve detailed information for multiple Reddit posts by specifying their IDs. Designed for analyzing WallStreetBets content to support market insights and decision-making.
Instructions
Fetch details for multiple posts efficiently.
Args:
post_ids: List of Reddit post IDs
Returns:
Dictionary with details for all requested posts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_ids | Yes |
Implementation Reference
- server.py:310-340 (handler)The handler function for the 'fetch_batch_post_details' tool. It iterates over a list of post IDs, fetches details for each using 'fetch_post_details', reports progress if a context is provided, and returns a dictionary with the results.@mcp.tool() async def fetch_batch_post_details(post_ids: list[str], ctx: Context = None) -> dict: """ Fetch details for multiple posts efficiently. Args: post_ids: List of Reddit post IDs Returns: Dictionary with details for all requested posts """ if not post_ids: return {"error": "No post IDs provided"} results = {} total = len(post_ids) for i, post_id in enumerate(post_ids): if ctx: await ctx.report_progress(i, total) detail = await fetch_post_details(post_id) results[post_id] = detail if ctx: await ctx.report_progress(total, total) return { "count": len(results), "posts": results }