Skip to main content
Glama

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
NameRequiredDescriptionDefault
nameYesLocation name

Implementation Reference

  • 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
  • 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)

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/study-flamingo/gamemaster-mcp'

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