Skip to main content
Glama
frap129

LoreKeeper MCP

search_character_option

Search for D&D 5e classes, races, backgrounds, and feats. Use natural language queries or filter by source document to find character creation options.

Instructions

Retrieve D&D 5e character creation and advancement options.

This tool provides access to classes, races, backgrounds, and feats for character creation and level-up decisions. Each option type provides different information relevant to character building. Results are cached for faster repeated lookups through the repository pattern.

The repository pattern handles caching transparently:

  • First call: Fetches from API and caches in database

  • Subsequent calls: Returns cached results if available

  • Supports test context-based repository injection via _repository_context

Examples: Default usage (automatic repository creation): classes = await search_character_option(type="class") elves = await search_character_option(type="race", search="elf") backgrounds = await search_character_option(type="background", search="soldier") feats = await search_character_option(type="feat", search="great")

With test context injection (testing):
    from lorekeeper_mcp.tools.search_character_option import _repository_context
    custom_repo = CharacterOptionRepository(cache=my_cache)
    _repository_context["repository"] = custom_repo
    classes = await search_character_option(type="class")

Semantic search (natural language queries):
    warriors = await search_character_option(
        type="class", search="martial combat warrior"
    )
    sneaky_classes = await search_character_option(
        type="class", search="stealthy shadow assassin"
    )
    magical_races = await search_character_option(
        type="race", search="innate magical abilities"
    )

Hybrid search (search + filters):
    srd_fighters = await search_character_option(
        type="class", search="melee fighter", documents=["srd-5e"]
    )

Args: type: REQUIRED. Character option type. Must be one of: - "class": Player classes (Barbarian, Bard, Cleric, Druid, Fighter, Monk, Paladin, Ranger, Rogue, Sorcerer, Warlock, Wizard) - "race": Playable races (Human, Elf, Dwarf, Halfling, Dragonborn, Gnome, Half-Orc, Half-Elf, Tiefling, etc.) - "background": Character backgrounds (Acolyte, Criminal, Entertainer, Soldier, Folk Hero, Sage, etc.) - "feat": Character feats (Ability Score Improvement, Great Weapon Master, Magic Initiate, etc.) - typically chosen at levels 4, 8, 12, 16, 19 documents: Filter to specific source documents. Provide a list of document names/identifiers from list_documents() tool. Examples: ["srd-5e"] for SRD only, ["srd-5e", "tce"] for SRD and Tasha's. Use list_documents() to see available documents. search: Natural language search query for semantic/vector search. When provided, uses vector similarity to find character options matching the conceptual meaning rather than exact text matches. Can be combined with other filters for hybrid search. Examples: "martial combat warrior", "stealthy rogue", "divine magic healer" limit: Maximum number of results to return. Default 20, useful for limiting output or pagination. Examples: 1, 5, 50

Returns: List of option dictionaries. Structure varies by type:

For type="class":
    - name: Class name
    - hit_dice: Hit die value (1d8, 1d10, 1d12)
    - class_levels: Progression table
    - spellcasting: Spell slots if applicable
    - features: Class features by level

For type="race":
    - name: Race name
    - ability_score_increase: Ability score bonuses
    - age: Aging information
    - alignment: Typical alignments
    - size: Size category
    - speed: Movement speed
    - languages: Known languages
    - traits: Racial traits and special abilities

For type="background":
    - name: Background name
    - skill_proficiencies: Skill choices
    - tool_proficiencies: Tools (if any)
    - feature: Special background feature
    - personality_traits: Suggested personality options
    - ideals: Suggested ideals
    - bonds: Suggested character bonds
    - flaws: Suggested character flaws

For type="feat":
    - name: Feat name
    - description: Feat benefits and requirements
    - ability_score_increase: Ability bonuses (if any)
    - prerequisites: Requirements to take feat

Raises: ValueError: If type parameter is not one of the valid options ApiError: If the API request fails due to network issues or server errors

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYes
limitNo
searchNo
documentsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/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. It thoroughly discloses caching behavior ('Results are cached... repository pattern'), explains the first-call vs. subsequent-call semantics, and details the _repository_context injection for testing. It also lists error conditions (ValueError, ApiError), making the tool's behavior highly transparent.

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 quite long, but it is well-structured with clear sections: opening summary, caching note, examples, Args, Returns, and Raises. Each section adds value, though some parts (e.g., exhaustive list of class names) could be shortened without losing essential information.

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

Completeness5/5

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

The tool is complex with 4 parameters and variable return structures by type. The description provides comprehensive coverage: per-type return structures, error handling, examples for all parameter combinations, and a pointer to list_documents(). Despite having an output schema, the description still adds crucial context and makes the tool fully self-contained.

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

Parameters5/5

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

With 0% schema coverage, the Args section is essential and excellently detailed: type explains each enum value with examples and class lists, documents references list_documents() and gives examples, search explains semantic/vector search, and limit explains its default and use. This fully compensates for the lack of schema-level descriptions.

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

Purpose5/5

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

The description opens with 'Retrieve D&D 5e character creation and advancement options' and explicitly lists classes, races, backgrounds, and feats. This clearly distinguishes it from sibling search tools like search_spell or search_creature by focusing specifically on character options.

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

Usage Guidelines4/5

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

The description explains typical use cases ('character creation and level-up decisions') and provides detailed examples for default, semantic, and hybrid search. It references list_documents() for filtering, but does not explicitly state when not to use this tool or mention alternative tools like search_spell, so while clear, it lacks explicit exclusions.

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/frap129/lorekeeper-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server