Skip to main content
Glama
jkingsman

https://github.com/jkingsman/qanon-mcp-server

get_timeline_summary

Summarizes QAnon posts within specified date ranges for research and analysis purposes.

Instructions

Get a timeline summary of posts/drops, optionally within a date range. Args: start_date: Optional start date in YYYY-MM-DD format end_date: Optional end date in YYYY-MM-DD format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateNo
end_dateNo

Implementation Reference

  • The primary handler for the 'get_timeline_summary' MCP tool. This function generates a chronological timeline summary of QAnon posts, grouped by month, with optional date range filtering. It uses the global 'posts' dataset, sorts by timestamp, groups into months, and samples key posts for summary display.
    @mcp.tool() def get_timeline_summary(start_date: str = None, end_date: str = None) -> str: """ Get a timeline summary of posts/drops, optionally within a date range. Args: start_date: Optional start date in YYYY-MM-DD format end_date: Optional end date in YYYY-MM-DD format """ # Use all posts if no dates provided timeline_posts = posts # Filter by date range if provided if start_date and end_date: try: datetime.strptime(start_date, "%Y-%m-%d") datetime.strptime(end_date, "%Y-%m-%d") timeline_posts = get_posts_by_date_range(start_date, end_date) except ValueError: return "Invalid date format. Please use YYYY-MM-DD format." # Sort posts by time timeline_posts = sorted( timeline_posts, key=lambda x: x.get("post_metadata", {}).get("time", 0) ) if not timeline_posts: return "No posts found for the specified date range." # Group posts by month months = {} for post in timeline_posts: timestamp = post.get("post_metadata", {}).get("time", 0) if timestamp: month_key = datetime.fromtimestamp(timestamp).strftime("%Y-%m") if month_key not in months: months[month_key] = [] months[month_key].append(post) # Build the timeline timeline = "QAnon Posts Timeline:\n\n" for month_key in sorted(months.keys()): month_name = datetime.strptime(month_key, "%Y-%m").strftime("%B %Y") month_posts = months[month_key] timeline += f"## {month_name} ({len(month_posts)} posts)\n\n" # Get the first and last 2 posts of the month as examples sample_posts = [] if len(month_posts) <= 4: sample_posts = month_posts else: sample_posts = month_posts[:2] + month_posts[-2:] for post in sample_posts: post_id = post.get("post_metadata", {}).get("id", "Unknown") timestamp = post.get("post_metadata", {}).get("time", 0) day = datetime.fromtimestamp(timestamp).strftime("%d %b") text = post.get("text", "") if text: text = text.replace("\\n", " ") # Truncate text if too long if len(text) > 100: text = text[:97] + "..." timeline += f"- {day}: Post #{post_id} - {text}\n" if len(month_posts) > 4: timeline += f" ... and {len(month_posts) - 4} more posts this month\n" timeline += "\n" return timeline
  • Helper function called by get_timeline_summary to filter the posts list by a given date range, converting dates to timestamps for comparison with post metadata times.
    def get_posts_by_date_range(start_date: str, end_date: str) -> List[Dict]: """Get posts within a date range (YYYY-MM-DD format).""" try: start_timestamp = int(datetime.strptime(start_date, "%Y-%m-%d").timestamp()) end_timestamp = ( int(datetime.strptime(end_date, "%Y-%m-%d").timestamp()) + 86400 ) # Add a day in seconds results = [] for post in posts: post_time = post.get("post_metadata", {}).get("time", 0) if start_timestamp <= post_time <= end_timestamp: results.append(post) return results except ValueError: return []

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/jkingsman/qanon-mcp-server'

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