build_list_available_feats
Returns only feats in a category that a character meets the prerequisites for at a target level, separating confirmed from unconfirmed ones for manual review.
Instructions
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" -- surface these to the user for manual confirmation.
Feats that definitely fail a prerequisite, or that the character
already has, are omitted entirely.
"class" and "ancestry" feats are further restricted to the character's
own class/ancestry (matched via the feat's trait list, e.g. a Fighter
class feat carries the "fighter" trait) -- category alone only narrows
to "any class feat from any class".
"archetype" is a special case: the source data has no "archetype"
category value at all (confirmed against the real data -- every
archetype/dedication feat is stored as category "class" or "skill",
with "archetype" appearing only as a trait). This matches actual PF2e
rules: archetype feats are taken using ordinary class or skill feat
slots, not a separate slot type. This function queries for the
"archetype" trait within those two categories instead. It does not
filter further to one specific chosen archetype (e.g. "only Alchemist
archetype feats") -- that gating already happens naturally through each
feat's own prerequisite (e.g. "Alchemist Dedication"), checked the same
way as any other prerequisite.
Every returned entry also carries `rarity` and a best-effort `pfs`
legality status (not authoritative -- see pfs.py module docstring),
so a PFS-bound build can be steered away from restricted picks without
a separate lookup per feat.
`include_legacy` (default False): excludes pre-Remaster/OGL-flagged
feats unless set. See `_legacy_filter_sql`.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | ||
| character | Yes | ||
| feat_category | Yes | ||
| include_legacy | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||