Literal/regex grep over raw doc files
grep_docsFind an EXACT literal token in raw doc files (markdown + lua). Use for specific weapon/ped/animation/prop/interior/zone names (weapon_pistol_volcanic, a_c_bear_01, p_campfire01x), known hashes (0x020D13FF), walkstyles/clipsets (MP_Style_Casual, mech_loco_m@), or any string you'd grep for. NOT for behavior/concept queries (use semantic_search) or script-native hash/name lookup (use lookup_native). REQUIRED for tokens inside the largest rdr3_discoveries data tables (audio_banks, ingameanims_list, cloth_drawable, cloth_hash_names, object_list, megadictanims, entity_extensions, imaps_with_coords, propsets_list, vehicle_bones) — only preview-indexed for embeddings, so semantic_search will NOT find tokens in them. Optional: contextBefore/contextAfter for ±N surrounding lines (saves a follow-up get_document call); filesOnly: true to get paths only (cheap exploration); multiline: true for cross-line patterns ((?s)foo.*bar). Pattern uses Rust regex syntax (rg engine). PREFER one targeted call over giant a|b|c|d|e alternations — split into separate calls; alternations rarely improve recall and bloat the regex automaton. Returns matched lines with path + line number. Long matched lines are windowed ±60 chars around the match (…); to read around a hit, use read_lines({path, start}) for the preview-only mega-tables listed above (get_document holds only their ~80-line head), or get_document({path}) for ordinary docs. If you are retrying after a previous pattern returned no matches, populate prior_attempt so the server can record what didn't work and steer alternative spellings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| pattern | Yes | Rust regex pattern (ripgrep engine). Case-insensitive by default. Prefer narrow, single-token patterns over kitchen-sink alternations. | |
| category | No | Limit to a doc category (e.g. discoveries, natives). | |
| filesOnly | No | Return only the list of matching paths (no per-line matches). Cheap for exploration before zoom-in. | |
| multiline | No | Allow `.` to match newlines and patterns to span lines (rg -U --multiline-dotall). Use for `(?s)foo.*bar` style. | |
| contextAfter | No | Include N lines after each match (rg -A). | |
| contextBefore | No | Include N lines before each match (rg -B). Saves follow-up get_document calls when you need surrounding context. | |
| pathSubstring | No | Substring filter on relative doc path, e.g. 'weapons' or 'clothes/cloth_hash_names'. | |
| prior_attempt | No | Populate ONLY when retrying after a previous grep_docs call returned no matches. Skip on first attempts. | |
| caseInsensitive | No | Default true. Set false for case-sensitive match. |