pf2e-mcp
v0.4.0MCP server for Pathfinder 2nd Edition Remastered rules lookup and character building
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
rules_search
Full-text search over PF2e rules content. Returns compact summaries (id/name/pack/type/level/category) -- call rules_get_entry with an id for the full description and raw data of a specific result. `include_legacy` (default False): excludes pre-Remaster/OGL-flagged content unless set -- but `is_remaster: false` does NOT mean "retired," just "not (yet) reprinted under ORC" (54% of backgrounds, 38% of ancestries are legacy-flagged and still fully playable), so set this True whenever the user wants the full catalog. See `licensing.legacy_filter_sql`.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
include_legacy | boolean | |
limit | integer | |
pack | ||
type |
rules_get_entry
Fetch a single PF2e entry's full detail (description, traits, raw data) by id, exact name, or slug. Provide exactly one of the three.
| Parameter | Type | Description |
|---|---|---|
id | ||
name | ||
slug |
rules_explain
Explain a rules topic (e.g. a condition or general rule) by full-text searching content most likely to hold rules text (conditions, actions, glossary entries) and returning descriptions inline, since the point is a direct answer rather than a lookup requiring a follow-up call.
| Parameter | Type | Description |
|---|---|---|
topic * | string | |
limit | integer |
rules_data_version
Report which foundryvtt/pf2e release the current rules database was built from.
rules_list_variant_rules
Browse the optional/variant character-building and subsystem rules ingested from GM Core's "Subsystems and Variant Rules" section (what Pathbuilder and most tables call "optional rules") -- Free Archetype, Ancestry Paragon, Proficiency without Level, Gradual Attribute Boosts, Automatic Bonus Progression, Stamina, Mythic Characters, and several GM-facing downtime/encounter subsystems (Chases, Influence, etc.). Returns compact summaries; call rules_get_entry with an id/name for the full official rule text and book/page citation. `category` filters to 'character-building' (affects what a charact…
| Parameter | Type | Description |
|---|---|---|
category |
rules_list_subclass_option_groups
List every subclass-style choice-group tag found in the ingested data -- e.g. 'animist-apparition', 'sorcerer-bloodline', 'druid-order', 'witch-patron', 'cleric-doctrine', 'barbarian-instinct' -- one tag family per class that has this kind of choice (order/practice/ doctrine/patron/instinct/mystery/muse/racket/style/...). Each of these is a real level-1-or-later pick with mechanical consequences (e.g. a Druid Order or Animist Practice can outright grant a bonus feat), but nothing else in this server can enumerate them -- `build_list_classes` only returns a class's flat level-1 baseline, with n…
rules_list_subclass_options
List every option in a subclass-style choice group by its exact tag (see `rules_list_subclass_option_groups` for valid values -- tag matching is exact, not fuzzy, since e.g. Inventor's two groups ('weapon-innovation-modification'/'armor-innovation-modification') don't share a class-name prefix the way most others do, so guessing a class-name-based filter would silently miss real groups). Returns full entries (with description, plus `grants` -- anything the option automatically grants, e.g. Shaman practice granting Spirit Familiar -- and `stat_modifiers` -- numeric/proficiency changes, e.g. an…
| Parameter | Type | Description |
|---|---|---|
tag * | string |
rules_search_aon
Live search of Archives of Nethys (aonprd.com) -- content this project deliberately does NOT ingest, not a fallback for content that's merely hard to find in `rules_search`. Three concrete gaps this covers: 1. **Bestiary/Monster Core/NPC Core content, excluded from ingestion entirely** (see this project's GitHub issues, "Licensing" topic) -- monster stat blocks, and GM-facing guideline tables like GM Core's "Building Creatures" chapter. Confirmed live: Table 2-5 (Armor Class by Level) and Table 2-6 (Saving Throws by Level) -- e.g. a level-4 moderate-threat AC is 20 -- exist onl…
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | integer | |
max_chars | integer |
rules_sql
Read-only SQL against the rules database -- the fallback for questions no other tool can express. **Try the purpose-built tools first.** `rules_search` and `rules_get_entry` cover lookup, `rules_related` and `rules_explain` cover cross-references, and `build_list_available_feats` answers "what may this character take" far better than a hand-written join will. Reach for this when the question is structural rather than textual -- a catalogue of every feat carrying a trait ordered by level, a comparison of two classes' proficiency progressions, an audit of how many entries a transform dropped.…
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
max_cell | integer | |
params | ||
schema | boolean | |
sql | string |
build_list_ancestries
List playable ancestries, optionally filtered by name substring. `include_legacy` (default False): excludes pre-Remaster/OGL-flagged ancestries unless set -- but 38% of ancestries are legacy-flagged and still fully playable (not reprinted under ORC yet isn't the same as retired), so set this True whenever the user wants the full catalog, not just what's been individually remastered. See `_legacy_filter_sql`.
| Parameter | Type | Description |
|---|---|---|
filter | ||
include_legacy | boolean |
build_list_backgrounds
List backgrounds, optionally filtered by name substring. `trained_skills` (`{"fixed": [skill slugs], "lore": [Lore skill names]}`) and `granted_items` (`[{level, name, uuid}]`, `level` always null for a background -- granted at character creation) come straight from the background item's own structured `system.trainedSkills`/`system.items` fields, the same mechanism `build_list_classes` already exposes for classes -- e.g. Field Medic: trained_skills `{"fixed": ["medicine"], "lore": ["Warfare Lore"]}`, granted_items `[{"name": "Battle Medicine", ...}]`. `include_legacy` (default False): exclu…
| Parameter | Type | Description |
|---|---|---|
filter | ||
include_legacy | boolean |
build_list_classes
List classes, optionally filtered by name substring. Includes each class's level-1 initial proficiency baseline (HP, Perception, saves, trained skills formula, weapon/armor proficiencies) -- sourced directly from the class item's own data rather than requiring the caller to recall or look this up externally. Proficiency ranks in the returned `perception`/`fortitude`/`reflex`/`will`/`class_dc`/`attacks`/`defenses` fields use this project's 0/2/4/6/8 convention (untrained/trained/ expert/master/legendary), the same as a character's `proficiencies` dict elsewhere -- ready to drop into a draft cha…
| Parameter | Type | Description |
|---|---|---|
filter | ||
include_legacy | boolean |
build_list_equipment
Browse the equipment pack (weapons, armor, shields, gear) by name substring, item type, and/or maximum price. A fresh level-1 character has STARTING_WEALTH_GP (15) gold pieces to spend using the standard "starting money" method -- returned alongside results as a reminder, not a per-call lookup, since it's a fixed constant. `include_legacy` (default False): excludes pre-Remaster/OGL-flagged equipment unless set. See `_legacy_filter_sql`.
| Parameter | Type | Description |
|---|---|---|
filter | ||
include_legacy | boolean | |
item_type | ||
max_price_gp |
build_list_available_feats
The main token-saving discovery tool: returns only feats of the requested category at or below the target level (character's current level if unspecified) whose prerequisites the character already meets, instead of the caller reasoning over the full feat list or raw rules text. Split into two buckets: - "available": prerequisites confirmed satisfied (or none required). - "unconfirmed": at least one prerequisite couldn't be automatically verified (freeform text the parser can't structure -- roughly 16% of all feats per the Phase 0 parsing spike). Never silently included in "available" --…
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… | |
feat_category * | string | |
include_legacy | boolean | |
level |
build_list_ability_boost_options
Eligible ability score boosts for the given source, respecting ancestry flaws and boosts already recorded in character.abilities.breakdown (Pathbuilder's own per-level boost history field -- see the plan's Pathbuilder-schema findings). Does not yet cross-check the "can't take two free boosts in the same ability at the same tier" rule beyond what's already recorded in breakdown for *this* source; full multi-source interaction (e.g. voluntary ancestry flaws freeing up a boost) is left to validate_build.
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… | |
source * | string |
build_list_skill_increase_options
Which of the 16 core skills are legal to raise one rank right now, given the character's current level and current rank in each (the trained/expert/master/legendary level-3/7/15 caps are a fixed core rule, independent of class). Does not consult skillIncreaseLevels itself -- call build_get_level_up_choices to confirm a skill-increase choice is actually available at the target level before offering these.
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… |
build_check_prerequisite
Narrow single-feat eligibility check -- use when sanity-checking one user-proposed choice rather than re-running full discovery.
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… | |
feat_id * | string |
build_validate_build
Structured validation, not prose -- returns errors (definite rule violations) and warnings (things that couldn't be auto-verified and need human confirmation). Covers: duplicate feats, prerequisites of every taken feat still being satisfied (important after e.g. a hypothetical ancestry swap mid-build), skill ranks not exceeding the fixed level-3/7/15 expert/master/legendary caps, whether the number of ancestry-category feats taken fits the character's actual budget for their level, and (new) the archetype "one dedication feat at a time" rule -- a level-ordered check that no dedication feat was…
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… | |
pfs_legal_only | boolean | |
variant_rules |
build_calculate_derived_stats
Deterministic PF2e math: AC, saves, Perception, skill totals, HP, class DC, and spell DC/attack per casting tradition the character has trained. Never left to model arithmetic -- proficiency stacking (untrained = ability mod only, no level) is easy to get wrong. AC uses the character's worn armor (Pathbuilder's `armor` list) if present, else the unarmored baseline, and includes the armor's potency rune if any. Does not yet include a raised shield's bonus -- see pf2e_math.armor_ac docstring. All three saves include the armor's resilient rune's item bonus, if any -- previously omitted entirely,…
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… |
build_list_available_spells
Spells of the given tradition at or below the highest rank the character can currently access, plus (new) the character's actual spell slot counts by rank for their level, when their class has one. Rank cap resolution, in order: an explicitly-passed `max_rank` always wins (needed for a caster archetype/dedication, where `character.class` itself isn't the caster and so has no row in `class_spell_slots` at all); otherwise the character class's own real slot table (see `_class_spell_slots`) if it has one -- this replaces the standard full-caster `ceil(level/2)` heuristic with the class's actual…
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… | |
tradition * | string | |
include_legacy | boolean | |
max_rank | ||
slot_rank |
build_get_level_up_choices
What unlocks at target_level for the character's class: which feat categories/skill increases become available (from the class's structured level-gate arrays) plus any automatically-granted class features (no choice required). Ability boosts are always at 5/10/15/20 per core PF2e rules, not class-specific data. `variant_rules` is a list of slugs for optional/variant rules this build is using -- see rules_list_variant_rules for the full catalog and rules_get_entry for each one's official text. Accepts either the rules database's own kebab-case slugs ('free-archetype', 'ancestry-paragon') or th…
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… | |
target_level * | integer | |
variant_rules |
build_to_pathbuilder_export
Wrap the working character representation as a Pathbuilder-compatible export. The working schema already follows Pathbuilder's `build` shape (per the user's decision -- see the plan's Pathbuilder-schema findings), so this is a normalize/strip pass rather than a full transform: drop any internal-only keys (none introduced in Phase 1) and wrap in the {success, build} envelope real exports use.
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… |
build_character_schema
Return the JSON Schema for a character file. A character file is one YAML document holding everything about one character: the level-by-level build plan from 1st to 20th, the level they have actually reached, the gear they carry, their Organized Play record, and their backstory and party introduction. It replaces the Pathbuilder JSON export, the companion markdown design document, the per-level snapshot exports and the chronicle sidecar that were previously maintained as separate, unlinked files. Two things about the shape are worth understanding before writing one. **The plan is the source…
build_validate_character
Check that a character file is well formed and internally consistent. Runs two layers. The **structural** layer checks the document against the schema: required fields, value types, unrecognised keys, enum membership. The **semantic** layer checks what a schema cannot express -- plan levels in ascending order and not repeated, the current level actually covered by the plan, attribute boosts from a single source not doubling up on one attribute, every slug resolving to a real rules entry, an Organized Play record that agrees with the build it now sits beside, and a gold journal (`ledger`) that…
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… |
build_character_at_level
Work out what a character looks like at a given level. A character file records the choices made at each level and nothing about their consequences. This replays the plan from 1st level up to `level` and returns the resulting state -- attributes, proficiency ranks, feats, automatic class features, skills and Lores, gear and spellcasting -- in the Pathbuilder shape that `build_calculate_derived_stats`, `build_validate_build` and `build_render_character_sheet` all accept. Pass the result straight to any of them. Because nothing is stored, any level is as cheap as any other: this is how to see…
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… | |
level |
build_import_pathbuilder
Convert a Pathbuilder export into a character document. Takes either the `{"success": true, "build": {...}}` envelope Pathbuilder produces or a bare build object, and returns a document in the native format -- ready to check with `build_validate_character` and save as `characters/<Name>.yaml`. A Pathbuilder file records more than it looks: each feat tuple carries the level and the slot it was taken in, so the plan is *reconstructed* level by level rather than guessed. Levels above the character's current one come back empty, because the export has nothing to say about them -- filling those i…
| Parameter | Type | Description |
|---|---|---|
export * | object |
build_fetch_pathbuilder
Fetch a Pathbuilder build by the id from its Export -> JSON link. Returns the `{"success": true, "build": {...}}` envelope unchanged, so it goes straight into `build_import_pathbuilder`. The id is the `?id=` in the URL Pathbuilder's **Export -> JSON** produces. **What comes back is the character as it stood at the last export, not as it stands now.** Editing in Pathbuilder does not update the payload; only exporting again does. This is the trap worth knowing about, because a fetch against an id whose owner has been editing returns *stale data with no indication that it is stale* -- confirme…
| Parameter | Type | Description |
|---|---|---|
character_id * |
build_export_pathbuilder
Render a character at a given level as a Pathbuilder export. Replays the plan to `level` and wraps the result in Pathbuilder's `{"success": true, "build": {...}}` envelope, dropping this format's own provenance keys so what comes back is a plain Pathbuilder file its importer will accept. Because any level replays as cheaply as any other, this is also how to get the character as they were five levels ago, or as they will be at 20th, without keeping separate files for each. Args: character: A character document matching `build_character_schema`, or a path to a `.pf2e.yaml` file ho…
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… | |
level |
pfs_get_adventure
Look up one Pathfinder Society adventure by its code. Resolves the shorthand a player actually says -- "8-02", "#8-02", "8-2", "PFS 8-02" all work -- into the adventure's title, kind, tier, season and Paizo product code, along with the standard rewards a chronicle for it should record. Codes come in three shapes: * Scenarios use Paizo's Society code: "1-01" through the current season, plus the evergreen intros "99-1" and "99-2". * Quests use "Q<series>-<number>", e.g. "Q1-7" or "Q2-26". The series matters: Series 2 quests (#14 and up) award double a Series 1 quest. * Bounties u…
| Parameter | Type | Description |
|---|---|---|
code * | string |
pfs_find_adventures
Search the Pathfinder Society adventure index. Use this when the code isn't known -- to find an adventure by title, to list a season, or to answer "what can a 4th-level character play?" via `level`, which matches adventures whose tier contains that level. Args: query: Case-insensitive fragment of the adventure's title. kind: Restrict to 'scenario', 'quest', or 'bounty'. season: Restrict to one scenario season (1-8 and counting). Quests and bounties have no season; they are numbered in their own series. level: A character level that must fall within the adventure's tie…
| Parameter | Type | Description |
|---|---|---|
kind | ||
level | ||
limit | integer | |
query | ||
season |
pfs_chronicle_schema
Return the JSON Schema for a Pathfinder Society chronicle log. A chronicle log records a character's Organized Play history: their Organized Play ID and character number, their faction, and every Chronicle Sheet earned, in the order applied. It is stored as a `characters/<Name>.chronicles.json` sidecar rather than inside the character's Pathbuilder JSON, so that export stays a clean, portable Pathbuilder file. The shape worth understanding before writing one is that a chronicle is a ledger entry, not a snapshot. Every chronicle carries `xp.start` and `currency.start`, which must equal the pr…
pfs_validate_chronicle
Check a chronicle log and report the totals it implies. Two kinds of finding come back. **Errors** are internal contradictions the file cannot be right about: a ledger where start + gained does not equal end, a chronicle whose starting values do not match the previous one's ending values, an adventure code that resolves to nothing, a non-repeatable adventure recorded twice without a replay. **Warnings** are deviations from the Guide's standard awards -- nonstandard XP, low Reputation, a treasure bundle total that does not match the character's level, playing out of tier -- which individual ad…
| Parameter | Type | Description |
|---|---|---|
chronicle_log * | object |
pfs_earn_income
What one Pathfinder Society Earn Income check pays. Downtime in Organized Play works differently from a home game, in ways that change both the arithmetic and the strategy: - Downtime is granted per Chronicle and **spent when that Chronicle is applied, or lost**. It cannot be saved up, so there is no downtime "balance" to plan against -- each adventure's days are use-them-now. - Downtime is granted at **two days per XP earned**, and spent in **Downtime Units of up to 8 days**. You make **one check per unit**, covering the whole unit rather than paying per day. A Scenario's 8 days is…
| Parameter | Type | Description |
|---|---|---|
level * | integer | |
adventure_type | string | |
downtime_days | ||
proficiency | string |
build_render_character_sheet
Write a print-ready, fully self-contained HTML character sheet and return a summary of what went onto it. `extra_pages` inserts caller-supplied HTML in reading order right after this project's own quick-reference cards (the ones built from the character's `quickReference.pages`), and still ahead of every later section and the licence page, which stays last -- each string is inserted verbatim, so a full `<section class="page" data-sec="..."> ...</section>` block is expected, not a bare fragment; anything not scoped under its own class risks colliding with this file's own stylesheet, since one…
| Parameter | Type | Description |
|---|---|---|
character * | A character: either the document itself, or a path to a `.pf2e.yaml` file on disk to load it from (e.g. `characters/AshKordun-Orc-Cleric/AshKordun.pf2e.yaml`). A string is always read as a path, never… | |
output_path * | string | |
extra_pages | ||
level | ||
logo_path | ||
paper | string | |
symbol_dir |
pfs_render_chronicle_sheet
Render a Pathfinder Society chronicle log as a printable HTML document. Produces a self-contained file -- fonts and any logo are embedded, nothing is fetched at view time -- laid out as: a summary page (current level and XP, currency on hand, Reputation per faction, downtime banked, and every adventure played), a validation page if anything was flagged, one page per chronicle in the order they were applied, and a notices page. `chronicle_log` is a chronicle log object matching this server's chronicle schema (call `pfs_chronicle_schema` for the full JSON Schema, or read it from a `characters/…
| Parameter | Type | Description |
|---|---|---|
chronicle_log * | object | |
output_path * | string | |
blank_adventure_rows | integer | |
blank_journal_rows | integer | |
logo_path | ||
paper | string |