Skip to main content
Glama
alicenjr

Dynamic Reincarnation Story

by alicenjr

generate_path_introduction

Generate narrative introductions for reincarnation paths in interactive storytelling, setting the stage for personalized adventures based on user choices.

Instructions

Generate the introduction narrative for the chosen path

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:268-295 (handler)
    The handler function for the generate_path_introduction tool. It retrieves the user state, checks prerequisites, generates a prompt using path_introduction_prompt, updates the state, and returns a formatted response with the prompt for AI generation.
    def generate_path_introduction(user_id: str) -> str:
        """Generate the introduction narrative for the chosen path"""
        state = get_user_state(user_id)
        
        if not state["story_started"]:
            return "Please start the story first by typing 'Arise'."
        
        if not state["current_path"]:
            return "Please choose a reincarnation path first."
        
        # This prompt will be used by the AI to generate the introduction
        intro_prompt = str(path_introduction_prompt(
            state["current_path"], 
            state["user_answers"]
        ))
        
        state["current_context"] = f"Beginning of {state['current_path']} journey"
        state["story_step"] = 1
        
        return f"""
    INTRODUCTION PROMPT READY: {intro_prompt}
    
    The AI will now generate your personalized introduction to the {state['current_path']} path based on your answers to the guidance questions.
    
    After the introduction, you'll find yourself in your new life with three choices before you.
    """
    
    @mcp.tool()
  • Supporting prompt function that generates the detailed prompt template for the path introduction narrative, incorporating path info and user answers. Used within the handler.
    def path_introduction_prompt(path: str, user_answers: Dict[str, str]) -> str:
        """Generate an introduction narrative when a path is chosen"""
        path_info = {
            "revenge": {
                "name": "Path of Vengeance",
                "description": "Returning to the same world with new powers to take revenge"
            },
            "bilbo": {
                "name": "There and Back Again", 
                "description": "Becoming Bilbo Baggins in Middle-earth"
            },
            "luffy": {
                "name": "King of the Pirates",
                "description": "Becoming Monkey D. Luffy in the world of One Piece"
            }
        }
        
        return f"""
    Generate an introduction narrative for a reincarnation story.
    
    PATH: {path_info[path]['name']} - {path_info[path]['description']}
    USER'S ANSWERS TO GUIDANCE QUESTIONS: {json.dumps(user_answers, indent=2)}
    
    INSTRUCTIONS:
    1. Write a compelling introduction where the user is reborn into their chosen path
    2. Incorporate their answers to the three questions to personalize the narrative
    3. Set the scene authentically according to the source material
    4. End with the character in a situation that requires their first decision
    5. Write in third person narrative style
    6. Maximum 250 words
    
    INTRODUCTION NARRATIVE:
    """
  • main.py:268-268 (registration)
    The @mcp.tool() decorator registers this function as an MCP tool named 'generate_path_introduction'.
    def generate_path_introduction(user_id: str) -> str:
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the tool generates narrative, implying a read-only or creative operation, but does not specify if it requires authentication, has side effects, or details output format. The description adds minimal behavioral context beyond the basic action.

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

Conciseness4/5

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

The description is a single, efficient sentence with no wasted words. It is front-loaded with the core action, making it easy to parse. However, it could be more structured with additional context, but within its brevity, it earns high marks for conciseness.

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 handles return values), no annotations, and low complexity, the description is minimally adequate. It states the action but lacks details on prerequisites, parameter meaning, or behavioral traits. With output schema covering returns, the description meets a baseline but has clear gaps in context.

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?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'chosen path' but does not explain the 'user_id' parameter or its role. The description adds no meaning beyond what the schema provides, failing to clarify parameter semantics for the single required input.

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

Purpose3/5

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

The description states the tool's purpose: 'Generate the introduction narrative for the chosen path'. It specifies a verb ('Generate') and resource ('introduction narrative'), but lacks specificity about what a 'path' is or how it relates to siblings like 'record_answers_and_choose_path' or 'start_story'. The purpose is clear but vague in context.

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?

No guidance is provided on when to use this tool versus alternatives. It does not mention prerequisites (e.g., must a path be chosen first?), exclusions, or relationships with sibling tools like 'start_story' or 'record_answers_and_choose_path'. The description offers no usage context beyond the basic action.

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/alicenjr/Dynamic-Reincarnation-mcp'

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