{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "name": "Medieval Occupation NPC Generator",
  "description": "A high-fidelity Progressive Web App that generates detailed, lore-rich NPCs for tabletop RPGs (D&D 5e, Daggerheart, PF2e) based on authentic medieval occupations.",
  "version": "1.0.0",
  "url": "https://npc.bagsoffolding.com",
  "protocolVersion": "2024-11-05",
  "tools": [
    {
      "name": "generateNPC",
      "description": "Creates an AI prompt or generates a detailed medieval NPC based on chosen occupation, settlement size, system, and mood.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "occupation": {
            "type": "string",
            "description": "Occupation filename (e.g. 'Blacksmith') or 'Random'."
          },
          "race": {
            "type": "string",
            "description": "Species or ancestry (e.g. 'Human', 'Elf', 'Dwarf', 'Any')."
          },
          "settlementSize": {
            "type": "string",
            "description": "Settlement tier key (e.g. 'Village (100-900)', 'Market Town (1k-5k)')."
          },
          "system": {
            "type": "string",
            "description": "Tabletop RPG system (e.g. '5e', 'pf2e', 'daggerheart', 'agnostic')."
          },
          "npcTier": {
            "type": "string",
            "description": "NPC power tier '0' (civilian) to '3' (boss/leader)."
          },
          "details": {
            "type": "string",
            "description": "Specific user instructions, quirks, physical features, or secrets."
          },
          "depth": {
            "type": "string",
            "description": "Prompt depth ('quick' for table skim, 'detailed' for rich narrative lore)."
          },
          "mood": {
            "type": "string",
            "description": "Mood/Tone palette ('auto', 'grim', 'comedic', 'mysterious', 'intrigue', 'grounded', 'custom')."
          },
          "customMood": {
            "type": "string",
            "description": "Custom creative direction when mood is 'custom'."
          },
          "settlementEntanglement": {
            "type": "string",
            "description": "Settlement integration ('tight' vs 'loose')."
          },
          "includeStats": {
            "type": "boolean",
            "description": "Whether to include game stat blocks."
          },
          "includeVoice": {
            "type": "boolean",
            "description": "Whether to include voice and mannerisms."
          },
          "includeInventory": {
            "type": "boolean",
            "description": "Whether to include pocket inventory."
          },
          "includeMorale": {
            "type": "boolean",
            "description": "Whether to include combat morale."
          },
          "includeRumor": {
            "type": "boolean",
            "description": "Whether to include local rumor."
          },
          "includeSecret": {
            "type": "boolean",
            "description": "Whether to include NPC secret."
          },
          "includeSettlement": {
            "type": "boolean",
            "description": "Whether to include settlement context."
          },
          "proceduralVariation": {
            "type": "boolean",
            "description": "Whether to inject randomized procedural sparks."
          }
        }
      }
    },
    {
      "name": "getOccupations",
      "description": "Retrieves the list of 130+ historical medieval occupations, optionally filtered by keyword or category.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "filter": {
            "type": "string",
            "description": "Filter text to match occupation names or descriptions."
          },
          "category": {
            "type": "string",
            "description": "Category filter (e.g. 'Crafts', 'Labor', 'Commerce', 'Administration', 'Maritime')."
          }
        }
      }
    },
    {
      "name": "searchOccupations",
      "description": "Searches medieval occupations using keywords across names, categories, and descriptions.",
      "inputSchema": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string",
            "description": "Search query or keyword (e.g. 'iron', 'leather', 'beer', 'noble')."
          }
        }
      }
    },
    {
      "name": "getOccupation",
      "description": "Returns full historical background, daily routine, tools, and social standing for a given medieval occupation.",
      "inputSchema": {
        "type": "object",
        "required": [
          "filename"
        ],
        "properties": {
          "filename": {
            "type": "string",
            "description": "Filename of occupation source (e.g. 'The_Blacksmith.md')."
          }
        }
      }
    },
    {
      "name": "saveBaggedNPC",
      "description": "Saves the currently generated NPC to the active settlement's bag for campaign context injection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the NPC."
          },
          "role": {
            "type": "string",
            "description": "Role of the NPC."
          },
          "summary": {
            "type": "string",
            "description": "Short summary of relationships and traits."
          }
        }
      }
    },
    {
      "name": "createSettlement",
      "description": "Creates a new settlement with demographic scale and economic focus.",
      "inputSchema": {
        "type": "object",
        "required": [
          "name",
          "demography",
          "purpose"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the settlement."
          },
          "demography": {
            "type": "string",
            "description": "Settlement tier (e.g., 'Village (100-900)')."
          },
          "purpose": {
            "type": "string",
            "description": "Economic focus (e.g., 'Agrarian / Farming')."
          }
        }
      }
    },
    {
      "name": "switchSettlement",
      "description": "Switches the active settlement context.",
      "inputSchema": {
        "type": "object",
        "required": [
          "idOrName"
        ],
        "properties": {
          "idOrName": {
            "type": "string",
            "description": "The UUID or exact name of the settlement."
          }
        }
      }
    }
  ]
}