Skip to main content
Glama

list_locations

Retrieve and display all campaign locations within the D&D MCP Server to streamline campaign management and enhance session planning.

Instructions

List all locations in the current campaign.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'list_locations', decorated with @mcp.tool (serving as registration). Retrieves and formats the list of locations from storage.
    @mcp.tool def list_locations() -> str: """List all locations in the current campaign.""" locations = storage.list_locations() if not locations: return "No locations in the current campaign." loc_list = [] for loc_name in locations: loc = storage.get_location(loc_name) if loc: loc_list.append(f"• {loc.name} ({loc.location_type})") return "**Locations:**\n" + "\n".join(loc_list)
  • Core helper method in the Storage class that lists all location names from the current campaign.
    def list_locations(self) -> list[str]: """List all location names.""" if not self._current_campaign: return [] return list(self._current_campaign.locations.keys())

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