Skip to main content
Glama

Literal/regex grep over raw doc files

grep_docs
Read-only

Find exact tokens or patterns in raw 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, framework API symbols, propsets, vehicle bones, drawable/material data or entity extensions. For complete animation/audio/IMAP/clothing/wearable/particle/flag/texture records prefer discovery_lookup; for ped/weapon/object/door/vehicle models use asset_lookup; for callable native hashes/names use lookup_native; for behavior explanations 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.7/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses return behavior: 'Returns path and 1-based line numbers; long lines are windowed around the match.' It also explains syntax constraints, case handling, and points to read_lines for raw content access. No contradiction with annotations.

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

Conciseness5/5

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

The description is dense but front-loaded: purpose first, then sibling routing, then parameter/return details. The long example list and fallback explanation all earn their place in guiding search behavior.

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

Completeness5/5

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

With 10 parameters and no output schema, the description covers return format, line numbering, long-line windowing, context options, retry behavior via prior_attempt, and linkage to read_lines. Schema covers the remaining parameter details, so nothing essential is left unexplained.

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

Parameters3/5

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

Schema description coverage is 90%, so the schema already documents almost every parameter. The description mostly repeats parameter behavior (contextBefore/contextAfter, filesOnly, multiline, Rust regex) rather than adding new parameter-specific semantics; therefore it stays at the high-coverage baseline.

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?

The description opens with a concrete verb and resource ('Find exact tokens or patterns in raw documentation') and gives concrete examples of searchable entities. It also distinguishes itself from sibling tools by naming discovery_lookup, asset_lookup, lookup_native, and semantic_search as alternatives.

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?

Explicit when-to-use guidance is present: 'Use to find every source reference...' and 'grep_docs remains the fallback for unsupported formats or a catalog miss.' It also tells when to prefer each sibling tool, which is strong routing guidance.

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