record_answers_and_choose_path
Store user responses to soul-searching questions and select their personalized reincarnation story path in an interactive narrative experience.
Instructions
Record user's answers and choose their reincarnation path
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes | ||
| answers | Yes | ||
| path_choice | Yes |
Implementation Reference
- main.py:228-266 (handler)This is the main handler function for the 'record_answers_and_choose_path' tool. It is decorated with @mcp.tool(), which registers it in the FastMCP server. The function records the user's three answers into the story state, maps the path_choice (1-3) to a path ('revenge', 'bilbo', or 'luffy'), updates the state, and returns a narrative confirmation message.@mcp.tool() def record_answers_and_choose_path(user_id: str, answers: List[str], path_choice: int) -> str: """Record user's answers and choose their reincarnation path""" state = get_user_state(user_id) if not state["story_started"]: return "Please start the story first by typing 'Arise'." if len(answers) != 3: return "Please provide exactly three answers, one for each question." # Record answers state["user_answers"] = { "betrayal_wound": answers[0], "adventure_desire": answers[1], "freedom_calling": answers[2] } # Choose path paths = {1: "revenge", 2: "bilbo", 3: "luffy"} if path_choice not in paths: return "Invalid path choice. Please choose 1, 2, or 3." state["current_path"] = paths[path_choice] state["story_step"] = 0 state["current_context"] = f"Beginning {state['current_path']} path after reincarnation" return f""" Your answers have been recorded and your path chosen. **Path Selected:** {paths[path_choice].title()} The entity now understands your soul's true desires and will transport you to your new life. "I see... your soul cries out for {['vengeance', 'adventure', 'freedom'][path_choice-1]}. Very well. Prepare yourself for rebirth into the {paths[path_choice]} path." The world dissolves around you as the reincarnation process begins... """