Skip to main content
Glama

create_location

Generate and define new locations for Dungeons & Dragons campaigns by specifying name, type, description, and other details to enhance game world-building.

Instructions

Create a new location.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYesLocation description
governmentNoGovernment type
location_typeYesType of location (city, town, village, dungeon, etc.)
nameYesLocation name
notable_featuresNoNotable features
notesNoAdditional notes
populationNoPopulation (if applicable)

Implementation Reference

  • The @mcp.tool decorator registers the create_location function as an MCP tool. The function implements the tool logic by creating a Location object from input parameters and adding it to storage via storage.add_location.
    @mcp.tool def create_location( name: Annotated[str, Field(description="Location name")], location_type: Annotated[str, Field(description="Type of location (city, town, village, dungeon, etc.)")], description: Annotated[str, Field(description="Location description")], population: Annotated[int | None, Field(description="Population (if applicable)", ge=0)] = None, government: Annotated[str | None, Field(description="Government type")] = None, notable_features: Annotated[list[str] | None, Field(description="Notable features")] = None, notes: Annotated[str, Field(description="Additional notes")] = "", ) -> str: """Create a new location.""" location = Location( name=name, location_type=location_type, description=description, population=population, government=government, notable_features=notable_features or [], notes=notes ) storage.add_location(location) return f"Created location '{location.name}' ({location.location_type})"
  • Input schema defined via Annotated parameters with Pydantic Field descriptions and constraints.
    name: Annotated[str, Field(description="Location name")], location_type: Annotated[str, Field(description="Type of location (city, town, village, dungeon, etc.)")], description: Annotated[str, Field(description="Location description")], population: Annotated[int | None, Field(description="Population (if applicable)", ge=0)] = None, government: Annotated[str | None, Field(description="Government type")] = None, notable_features: Annotated[list[str] | None, Field(description="Notable features")] = None, notes: Annotated[str, Field(description="Additional notes")] = "", ) -> str:
  • The tool is registered using the @mcp.tool decorator from FastMCP.
    @mcp.tool

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