Skip to main content
Glama

Literal/regex grep over raw doc files

grep_docs
Read-only

Find exact tokens or patterns in raw RedM/RDR3 documentation, including large Lua tables and community-native notes. Use to find every source reference, walkstyle/clipset names such as MP_Style_Casual, scenario keys or framework API symbols. For complete structured data (including propsets, controls, bones, drawable/material components, entity extensions and other named catalogs) prefer discovery_lookup; for model assets use asset_lookup; for callable native hashes/names use lookup_native; for behaviors use semantic_search. grep_docs remains the fallback for unsupported formats or a catalog miss. Optional contextBefore/contextAfter includes surrounding lines; filesOnly returns paths; multiline permits cross-line patterns. Patterns use Rust regex syntax. Prefer targeted patterns over large alternations. Returns path and 1-based line numbers; long lines are windowed around the match. Read surrounding raw content with read_lines({path,start}), including content beyond a document preview. If retrying a failed pattern, populate prior_attempt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
patternYesRust regex pattern (ripgrep engine). Case-insensitive by default. Prefer narrow, single-token patterns over kitchen-sink alternations.
categoryNoLimit to a doc category. The enum lists this server's categories (see list_namespaces).
filesOnlyNoReturn only the list of matching paths (no per-line matches). Cheap for exploration before zoom-in.
multilineNoAllow `.` to match newlines and patterns to span lines (rg -U --multiline-dotall). Use for `(?s)foo.*bar` style.
contextAfterNoInclude N lines after each match (rg -A).
contextBeforeNoInclude N lines before each match (rg -B). Saves follow-up get_document calls when you need surrounding context.
pathSubstringNoSubstring filter on relative doc path, e.g. 'weapons' or 'clothes/cloth_hash_names'.
prior_attemptNoPopulate ONLY when retrying after a previous grep_docs call returned no matches. Skip on first attempts.
caseInsensitiveNoDefault true. Set false for case-sensitive match.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / category / description
      Previous value: -"Limit to a doc category (e.g. discoveries, natives)."New value: +"Limit to a doc category. The enum lists this server's categories (see list_namespaces)."
    • changedInput schema / properties / category / enum
      Previous value: -[
      -  "natives",
      -  "vorp",
      -  "rsgcore",
      -  "oxmysql",
      -  "discoveries",
      -  "jo_libs",
      -  "guides",
      -  "learnings"
      -]New value: +[
      +  "natives",
      +  "vorp",
      +  "rsgcore",
      +  "oxmysql",
      +  "discoveries",
      +  "jo_libs",
      +  "cfx",
      +  "guides",
      +  "learnings"
      +]
  2. Changed3 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / prior_attempt / additionalProperties
      Removed value: -false
  3. Changed1 schema field changed
    • addedInput schema / properties / prior_attempt
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Populate ONLY when retrying after a previous grep_docs call returned no matches. Skip on first attempts.",
      +  "properties": {
      +    "pattern": {
      +      "description": "The previous pattern you tried.",
      +      "type": "string"
      +    },
      +    "why_unhelpful": {
      +      "description": "Why it didn't return what you needed (1 sentence).",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "pattern",
      +    "why_unhelpful"
      +  ],
      +  "type": "object"
      +}
  4. Changed5 schema fields changed
    • addedInput schema / properties / contextAfter
      Added value: +{
      +  "description": "Include N lines after each match (rg -A).",
      +  "maximum": 10,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / contextBefore
      Added value: +{
      +  "description": "Include N lines before each match (rg -B). Saves follow-up get_document calls when you need surrounding context.",
      +  "maximum": 10,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / filesOnly
      Added value: +{
      +  "description": "Return only the list of matching paths (no per-line matches). Cheap for exploration before zoom-in.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / multiline
      Added value: +{
      +  "description": "Allow `.` to match newlines and patterns to span lines (rg -U --multiline-dotall). Use for `(?s)foo.*bar` style.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / pattern / description
      Previous value: -"JS regex pattern. Case-insensitive by default."New value: +"Rust regex pattern (ripgrep engine). Case-insensitive by default. Prefer narrow, single-token patterns over kitchen-sink alternations."
  5. First observed

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint/destructiveHint=false, so safety is covered. The description adds return behavior (path + 1-based line numbers, long lines windowed), multiline semantics, and retry guidance via prior_attempt, which is real behavioral value beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then alternatives, then parameter notes, then retry guidance. It is dense and long for a description, but nearly every clause carries actionable information, so waste is minimal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, but the description compensates by describing the return shape (paths and 1-based line numbers) and windowing. It also points to read_lines for surrounding content, covering the follow-up gap for a 10-parameter tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 90%, so the baseline is 3, and the description still adds meaning: Rust regex syntax, case-insensitive-by-default, filesOnly returning only paths, and contextBefore/contextAfter including surrounding lines. It also advises preferring targeted patterns over large alternations.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: finding exact tokens/patterns in raw RedM/RDR3 docs including Lua tables and native notes. It names concrete use targets (walkstyle names like MP_Style_Casual, scenario keys, framework symbols) that pin down the resource precisely.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent: prefer discovery_lookup for structured catalogs, asset_lookup for model assets, lookup_native for callable natives, semantic_search for behaviors, and reserves grep_docs as the fallback for unsupported formats or catalog misses. Both when-to-use and when-not-to-use are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources