Skip to main content
Glama
study-flamingo

D&D MCP Server

list_npcs

Retrieve all non-player characters in your current D&D campaign to manage NPCs and track campaign details.

Instructions

List all NPCs in the current campaign.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler for the 'list_npcs' MCP tool. Decorated with @mcp.tool for automatic registration in FastMCP. Retrieves NPC list from storage, enriches with location info, and returns a formatted markdown list.
    @mcp.tool
    def list_npcs() -> str:
        """List all NPCs in the current campaign."""
        npcs = storage.list_npcs()
        if not npcs:
            return "No NPCs in the current campaign."
    
        npc_list = []
        for npc_name in npcs:
            npc = storage.get_npc(npc_name)
            if npc:
                location = f" ({npc.location})" if npc.location else ""
                npc_list.append(f"• {npc.name}{location}")
    
        return "**NPCs:**\n" + "\n".join(npc_list)
  • Helper method in DnDStorage class that returns the keys (names) of NPCs in the current campaign's npcs dictionary.
    def list_npcs(self) -> list[str]:
        """List all NPC names."""
        if not self._current_campaign:
            return []
        return list(self._current_campaign.npcs.keys())
  • The @mcp.tool decorator registers the list_npcs function as an MCP tool in the FastMCP server.
    @mcp.tool
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 of behavioral disclosure. It states the action but lacks details on permissions, rate limits, pagination, return format, or whether it's read-only (implied by 'List' but not explicit). For a 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.

Conciseness5/5

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

The description is a single, clear sentence with no wasted words. It's front-loaded with the core purpose and appropriately sized for a simple list operation, making it highly efficient and easy to parse.

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

Completeness3/5

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

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks context on behavioral traits, output format, or usage guidelines. With no output schema, the agent doesn't know what data is returned, which is a notable gap for a list operation.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, and it appropriately doesn't mention any. A baseline of 4 is applied since no parameters exist, and the description doesn't introduce confusion.

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

Purpose4/5

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

The description clearly states the verb ('List') and resource ('all NPCs in the current campaign'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_npc' (which likely retrieves a single NPC) or 'list_characters' (which might list player characters), so it falls short of a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a loaded campaign), exclusions, or comparisons to similar tools like 'get_npc' or 'list_characters', leaving the agent to infer usage context.

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