[
  {
    "name": "pokemon_by_type",
    "description": "List Gen 1 Pokemon of a given type, strongest first.",
    "kind": "read",
    "sql": "SELECT name, type1, type2, total FROM pokedex.pokemon WHERE type1 = :type OR type2 = :type ORDER BY total DESC LIMIT :max",
    "params": [
      { "name": "type", "type": "string", "description": "Type name, e.g. Fire, Water, Grass." },
      { "name": "max", "type": "number", "description": "How many rows to return." }
    ]
  },
  {
    "name": "set_pokemon_legendary",
    "description": "Mark a Pokemon as legendary (write template; runs through preflight/confirm).",
    "kind": "write",
    "sql": "UPDATE pokedex.pokemon SET is_legendary = :flag WHERE name = :name",
    "params": [
      { "name": "flag", "type": "number", "description": "1 for legendary, 0 otherwise." },
      { "name": "name", "type": "string", "description": "Exact Pokemon name." }
    ]
  }
]
