fetch_batch_post_details
Retrieve details for multiple Reddit posts simultaneously to analyze WallStreetBets content for market insights.
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:311-340 (handler)The core handler function for the 'fetch_batch_post_details' tool, registered via @mcp.tool() decorator. It processes a batch of post IDs by sequentially fetching details for each using 'fetch_post_details', aggregates the results, and provides progress updates via the Context if available.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 }