Skip to main content
Glama
study-flamingo

D&D MCP Server

create_location

Generate new locations for Dungeons & Dragons campaigns by specifying name, type, description, population, government, and notable features.

Instructions

Create a new location.

Input Schema

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

Implementation Reference

  • The handler function for the 'create_location' tool. It is registered via the @mcp.tool decorator. Validates input using Annotated Fields, creates a Location model instance, persists it via storage.add_location, and returns a confirmation message.
    @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})"
  • Pydantic BaseModel defining the schema for Location objects created by the 'create_location' tool.
    class Location(BaseModel):
        """Geographic location or settlement."""
        id: str = Field(default_factory=lambda: random(length=8))
        name: str
        location_type: str  # city, town, village, dungeon, forest, etc.
        description: str
        population: int | None = None
        government: str | None = None
        notable_features: list[str] = Field(default_factory=list)
        npcs: list[str] = Field(default_factory=list)  # NPC names
        connections: list[str] = Field(default_factory=list)  # Connected locations
        notes: str = ""
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. 'Create a new location' implies a write/mutation operation, but it doesn't disclose behavioral traits such as permissions needed, whether it's idempotent, what happens on duplicate names, or the response format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence ('Create a new location.') that is front-loaded and wastes no words. It's appropriately sized for a basic tool, though it could be more informative without losing conciseness. Every word earns its place, but it's under-specified rather than concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a mutation tool with 7 parameters, no annotations, and no output schema), the description is incomplete. It doesn't explain what a 'location' is in this system, how it fits with other tools (e.g., 'create_campaign'), or what to expect after creation. For a tool that likely integrates into a game management workflow, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 7 parameters with clear descriptions (e.g., 'Location name', 'Type of location'). The description adds no additional meaning beyond what the schema provides, such as explaining relationships between parameters or usage examples. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Create a new location' clearly states the verb ('create') and resource ('location'), but it's vague about what a 'location' entails in this context (e.g., a geographic place, a game setting element). It doesn't distinguish from siblings like 'create_campaign' or 'create_quest', which also create resources in what appears to be a game management system.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing campaign), exclusions, or how it relates to siblings like 'list_locations' or 'get_location'. The description alone offers no usage context beyond the basic action.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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