@mistereman22/osrs-wiki-mcp-server 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ # Page Structure Guide
2
+
3
+ > Page types, key sections, infobox→bucket mapping for `get-page`.
4
+
5
+ ## Page Structure by Type
6
+
7
+ | Page Type | Key Sections |
8
+ |-----------|--------------|
9
+ | **Items** | Infobox (stats), Obtaining, Usage, Changes |
10
+ | **Monsters** | Infobox (stats), Drops, Strategies, Locations |
11
+ | **Bosses** | Infobox, Mechanics, Strategies, Drops, Hard mode |
12
+ | **Quests** | Infobox, Requirements, Walkthrough, Rewards, Quick guide |
13
+ | **Locations** | Map, Features, NPCs, Monsters, Shops |
14
+ | **Raids** | Overview, Entry requirements, Rooms/Bosses, Rewards, Strategies |
15
+
16
+ ## Infobox Fields (Semantic Data → Use Buckets)
17
+
18
+ Most structured data lives in infoboxes and is available via buckets:
19
+
20
+ | Page Type | Bucket | Key Fields |
21
+ |-----------|--------|------------|
22
+ | Items | `bucket("infobox_item")` | item_name, item_id, examine, high_alchemy_value, value, weight, buy_limit, is_members_only, tradeable, image, release_date |
23
+ | Items (GE) | `bucket("exchange")` | name, value, high_alch, low_alch, buy_volume, sell_volume |
24
+ | Monsters | `bucket("infobox_monster")` | name, combat_level, hitpoints, max_hit, slayer_level, slayer_experience, slayer_category, assigned_by, attack/defence bonuses, attack_speed, poisonous, attribute, attack_style, respawn_time, elemental_weakness |
25
+ | Shops | `bucket("infobox_shop")` | shop_name, location, owner, specialty, shop_version, is_members_only |
26
+ | NPCs | `bucket("infobox_npc")` | id, combat_level, examine |
27
+ | Quests | `bucket("quest")` | name, requirements, rewards, difficulty, length, series |
28
+ | Spells | `bucket("infobox_spell")` | name, level, rune_cost, effect, description |
29
+
30
+ **Rule**: If you need infobox data → use the bucket, not the page.
31
+
32
+ ## Redirects
33
+
34
+ Many pages redirect (e.g., "Abby whip" → "Abyssal whip"). `get-page` follows redirects by default. If you need the redirect target without following, use `followRedirects=false`.
35
+
36
+ ## Disambiguation
37
+
38
+ Common disambiguation patterns:
39
+ - `Item Name (disambiguation)` — rare
40
+ - `Item Name (item)` vs `Item Name (monster)` — e.g., "Dragon (item)" vs "Dragon (monster)"
41
+ - Use `search-page` to find the correct variant
42
+
43
+ ## Large Page Strategy
44
+
45
+ For pages with many sections:
46
+
47
+ 1. `get-page "Title" metadata=true` — get section outline
48
+ 2. Identify needed section number
49
+ 3. `get-page "Title" section=N` — fetch only that section
50
+
51
+ Example:
52
+ ```bash
53
+ get-page "Chest (Tombs of Amascut)" metadata=true
54
+ # Returns sections: Lead, Rewards, Unique drops, Standard drops, Supply drops
55
+ get-page "Chest (Tombs of Amascut)" section=3 # Standard drops
56
+ ```
57
+
58
+ ## Quick Reference: Common Prefixes
59
+
60
+ | Looking for... | Try prefix search |
61
+ |----------------|-------------------|
62
+ | Weapon variants | `search-page-by-prefix "Dragon "` |
63
+ | Armour sets | `search-page-by-prefix "Bandos "` |
64
+ | Potions | `search-page-by-prefix "Prayer "` |
65
+ | Bosses | `search-page-by-prefix "Phantom "` |
66
+ | Quests | `search-page-by-prefix "Recipe for "` |
@@ -0,0 +1,190 @@
1
+ # Search Guide
2
+
3
+ > Tool selection, broad-first search, canonical page heuristic, section discovery for `search-page`, `search-page-by-prefix`, `get-page`.
4
+
5
+ ## Tool Selection Decision Tree (START HERE)
6
+
7
+ ```
8
+ User asks a question
9
+ │
10
+ ├─ Structured data? (stats, prices, drops, requirements, gear, varbits)
11
+ │ → bucket-query (read context://bucket-query-guide)
12
+ │
13
+ ├─ Canonical list? (all bosses, all quests, all items, all updates)
14
+ │ → get-category-members (read context://namespace-category-guide)
15
+ │
16
+ ├─ Custom namespace list? (game updates in Update:, calculators)
17
+ │ → get-site-info + get-category-members (read context://namespace-category-guide)
18
+ │
19
+ ├─ Exact page title known?
20
+ │ → get-page directly
21
+ │
22
+ ├─ Know start of title? (e.g., "Abyssal ", "Dragon ")
23
+ │ → search-page-by-prefix "Prefix"
24
+ │
25
+ └─ General topic / keywords / unstructured content?
26
+ → search-page with BROAD query + high limit (50-100)
27
+ → Check results for canonical index page → get-page that page
28
+ ```
29
+
30
+ ## Tool Comparison
31
+
32
+ | Tool | Use Case | Returns |
33
+ |------|----------|---------|
34
+ | `search-page` | General topic, keyword, phrase | Page titles + snippets (full-text) |
35
+ | `search-page-by-prefix` | Known prefix, autocomplete | Page titles only (no snippets) |
36
+ | `get-page` (metadata) | Get section outline of known page | Section headings + numbers |
37
+
38
+ ## Broad-First Search Strategy
39
+
40
+ **Start with a broad query + high limit to find the canonical page, then narrow.**
41
+
42
+ | Approach | Query | Limit | Why |
43
+ |----------|-------|-------|-----|
44
+ | ❌ Too specific | `"2026 game updates"` | 10 | Misses "Game updates" page |
45
+ | ✅ Broad first | `"game updates"` | 50-100 | Finds canonical page immediately |
46
+ | ✅ Broad first | `"updates"` | 50 | Even broader, catches "Game updates" |
47
+
48
+ ### Why this works
49
+ - `search-page` max limit = **100** (default 10). One broad call with `limit=100` costs same as narrow call.
50
+ - Canonical index pages (e.g., "Game updates", "Quest list") rank high for broad terms.
51
+ - Snippets in broad results reveal structure → you pick the right page → one `get-page`.
52
+
53
+ ### Workflow
54
+ ```
55
+ 1. search-page "updates" limit=100
56
+ → #2: "Game updates" (snippet: "chronological list of all game updates")
57
+ 2. get-page "Game updates" ← canonical page, has everything
58
+ 3. (if needed) get-page "Game updates" section=3 ← specific year
59
+ ```
60
+
61
+ ### Anti-pattern
62
+ ```
63
+ search-page "2026 game updates" limit=10 → misses canonical page
64
+ search-page "Easter 2026 update" → too narrow, fragments context
65
+ search-page "Cow Boss update" → too narrow
66
+ ```
67
+
68
+ ## search-page Best Practices
69
+
70
+ ### Do:
71
+ - Use specific keywords: `"hydra gear setup"` not `"hydra"`
72
+ - Include context: `"prayer flicking technique"` not `"prayer"`
73
+ - Use quotes for exact phrases: `"/roll"` or `"drop rate"`
74
+
75
+ ### Don't:
76
+ - Use single generic words: `"item"`, `"boss"`, `"quest"`
77
+ - Overuse - check bucket-index first for structured data
78
+
79
+ ### Result Interpretation:
80
+ - Snippet shows match context - verify it's the right page
81
+ - Page ID/size/timestamp help gauge relevance
82
+ - Namespace 0 = main content (what you want)
83
+
84
+ ## search-page-by-prefix Best Practices
85
+
86
+ ### Do:
87
+ - Use when you know the prefix: `"Abyssal "`, `"Dragon "`, `"Barbarian "`
88
+ - Short prefixes return more results: `"Dra"` vs `"Dragon "`
89
+ - Combine with namespace filter for categories: `namespace: 14`
90
+
91
+ ### Don't:
92
+ - Use for general topics (use `search-page`)
93
+ - Expect snippets - only titles returned
94
+
95
+ ## get-page for Section Discovery
96
+
97
+ ### Before reading a large page:
98
+ ```bash
99
+ get-page "Chest (Tombs of Amascut)" metadata=true
100
+ ```
101
+
102
+ ### Returns:
103
+ ```json
104
+ {
105
+ "sections": [
106
+ {"index": 0, "title": "Lead"},
107
+ {"index": 1, "title": "Rewards"},
108
+ {"index": 2, "title": "Unique drops"},
109
+ {"index": 3, "title": "Standard drops"},
110
+ {"index": 4, "title": "Supply drops"}
111
+ ]
112
+ }
113
+ ```
114
+
115
+ ### Then fetch only what you need:
116
+ ```bash
117
+ get-page "Chest (Tombs of Amascut)" section=3 # Standard drops
118
+ get-page "Chest (Tombs of Amascut)" section=2 # Unique drops
119
+ ```
120
+
121
+ ### Section 0 = Lead (intro text)
122
+ ### Section N = Heading N in the article
123
+
124
+ ## Common Search Patterns
125
+
126
+ | Goal | Tool | Query |
127
+ |------|------|-------|
128
+ | Item stats/price | bucket-query | `bucket("exchange").select(...).where("name","...")` |
129
+ | Monster stats | bucket-query | `bucket("infobox_monster").select(...).where("name","...")` |
130
+ | Where item drops from | bucket-query | `bucket("dropsline").select(...).where("item_name","...")` |
131
+ | What boss drops | get-page + metadata | `get-page "Boss Name" metadata=true` → `section=N` |
132
+ | Quest requirements | bucket-query | `bucket("quest").select(...).where("name","...")` |
133
+ | Gear for activity | bucket-query | `bucket("recommended_equipment").select(...).where("activity","...")` |
134
+ | Shop location/items | bucket-query | `bucket("infobox_shop").select(...).where("shop_name","...")` |
135
+ | General mechanic/guide | search-page | `search-page "prayer flicking"` |
136
+ | Browse category | get-page | `get-page "Category:Bosses"` |
137
+ | Find exact title variant | search-page-by-prefix | `search-page-by-prefix "Tumeken"` |
138
+
139
+ ## Canonical Page Heuristic
140
+
141
+ ### When search returns an obvious index/list page → FETCH IT IMMEDIATELY
142
+
143
+ If a search result's **title** and **snippet** together indicate it's the canonical aggregation page for your topic, stop searching and `get-page` it.
144
+
145
+ | Signal | Example |
146
+ |--------|---------|
147
+ | Title = plural/category name | `"Game updates"`, `"Quest list"`, `"Item sets"` |
148
+ | Snippet shows dated/structured entries | `"lists Easter 2026, Cow Boss, Getting Around Poll in chronological order"` |
149
+ | Title matches your query intent exactly | Search `"2026 updates"` → result `"Game updates"` |
150
+
151
+ ### Anti-pattern to avoid
152
+ ```
153
+ search-page "Game update 2026"
154
+ → result: "Game updates" (snippet: "lists Easter 2026, Cow Boss...")
155
+ → ❌ KEEP SEARCHING for "2026 update" "Easter 2026" etc.
156
+ → ✅ get-page "Game updates" ← canonical page, has everything
157
+ ```
158
+
159
+ ### Why this works
160
+ - Wiki index pages (Game updates, Quest list, Monster drop tables) are **curated, complete, and maintained**
161
+ - Search snippets often reveal the exact structure (chronological, by tier, by category)
162
+ - One `get-page` > 5+ `search-page` calls (rate limit, context, accuracy)
163
+
164
+ ### Quick test
165
+ > "Does this result look like *the* page a human would bookmark for this topic?" → Yes → `get-page`
166
+
167
+ ## Rate Limit Awareness
168
+
169
+ - Each search tool call counts toward MediaWiki rate limit (30/min)
170
+ - Prefer bucket-query for structured data (same limit, but returns exact data)
171
+ - Use `metadata=true` + `section=N` to minimize page read calls
172
+ - Cache results mentally within a conversation - don't re-search
173
+
174
+ ## DPL / Template Pages
175
+
176
+ If `get-page` returns `<dpl>` tags or `{{Template}}` transclusions — **the data isn't there**. See `context://namespace-category-guide` → "Dynamic Content Patterns" for the workflow:
177
+
178
+ 1. `get-site-info` → find namespace ID
179
+ 2. `get-category-members` with category + namespace
180
+ 3. `get-pages` for details
181
+
182
+ Common on OSRS: Game updates (`Update:` namespace 1198), calculators, module outputs.
183
+
184
+ ## Fallback Chain
185
+
186
+ 1. **bucket-query** (if structured data exists) → check `context://bucket-catalog`
187
+ 2. **search-page-by-prefix** (if you know title prefix)
188
+ 3. **search-page** (general topic)
189
+ 4. **get-page + metadata** (large page, need specific section)
190
+ 5. **get-page** (full page, last resort)
@@ -0,0 +1,99 @@
1
+ # Tool Selection Guide (READ FIRST)
2
+
3
+ > Decide which tool to use, then read the corresponding guide.
4
+
5
+ ## Decision Tree
6
+
7
+ ```
8
+ User asks a question
9
+ │
10
+ ├─ Structured data? (stats, prices, drops, requirements, gear, varbits, IDs)
11
+ │ → bucket-query
12
+ │ → Read: context://bucket-query-guide
13
+ │
14
+ ├─ Canonical list? (all bosses, all quests, all items, all updates)
15
+ │ → get-category-members
16
+ │ → Read: context://namespace-category-guide
17
+ │
18
+ ├─ Custom namespace list? (game updates, calculators)
19
+ │ → get-site-info + get-category-members
20
+ │ → Read: context://namespace-category-guide
21
+ │
22
+ ├─ Exact title known?
23
+ │ → get-page
24
+ │
25
+ ├─ Know title prefix? (e.g., "Abyssal ", "Dragon ")
26
+ │ → search-page-by-prefix
27
+ │ → Read: context://search-guide
28
+ │
29
+ └─ General topic / unstructured content? (lore, mechanics, guides)
30
+ → search-page (broad query + high limit)
31
+ → Check for canonical page → get-page
32
+ → Read: context://search-guide
33
+ ```
34
+
35
+ ## Quick Tool → Resource Map
36
+
37
+ | Tool | Primary Resource | Secondary |
38
+ |------|------------------|-----------|
39
+ | `bucket-query` | `context://bucket-query-guide` | `context://bucket-catalog` |
40
+ | `get-category-members` | `context://namespace-category-guide` | — |
41
+ | `get-site-info` | `context://namespace-category-guide` | — |
42
+ | `get-page` | `context://search-guide` (section discovery) | `context://page-structure` |
43
+ | `search-page` | `context://search-guide` | — |
44
+ | `search-page-by-prefix` | `context://search-guide` | — |
45
+ | `get-links-here` | `context://namespace-category-guide` | — |
46
+
47
+ ## Most Common Patterns (Copy-Paste)
48
+
49
+ ### Bucket Query (structured data)
50
+ ```lua
51
+ -- Item price/stats
52
+ bucket("exchange").select("name","value","high_alch").where("name","Abyssal whip").run()
53
+ bucket("infobox_item").select("item_name","value","high_alch","weight").where("item_name","Abyssal whip").run()
54
+
55
+ -- Monster stats
56
+ bucket("infobox_monster").select("name","combat_level","hitpoints","max_hit").where("name","Hydra").run()
57
+
58
+ -- Drop sources for item
59
+ bucket("dropsline").select("item_name","drop_json").where("item_name","Abyssal whip").run()
60
+
61
+ -- Quest requirements
62
+ bucket("quest").select("name","requirements").where("name","Dragon Slayer I").run()
63
+
64
+ -- Gear for activity
65
+ bucket("recommended_equipment").select("item","slot").where("activity","hydra").run()
66
+
67
+ -- Varbit
68
+ bucket("varbit").select("name","value").where("name","hydra_task").run()
69
+
70
+ -- Shop
71
+ bucket("infobox_shop").select("shop_name","location","owner").where("shop_name","Bob's Brilliant Axes").run()
72
+ ```
73
+
74
+ ### Category Members (canonical lists)
75
+ ```bash
76
+ # All bosses
77
+ get-category-members "Bosses"
78
+
79
+ # All quests
80
+ get-category-members "Quests"
81
+
82
+ # All game updates (Update: namespace 1198)
83
+ get-category-members "Updates" namespaces=[1198]
84
+
85
+ # All GE items
86
+ get-category-members "Grand Exchange items"
87
+ ```
88
+
89
+ ### Search (unstructured content)
90
+ ```bash
91
+ # Broad first → canonical page → section
92
+ search-page "updates" limit=100
93
+ get-page "Game updates"
94
+ get-page "Game updates" section=3
95
+
96
+ # Section discovery
97
+ get-page "Chest (Tombs of Amascut)" metadata=true
98
+ get-page "Chest (Tombs of Amascut)" section=3
99
+ ```
@@ -1,147 +0,0 @@
1
- # Bucket Index (hint list)
2
-
3
- > On-demand hints for `bucket-query` on the Old School RuneScape Wiki.
4
- > **This index is not authoritative.** Purpose descriptions are best-effort
5
- > summaries; fields always come from the schema page. If nothing here fits
6
- > your need, or a name fails at runtime, fall back to discovery:
7
- > `search-page-by-prefix` in the `Bucket:` namespace (id 9592), then
8
- > `get-page` on `Bucket:<Name>` to see exact fields and a data preview.
9
- >
10
- > Naming rule: pass the page title lowercased with spaces as underscores
11
- > (`Bucket:Clue equipment` -> `bucket("clue_equipment")`). All bucket and
12
- > field names are lowercase; fields are verified on the schema page, never
13
- > guessed from this file.
14
-
15
- ## Known buckets
16
-
17
- | Query as | Page | Holds |
18
- | --- | --- | --- |
19
- | `bucket("bountytaskline")` | Bucket:Bountytaskline | Bounty Hunter task line entries |
20
- | `bucket("clue_equipment")` | Bucket:Clue equipment | Equipment associated with clue scroll steps |
21
- | `bucket("clue_info")` | Bucket:Clue info | Clue scroll metadata/step info |
22
- | `bucket("collection_log_source")` | Bucket:Collection log source | Collection log sources per item: item_id, item_name, sources (repeated wikilinks), rates, kinds. **Only queryable by item_name** - cannot filter by source. To find "what drops from X", use the source page directly. |
23
- | `bucket("combat_achievement")` | Bucket:Combat achievement | Combat achievement tasks, tiers, requirements |
24
- | `bucket("couriertaskline")` | Bucket:Couriertaskline | Courier activity task line entries |
25
- | `bucket("demonicpactleaguetask")` | Bucket:Demonicpactleaguetask | Demonic Pact league task entries |
26
- | `bucket("dependency_list")` | Bucket:Dependency list | Item/object dependency relations |
27
- | `bucket("drop_table_sources")` | Bucket:Drop table sources | Shared drop tables (rare drop table, gem drop table, herb drop table) and their roll/rarity data. Not specific monster/boss drop tables. |
28
- | `bucket("dropsline")` | Bucket:Dropsline | Drop table line entries: item_name, drop_json (JSON text with "Dropped from", rarity, quantity), rare_drop_table. **Only queryable by item_name** - cannot filter by source. To find "what drops from X", use the source page (boss/chest/activity) directly. |
29
- | `bucket("exchange")` | Bucket:Exchange | Grand Exchange prices (name, value, high/low, volumes) |
30
- | `bucket("feedback")` | Bucket:Feedback | Wiki feedback entries (site-internal) |
31
- | `bucket("ge_index_header")` | Bucket:Ge index header | Grand Exchange index header/snapshot metadata |
32
- | `bucket("infobox_activity")` | Bucket:Infobox activity | Skilling/activity infobox data |
33
- | `bucket("infobox_bonuses")` | Bucket:Infobox bonuses | Equipment combat stats and bonuses |
34
- | `bucket("infobox_construction")` | Bucket:Infobox construction | Construction object/buildable data |
35
- | `bucket("infobox_grid_master_unlock")` | Bucket:Infobox grid master unlock | Grid Master unlock data |
36
- | `bucket("infobox_item")` | Bucket:Infobox item | Core item data: item_name, item_id, examine, high_alchemy_value, value, weight, buy_limit, is_members_only, tradeable, image, league_region, release_date, removal_date, value, weight, high_alchemy_value, buy_limit, default_version, quest, version_anchor, is_members_only, tradeable |
37
- | `bucket("infobox_location")` | Bucket:Infobox location | Location/area data |
38
- | `bucket("infobox_monster")` | Bucket:Infobox monster | Monster combat stats: name, combat_level, hitpoints, max_hit, slayer_level, slayer_experience, slayer_category, assigned_by, attack/defence bonuses (stab/slash/crush/magic/range), attack_speed, hitpoints, max_hit, poisonous, attribute, attack_style, attack_speed, respawn_time, experience_bonus, flat_armour, magic_resistance, size, attack/strength/defence/ranged/magic levels, attack_bonus, strength_bonus, range_strength_bonus, magic_damage_bonus, poison/venom/freeze/burn/cannon/thrall resistance, elemental_weakness, elemental_weakness_percent |
39
- | `bucket("infobox_npc")` | Bucket:Infobox npc | NPC data: id, combat level, examine |
40
- | `bucket("infobox_pure")` | Bucket:Infobox pure | Pure-entity infobox data (verify schema) |
41
- | `bucket("infobox_scenery")` | Bucket:Infobox scenery | Scenery/object entity data |
42
- | `bucket("infobox_ship_part")` | Bucket:Infobox ship part | Ship part data |
43
- | `bucket("infobox_shop")` | Bucket:Infobox shop | Shop data: shop_name, location, owner, specialty, shop_version, is_members_only |
44
- | `bucket("infobox_spell")` | Bucket:Infobox spell | Spell data: requirements, effects, costs |
45
- | `bucket("interface")` | Bucket:Interface | Game interface definitions |
46
- | `bucket("item_id")` | Bucket:Item id | Item name to id mappings |
47
- | `bucket("locline")` | Bucket:Locline | Location line entries |
48
- | `bucket("logs")` | Bucket:Logs | Woodcutting log/tree data |
49
- | `bucket("map")` | Bucket:Map | Map marker/region data |
50
- | `bucket("mine")` | Bucket:Mine | Mining node/rock data |
51
- | `bucket("mmg_output")` | Bucket:Mmg output | Money making guide output calculations |
52
- | `bucket("money_making_guide")` | Bucket:Money making guide | Money making methods: profit, requirements |
53
- | `bucket("music")` | Bucket:Music | Music track unlock data |
54
- | `bucket("music_file")` | Bucket:Music file | Music file metadata |
55
- | `bucket("music_map")` | Bucket:Music map | Music tracks by region/map area |
56
- | `bucket("music_versions")` | Bucket:Music versions | Music version/history entries |
57
- | `bucket("npc_id")` | Bucket:Npc id | NPC name to id mappings |
58
- | `bucket("object_id")` | Bucket:Object id | Object/scenery id mappings |
59
- | `bucket("quest")` | Bucket:Quest | Quest data: requirements, rewards, difficulty |
60
- | `bucket("recipe")` | Bucket:Recipe | Creation/processing recipes: inputs, outputs, skills |
61
- | `bucket("recommended_equipment")` | Bucket:Recommended equipment | Recommended gear setups by activity/slot (schema not available on page - use runtime discovery) |
62
- | `bucket("seachart")` | Bucket:Seachart | Sea chart/naval data |
63
- | `bucket("sound_effect")` | Bucket:Sound effect | Sound effect metadata |
64
- | `bucket("soundtrack")` | Bucket:Soundtrack | Soundtrack track data |
65
- | `bucket("storeline")` | Bucket:Storeline | Store line entries |
66
- | `bucket("testing_bucket")` | Bucket:Testing bucket | Wiki-internal testing data (not real content) |
67
- | `bucket("transcript")` | Bucket:Transcript | NPC/dialogue transcripts |
68
- | `bucket("update")` | Bucket:Update | Game update records: dates, summaries |
69
- | `bucket("varbit")` | Bucket:Varbit | Varbit id to meaning mappings |
70
-
71
- ## Query reminders
72
-
73
- - Query must end in `.run()`; `limit` max 500, paginate with `continueFrom`.
74
- - Equality: `where("field","value")`; operators: `where({"field",">",value})`
75
- with `=`, `!=`, `>`, `<`, `>=`, `<=`; compose with `Bucket.And/Or/Not`.
76
- - Example: `bucket("infobox_item").select("item_id","examine").where("item_name","Raw lobster").run()`
77
- - Full Lua reference: https://meta.weirdgloop.org/w/Extension:Bucket/Usage
78
-
79
- ## Best Practices (MANDATORY)
80
-
81
- - **ALWAYS use `.select("field1","field2")`** - only fetch needed columns
82
- - **ALWAYS use `.where("field","value")`** - filter rows, never fetch all
83
- - **Use `.limit(N)`** - cap results (max 500)
84
- - **Chain filters** with `Bucket.And/Or/Not` for complex conditions
85
- - **NEVER** run `.run()` without `.select()` and `.where()`
86
-
87
- ### Exact Match Only - No Wildcards
88
-
89
- bucket-query uses **exact match only**. To find exact values:
90
- 1. `search-page` for the term → get exact name
91
- 2. Use exact name in bucket query
92
-
93
- Example: "Bob's Axe Shop" → `search-page "bob axe"` → "Bob's Brilliant Axes" → `bucket("infobox_shop").where("shop_name","Bob's Brilliant Axes")`
94
-
95
- ### Example Patterns
96
-
97
- ✅ Good:
98
- ```
99
- bucket("exchange").select("name","value","high_alch").where("name","Abyssal whip").run()
100
- bucket("infobox_shop").select("shop_name","location").where("location","Lumbridge").limit(5).run()
101
- ```
102
-
103
- ❌ Bad (causes context bloat):
104
- ```
105
- bucket("infobox_shop").run()
106
- bucket("exchange").select("*").run()
107
- ```
108
-
109
- ### Pagination
110
- ```lua
111
- bucket("infobox_shop").select("shop_name","location").limit(50).continueFrom("cursor").run()
112
- ```
113
-
114
- ### Common Bucket Patterns (Always use .select() and .where())
115
-
116
- | Task | Bucket Query |
117
- |------|--------------|
118
- | GE prices | `bucket("exchange").select("name","value","high_alch").where("name","Abyssal whip").run()` |
119
- | Monster stats | `bucket("infobox_monster").select("name","combat_level","hitpoints").where("name","Hydra").run()` |
120
- | Item stats | `bucket("infobox_item").select("item_name","value","high_alch").where("item_name","Abyssal whip").run()` |
121
- | Drop sources | `bucket("dropsline").select("source","quantity").where("item","Abyssal whip").run()` |
122
- | Quest requirements | `bucket("quest").select("name","requirements").where("name","Dragon Slayer I").run()` |
123
- | Varbits | `bucket("varbit").select("name","value").where("name","hydra_task").run()` |
124
- | Shop lookup | `bucket("infobox_shop").select("shop_name","location","owner").where("shop_name","Bob's Brilliant Axes").run()` |
125
- | Gear recommendations | `bucket("recommended_equipment").select("item","slot").where("activity","hydra").run()` |
126
-
127
- ### Workflow: Find Exact Values First
128
-
129
- 1. **search-page** for term → get exact name
130
- 2. Use exact name in `bucket-query` with `.where()`
131
-
132
- Example: "best gear for hydra" → `bucket("recommended_equipment").select("item","slot").where("activity","hydra").run()`
133
-
134
- ### Raid/Group Drop Patterns (use get-page, NOT buckets)
135
-
136
- No bucket supports "what drops from source" queries. For raid/group content, use `get-page` on individual source pages:
137
-
138
- | Content | Query |
139
- |---------|-------|
140
- | Tombs of Amascut (ToA) | `get-page "Chest (Tombs of Amascut)"` then `get-page "Tumeken's Warden"`, `get-page "Akkha"`, etc. |
141
- | Chambers of Xeric (CoX) | `get-page "Chambers of Xeric"` then individual boss pages (Olm, Great Olm, etc.) |
142
- | Theatre of Blood (ToB) | `get-page "Theatre of Blood"` then individual boss pages (Maiden, Bloat, Nylocas, Sotetseg, Xarpus, Verzik) |
143
- | General boss drops | `get-page "<Boss Name>"` (e.g., "Zulrah", "Vorkath", "Phantom Muspah") |
144
-
145
- For large pages: `get-page "<Title>" metadata=true` → get section outline → `get-page "<Title>" section=N` for drops section.
146
-
147
- Use page reads (`get-page`, `search-page`) ONLY for unstructured content: lore, mechanics, walkthroughs.
@@ -1,111 +0,0 @@
1
- # Search Strategies
2
-
3
- > When and how to use each search tool effectively.
4
-
5
- ## Tool Comparison
6
-
7
- | Tool | Use Case | Returns |
8
- |------|----------|---------|
9
- | `search-page` | General topic, keyword, phrase | Page titles + snippets (full-text) |
10
- | `search-page-by-prefix` | Known prefix, autocomplete | Page titles only (no snippets) |
11
- | `get-page` (metadata) | Get section outline of known page | Section headings + numbers |
12
-
13
- ## Decision Tree
14
-
15
- ```
16
- Need to find a page?
17
- │
18
- ├─ Know exact title? → get-page "Exact Title"
19
- │
20
- ├─ Know start of title? → search-page-by-prefix "Prefix"
21
- │
22
- ├─ General topic / keywords? → search-page "keywords"
23
- │
24
- └─ Want to browse a category? → get-page "Category:Name"
25
- ```
26
-
27
- ## search-page Best Practices
28
-
29
- ### Do:
30
- - Use specific keywords: `"hydra gear setup"` not `"hydra"`
31
- - Include context: `"prayer flicking technique"` not `"prayer"`
32
- - Use quotes for exact phrases: `"/roll"` or `"drop rate"`
33
-
34
- ### Don't:
35
- - Use single generic words: `"item"`, `"boss"`, `"quest"`
36
- - Overuse - check bucket-index first for structured data
37
-
38
- ### Result Interpretation:
39
- - Snippet shows match context - verify it's the right page
40
- - Page ID/size/timestamp help gauge relevance
41
- - Namespace 0 = main content (what you want)
42
-
43
- ## search-page-by-prefix Best Practices
44
-
45
- ### Do:
46
- - Use when you know the prefix: `"Abyssal "`, `"Dragon "`, `"Barbarian "`
47
- - Short prefixes return more results: `"Dra"` vs `"Dragon "`
48
- - Combine with namespace filter for categories: `namespace: 14`
49
-
50
- ### Don't:
51
- - Use for general topics (use `search-page`)
52
- - Expect snippets - only titles returned
53
-
54
- ## get-page for Section Discovery
55
-
56
- ### Before reading a large page:
57
- ```bash
58
- get-page "Chest (Tombs of Amascut)" metadata=true
59
- ```
60
-
61
- ### Returns:
62
- ```json
63
- {
64
- "sections": [
65
- {"index": 0, "title": "Lead"},
66
- {"index": 1, "title": "Rewards"},
67
- {"index": 2, "title": "Unique drops"},
68
- {"index": 3, "title": "Standard drops"},
69
- {"index": 4, "title": "Supply drops"}
70
- ]
71
- }
72
- ```
73
-
74
- ### Then fetch only what you need:
75
- ```bash
76
- get-page "Chest (Tombs of Amascut)" section=3 # Standard drops
77
- get-page "Chest (Tombs of Amascut)" section=2 # Unique drops
78
- ```
79
-
80
- ### Section 0 = Lead (intro text)
81
- ### Section N = Heading N in the article
82
-
83
- ## Common Search Patterns
84
-
85
- | Goal | Tool | Query |
86
- |------|------|-------|
87
- | Item stats/price | bucket-query | `bucket("exchange").select(...).where("name","...")` |
88
- | Monster stats | bucket-query | `bucket("infobox_monster").select(...).where("name","...")` |
89
- | Where item drops from | bucket-query | `bucket("dropsline").select(...).where("item_name","...")` |
90
- | What boss drops | get-page + metadata | `get-page "Boss Name" metadata=true` → `section=N` |
91
- | Quest requirements | bucket-query | `bucket("quest").select(...).where("name","...")` |
92
- | Gear for activity | bucket-query | `bucket("recommended_equipment").select(...).where("activity","...")` |
93
- | Shop location/items | bucket-query | `bucket("infobox_shop").select(...).where("shop_name","...")` |
94
- | General mechanic/guide | search-page | `search-page "prayer flicking"` |
95
- | Browse category | get-page | `get-page "Category:Bosses"` |
96
- | Find exact title variant | search-page-by-prefix | `search-page-by-prefix "Tumeken"` |
97
-
98
- ## Rate Limit Awareness
99
-
100
- - Each search tool call counts toward MediaWiki rate limit (30/min)
101
- - Prefer bucket-query for structured data (same limit, but returns exact data)
102
- - Use `metadata=true` + `section=N` to minimize page read calls
103
- - Cache results mentally within a conversation - don't re-search
104
-
105
- ## Fallback Chain
106
-
107
- 1. **bucket-query** (if structured data exists) → check `context://bucket-index`
108
- 2. **search-page-by-prefix** (if you know title prefix)
109
- 3. **search-page** (general topic)
110
- 4. **get-page + metadata** (large page, need specific section)
111
- 5. **get-page** (full page, last resort)