Skip to main content
Glama
jkingsman

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

analyze_post

Analyze QAnon posts to extract detailed information, references, and contextual insights for research purposes.

Instructions

Get detailed analysis of a specific post/drop including references and context.

Args:
    post_id: The ID of the post to analyze

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
post_idYes

Implementation Reference

  • The handler function for the "analyze_post" tool. It provides a detailed analysis of a specific QAnon post including metadata, content, images, referenced posts, author context, and position in the timeline with adjacent posts.
    @mcp.tool()
    def analyze_post(post_id: int) -> str:
        """
        Get detailed analysis of a specific post/drop including references and context.
    
        Args:
            post_id: The ID of the post to analyze
        """
        post = get_post_by_id(post_id)
        if not post:
            return f"Post with ID {post_id} not found."
    
        metadata = post.get("post_metadata", {})
        author = metadata.get("author", "Unknown")
        author_id = metadata.get("author_id", "Unknown")
        timestamp = metadata.get("time", 0)
        date_str = (
            datetime.fromtimestamp(timestamp).strftime("%Y-%m-%d %H:%M:%S")
            if timestamp
            else "Unknown"
        )
    
        source = metadata.get("source", {})
        board = source.get("board", "Unknown")
        site = source.get("site", "Unknown")
        link = source.get("link", "Unknown")
    
        text = post.get("text", "")
        if text:
            text = text.replace("\\n", "\n")
    
        # Images analysis
        images = post.get("images", [])
        images_analysis = ""
        if images:
            images_analysis = f"\n\nImages ({len(images)}):\n"
            for i, img in enumerate(images, 1):
                images_analysis += f"{i}. File: {img.get('file', 'Unknown')}, Name: {img.get('name', 'Unknown')}\n"
    
        # Referenced posts analysis
        refs = post.get("referenced_posts", [])
        refs_analysis = ""
        if refs:
            refs_analysis = f"\n\nReferenced Posts ({len(refs)}):\n"
            for i, ref in enumerate(refs, 1):
                ref_text = ref.get("text", "No text")
                if ref_text:
                    ref_text = ref_text.replace("\\n", "\n")
                ref_author_id = ref.get("author_id", "Unknown")
                refs_analysis += f"{i}. Reference: {ref.get('reference', 'Unknown')}\n"
                refs_analysis += f"   Author ID: {ref_author_id}\n"
                refs_analysis += f"   Text: {ref_text}\n\n"
    
        # Find other posts by the same author
        same_author_posts = get_posts_by_author_id(author_id, limit=5)
    
        # Build the analysis
        analysis = f"""
    Detailed Analysis of Post/Drop {post_id}:
    
    Basic Information:
    -----------------
    Author: {author} (ID: {author_id})
    Date: {date_str}
    Source: {board} on {site}
    Original Link: {link}
    
    Post Content:
    ------------
    {text}
    {images_analysis}
    {refs_analysis}
    
    Context:
    -------
    This post is part of {len(posts)} total posts in the dataset.
    """
    
        # Add information about posts around this one
        post_position = None
        for i, p in enumerate(
            sorted(posts, key=lambda x: x.get("post_metadata", {}).get("id", 0))
        ):
            if p.get("post_metadata", {}).get("id") == post_id:
                post_position = i
                break
    
        if post_position is not None:
            analysis += f"\nThis is post #{post_position + 1} in chronological order.\n"
    
            # Previous post
            if post_position > 0:
                prev_post = posts[post_position - 1]
                prev_id = prev_post.get("post_metadata", {}).get("id", "Unknown")
                prev_date = datetime.fromtimestamp(
                    prev_post.get("post_metadata", {}).get("time", 0)
                ).strftime("%Y-%m-%d")
                analysis += f"\nPrevious post: #{prev_id} from {prev_date}\n"
    
            # Next post
            if post_position < len(posts) - 1:
                next_post = posts[post_position + 1]
                next_id = next_post.get("post_metadata", {}).get("id", "Unknown")
                next_date = datetime.fromtimestamp(
                    next_post.get("post_metadata", {}).get("time", 0)
                ).strftime("%Y-%m-%d")
                analysis += f"Next post: #{next_id} from {next_date}\n"
    
        return analysis

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