wiki_aggregate
Compute an aggregate over the wiki's entities — count / sum / avg / min / max of a numeric field across a whole kind, with an optional numeric 'where' filter. Use for 'how many…', 'what's the average/total/highest…' questions. 'count' needs no field (counts entities, or those matching 'where'); sum/avg/min/max require a 'field'. Supports the same optional 'category' scope as wiki_rank (food/item/species). Kinds and field names are the SAME as wiki_rank — see that tool's per-kind field lists. Example: { kind: "recipe", metric: "count", where: { field: "skill_level", op: ">", value: 5 } } → how many recipes need skill level above 5. Scoped: { kind: "food", metric: "avg", field: "calories", category: "vegetable" } → average calories of vegetables. Optional character/server PROFILE (skill_level/skills, talents, modules/module, server) recomputes the same profile-sensitive metrics as wiki_rank (recipe labor/craft_minutes; tool damage/calories_burn/durability_burn; item harvest_yield/power_watts; species yield_total/yield_min_total); static fields ignore it (the result carries a note). No profile = base aggregate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Which entity set to aggregate over. | |
| field | No | Numeric field for sum/avg/min/max (required for those). Optional for count — with a field, count includes only entities that have it. | |
| where | No | Optional single numeric filter applied before ranking/aggregating, e.g. { field: "weight", op: "<", value: 1000 }. The field must come from the same per-kind set as 'by'/'field'. | |
| metric | Yes | Which aggregate to compute. | |
| module | No | A single module name/type, or a comma-separated list (alternative to modules[]). | |
| server | No | Model a DIFFERENT server's difficulty (default = this server's real settings; omit for accurate answers). Fields: craftResource, craftTime, growth, garbageRatio, fuelEfficiency, foodVariety, foodTastiness, baseGain, minBalanced, maxBalanced. Only craft_minutes is server-sensitive for ranking. | |
| skills | No | Per-skill levels: { "<skill FullName>": level }. Overrides skill_level for those skills. | |
| modules | No | Upgrade-module names/types installed (multiple slots stack). | |
| talents | No | Talent names/types to treat as learned (profile-sensitive metrics only). | |
| category | No | Optional: scope to ONE tag/category before ranking/aggregating, e.g. "seed", "vegetable", "gun". Only the tagged kinds (food / item / species) support this. Use the category's name from a wiki_search result; matching is case- and plural-insensitive. | |
| skill_level | No | A single skill level applied to every governing skill (profile-sensitive metrics only). |