create_quest
Design and structure new quests for Dungeons & Dragons campaigns. Define quest titles, descriptions, objectives, rewards, and NPC details to enhance storytelling and gameplay management.
Instructions
Create a new quest.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Quest description | |
| giver | No | Quest giver (NPC name) | |
| notes | No | Additional notes | |
| objectives | No | Quest objectives | |
| reward | No | Quest reward | |
| title | Yes | Quest title |
Implementation Reference
- src/gamemaster_mcp/main.py:498-517 (handler)The handler function for the 'create_quest' tool. It is registered via @mcp.tool decorator, defines the input schema via Annotated parameters, creates a Quest model instance, and delegates persistence to storage.add_quest().def create_quest( title: Annotated[str, Field(description="Quest title")], description: Annotated[str, Field(description="Quest description")], giver: Annotated[str | None, Field(description="Quest giver (NPC name)")] = None, objectives: Annotated[list[str] | None, Field(description="Quest objectives")] = None, reward: Annotated[str | None, Field(description="Quest reward")] = None, notes: Annotated[str, Field(description="Additional notes")] = "", ) -> str: """Create a new quest.""" quest = Quest( title=title, description=description, giver=giver, objectives=objectives or [], reward=reward, notes=notes ) storage.add_quest(quest) return f"Created quest '{quest.title}'"
- src/gamemaster_mcp/models.py:303-315 (schema)Pydantic BaseModel defining the Quest data structure used internally by the create_quest tool handler.class Quest(BaseModel): """Quest or mission.""" id: str = Field(default_factory=lambda: random(length=8)) title: str description: str giver: str | None = None # NPC who gave the quest status: str = "active" # active, completed, failed, on_hold objectives: list[str] = Field(default_factory=list) completed_objectives: list[str] = Field(default_factory=list) reward: str | None = None notes: str = "" created_at: datetime = Field(default_factory=datetime.now)
- Helper method in DnDStorage class that persists the Quest object to the current campaign's quests dictionary and triggers a save.def add_quest(self, quest: Quest) -> None: """Add a quest to the current campaign.""" if not self._current_campaign: raise ValueError("No current campaign") self._current_campaign.quests[quest.title] = quest self._current_campaign.updated_at = datetime.now() self._save_campaign()