Skip to main content
Glama
study-flamingo

D&D MCP Server

list_locations

Retrieve all campaign locations to manage your D&D world, track settings, and organize adventure sites.

Instructions

List all locations in the current campaign.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler function that lists all locations in the current campaign by retrieving the list from storage and formatting it nicely for display.
    @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)
  • Helper method in DnDStorage class that returns the names of all locations in 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