get_location
Retrieve detailed location information for Dungeons & Dragons campaigns by providing the location name. Part of the D&D MCP Server for managing game elements like NPCs, quests, and encounters.
Instructions
Get location information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Location name |
Implementation Reference
- src/gamemaster_mcp/main.py:457-479 (handler)MCP tool handler for 'get_location': Retrieves and formats location information from storage.@mcp.tool def get_location( name: Annotated[str, Field(description="Location name")] ) -> str: """Get location information.""" location = storage.get_location(name) if not location: return f"Location '{name}' not found." loc_info = f"""**{location.name}** ({location.location_type}) **Description:** {location.description} **Population:** {location.population or 'Unknown'} **Government:** {location.government or 'Unknown'} **Notable Features:** {chr(10).join(['• ' + feature for feature in location.notable_features]) if location.notable_features else 'None listed'} **Notes:** {location.notes or 'No additional notes.'} """ return loc_info
- src/gamemaster_mcp/main.py:459-459 (schema)Input schema for the get_location tool parameter.name: Annotated[str, Field(description="Location name")]
- Helper method in Storage class that fetches Location by name.def get_location(self, name: str) -> Location | None: """Get a location by name.""" if not self._current_campaign: return None return self._current_campaign.locations.get(name)