Skip to main content
Glama
d4nshields

Bibliomantic MCP Server

bibliomantic_consultation

Consult the I Ching for guidance using traditional Chinese philosophy and bibliomantic methods to answer queries with AI-enhanced interpretations.

Instructions

Enhanced bibliomantic consultation with full traditional I Ching elements. DRAMATICALLY IMPROVED CONTENT while maintaining exact interface compatibility.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Primary handler function for the 'bibliomantic_consultation' MCP tool. Decorated with @mcp.tool() for automatic registration. Performs I Ching divination via BiblioManticDiviner and formats the response.
    @mcp.tool()
    def bibliomantic_consultation(query: str) -> str:
        """
        Perform bibliomantic consultation following Philip K. Dick's approach.
        
        Augments your query with I Ching wisdom, creating a bridge between
        your specific question and ancient guidance, as described in 
        "The Man in the High Castle".
        
        Args:
            query: The question or situation requiring guidance
            
        Returns:
            Complete bibliomantic consultation with hexagram wisdom
        """
        logger.info(f"Performing bibliomantic consultation for query: {query[:50]}...")
        
        if not query.strip():
            return "Please provide a question for bibliomantic consultation."
        
        # Perform divination and augment query
        augmented_query, divination_info = diviner.divine_query_augmentation(query)
        
        if "error" in divination_info:
            error_msg = f"Consultation failed: {divination_info['error']}"
            logger.error(error_msg)
            return error_msg
        
        response = f"""🔮 **Bibliomantic Consultation**
    
    **Your Question:** {query}
    
    **Oracle's Guidance - Hexagram {divination_info['hexagram_number']}: {divination_info['hexagram_name']}**
    
    {divination_info['interpretation']}
    
    **Bibliomantic Integration:**
    The I Ching suggests considering this wisdom in the context of your question. This ancient guidance offers perspective on the energies and patterns surrounding your situation.
    
    **Method:** Traditional three-coin divination
    **Approach:** Philip K. Dick's bibliomantic method from "The Man in the High Castle"
    **Randomness:** Cryptographically secure generation
    
    *This consultation bridges your modern question with timeless wisdom, allowing the oracle to speak to your specific circumstances.*"""
        
        logger.info(f"Completed bibliomantic consultation with hexagram {divination_info['hexagram_number']}")
        return response
  • The @mcp.tool() decorator registers this function as an MCP tool named 'bibliomantic_consultation'.
    @mcp.tool()
    def bibliomantic_consultation(query: str) -> str:
        """
        Perform bibliomantic consultation following Philip K. Dick's approach.
        
        Augments your query with I Ching wisdom, creating a bridge between
        your specific question and ancient guidance, as described in 
        "The Man in the High Castle".
        
        Args:
            query: The question or situation requiring guidance
            
        Returns:
            Complete bibliomantic consultation with hexagram wisdom
        """
        logger.info(f"Performing bibliomantic consultation for query: {query[:50]}...")
        
        if not query.strip():
            return "Please provide a question for bibliomantic consultation."
        
        # Perform divination and augment query
        augmented_query, divination_info = diviner.divine_query_augmentation(query)
        
        if "error" in divination_info:
            error_msg = f"Consultation failed: {divination_info['error']}"
            logger.error(error_msg)
            return error_msg
        
        response = f"""🔮 **Bibliomantic Consultation**
    
    **Your Question:** {query}
    
    **Oracle's Guidance - Hexagram {divination_info['hexagram_number']}: {divination_info['hexagram_name']}**
    
    {divination_info['interpretation']}
    
    **Bibliomantic Integration:**
    The I Ching suggests considering this wisdom in the context of your question. This ancient guidance offers perspective on the energies and patterns surrounding your situation.
    
    **Method:** Traditional three-coin divination
    **Approach:** Philip K. Dick's bibliomantic method from "The Man in the High Castle"
    **Randomness:** Cryptographically secure generation
    
    *This consultation bridges your modern question with timeless wisdom, allowing the oracle to speak to your specific circumstances.*"""
        
        logger.info(f"Completed bibliomantic consultation with hexagram {divination_info['hexagram_number']}")
        return response
  • Key helper method in BiblioManticDiviner class that generates the I Ching hexagram, formats wisdom, augments the query, and provides metadata. Called by the tool handler.
    def divine_query_augmentation(self, original_query: str) -> Tuple[str, dict]:
        """
        Augment a user query with bibliomantic I Ching wisdom.
        
        This method performs the core bibliomantic operation:
        1. Generate random hexagram through coin divination
        2. Extract wisdom text from the hexagram
        3. Integrate this wisdom with the original query
        4. Return augmented query with divination metadata
        
        Args:
            original_query: The user's original question or request
            
        Returns:
            Tuple containing:
            - augmented_query: Original query prefaced with I Ching wisdom
            - divination_info: Metadata about the divination performed
        """
        try:
            # Perform I Ching divination
            hexagram_number, hexagram_name, interpretation = self.iching.generate_hexagram_by_coins()
            
            # Create divination metadata for transparency
            divination_info = {
                "hexagram_number": hexagram_number,
                "hexagram_name": hexagram_name,
                "interpretation": interpretation,
                "method": "three_coin_traditional",
                "bibliomantic_approach": "dick_high_castle"
            }
            
            # Format the I Ching wisdom for integration
            wisdom_text = self.iching.format_divination_text(
                hexagram_number, hexagram_name, interpretation
            )
            
            # Augment the original query with bibliomantic wisdom
            augmented_query = self._integrate_wisdom_with_query(wisdom_text, original_query)
            
            logger.info(f"Divination performed: Hexagram {hexagram_number} - {hexagram_name}")
            
            return augmented_query, divination_info
            
        except Exception as e:
            logger.error(f"Divination failed: {str(e)}")
            # Graceful degradation: return original query if divination fails
            return original_query, {"error": str(e), "fallback": True}
  • Ethical variant of the bibliomantic_consultation handler with added disclaimers.
    @mcp.tool()
    def bibliomantic_consultation(query: str) -> str:
        """
        Perform bibliomantic consultation following Philip K. Dick's approach.
        
        Augments your query with I Ching wisdom, creating a bridge between
        your specific question and ancient guidance, as described in 
        "The Man in the High Castle".
        
        Args:
            query: The question or situation requiring guidance
            
        Returns:
            Complete bibliomantic consultation with hexagram wisdom and ethical context
        """
        logger.info(f"Performing bibliomantic consultation with ethical safeguards")
        
        if not query.strip():
            return f"Please provide a question for bibliomantic consultation.\n\n{BRIEF_DISCLAIMER}"
        
        # Perform divination and augment query
        augmented_query, divination_info = diviner.divine_query_augmentation(query)
        
        if "error" in divination_info:
            error_msg = f"Consultation failed: {divination_info['error']}"
            logger.error(error_msg)
            return f"{error_msg}\n\n{BRIEF_DISCLAIMER}"
        
        response = f"""🔮 **Bibliomantic Consultation**
    
    **Your Question:** {query}
    
    **Oracle's Guidance - Hexagram {divination_info['hexagram_number']}: {divination_info['hexagram_name']}**
    
    {divination_info['interpretation']}
    
    **Bibliomantic Context:**
    This consultation follows the approach described in Philip K. Dick's "The Man in the High Castle," where characters use the I Ching for reflection on complex decisions. The randomness is generated cryptographically, and any wisdom emerges from your own contemplation of the patterns and meanings.
    
    **How to Use This Guidance:**
    Consider how this ancient perspective might offer new ways of thinking about your situation. The value lies not in prediction, but in the fresh viewpoints that can emerge from engaging with different frameworks of understanding.
    
    {ETHICAL_DISCLAIMER}"""
        
        logger.info(f"Completed bibliomantic consultation with hexagram {divination_info['hexagram_number']} and ethical context")
        return response
  • Enhanced variant of the handler with richer I Ching content and backward compatibility.
    @mcp.tool()
    def bibliomantic_consultation(query: str) -> str:
        """
        Enhanced bibliomantic consultation with full traditional I Ching elements.
        DRAMATICALLY IMPROVED CONTENT while maintaining exact interface compatibility.
        """
        logger.info("Performing enhanced bibliomantic consultation")
        
        if not query.strip():
            return f"Please provide a question for bibliomantic consultation.\n\n{BRIEF_DISCLAIMER}"
        
        # Use enhanced consultation if available
        if ENHANCED_MODE and hasattr(diviner, 'perform_enhanced_consultation'):
            try:
                enhanced_result = diviner.perform_enhanced_consultation(query)
                
                # Add bibliomantic context and disclaimer
                enhanced_result += f"\n\n**How to Use This Guidance:**\n"
                enhanced_result += "Consider how this ancient perspective might offer new ways of thinking about your situation. "
                enhanced_result += "The value lies not in prediction, but in the fresh viewpoints that can emerge from engaging "
                enhanced_result += "with different frameworks of understanding.\n\n"
                enhanced_result += ETHICAL_DISCLAIMER
                
                logger.info("Completed enhanced bibliomantic consultation")
                return enhanced_result
                
            except Exception as e:
                logger.error(f"Enhanced consultation failed, falling back: {str(e)}")
        
        # Fallback to original method (backward compatibility)
        augmented_query, divination_info = diviner.divine_query_augmentation(query)
        
        if "error" in divination_info:
            error_msg = f"Consultation failed: {divination_info['error']}"
            logger.error(error_msg)
            return f"{error_msg}\n\n{BRIEF_DISCLAIMER}"
        
        response = f"""🔮 **Bibliomantic Consultation**
    
    **Your Question:** {query}
    
    **Oracle's Guidance - Hexagram {divination_info['hexagram_number']}: {divination_info['hexagram_name']}**
    
    {divination_info['interpretation']}
    
    **Bibliomantic Context:**
    This consultation follows the approach described in Philip K. Dick's "The Man in the High Castle," where characters use the I Ching for reflection on complex decisions. The randomness is generated cryptographically, and any wisdom emerges from your own contemplation of the patterns and meanings.
    
    **How to Use This Guidance:**
    Consider how this ancient perspective might offer new ways of thinking about your situation. The value lies not in prediction, but in the fresh viewpoints that can emerge from engaging with different frameworks of understanding.
    
    {ETHICAL_DISCLAIMER}"""
        
        logger.info(f"Completed bibliomantic consultation with hexagram {divination_info['hexagram_number']}")
        return response
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'enhanced content' and 'maintaining exact interface compatibility' which gives some implementation context, but doesn't describe what the tool actually does behaviorally - whether it performs calculations, returns interpretations, requires authentication, has rate limits, or what 'consultation' entails. The description is too vague about the actual operation and output.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief (two sentences) and doesn't waste words, but it's not effectively structured. The first sentence is somewhat informative while the second is technical implementation detail that doesn't help an AI agent understand when or how to use the tool. While concise, it's not optimally front-loaded with the most important information for tool selection.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which reduces the need to describe return values) and only one parameter, the description is somewhat complete but inadequate. It mentions 'enhanced' and 'traditional I Ching elements' which provides some context, but doesn't explain what makes it different from i_ching_divination or what 'consultation' means. For a single-parameter tool with output schema, more could be done to explain the tool's unique value and use cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 1 parameter (query) with 0% description coverage in the schema itself. The tool description provides no information about what the 'query' parameter should contain, its format, or examples of valid inputs. For a single parameter tool with zero schema documentation, the description should compensate by explaining the parameter's purpose and expected content, which it fails to do.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Enhanced bibliomantic consultation with full traditional I Ching elements' which provides some purpose context, but it's vague about what the tool actually does. It doesn't specify the action (consult? analyze? interpret?) or what resource it operates on. The second sentence about 'maintaining exact interface compatibility' is technical rather than functional. This is better than a tautology but lacks the specific verb+resource clarity needed for high scores.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There are no explicit guidelines about when to use this tool versus the sibling tools (get_hexagram_details, i_ching_divination, server_statistics). The description mentions 'enhanced' and 'full traditional I Ching elements' which might imply this is a more comprehensive option than i_ching_divination, but this is only implied rather than stated. No explicit when/when-not guidance or alternative recommendations are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/d4nshields/bibliomantic-mcp-server'

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