Skip to main content
Glama

Grep across projects

grep
Read-only

Search one or many Overleaf projects for exact text or regex patterns, returning file:line matches with optional context from auto-refreshed local snapshots.

Instructions

Exact text or regex search (ripgrep) across one or many projects, with file:line results and optional context. Uses local snapshots that refresh automatically when Overleaf reports changes. For topic-style questions use "search" instead.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "grep"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesText to find, or a regex when regex is true
regexNoTreat query as a regular expression (default false: plain text)
excludeNoGlob patterns of files to skip, e.g. ["*.bib"]
includeNoGlob patterns of files to search, e.g. ["*.tex"] or ["chapters/**"]
refreshNoRe-download the projects before searching
projectsNoProjects to cover: a list of names/ids, or "all". Defaults to the pinned projects, or the 25 most recently updated if none are pinned.
wholeWordNoOnly match whole words (default false)
maxResultsNoMost matches to return (default 100)
contextLinesNoLines of context around each match (default 1)
caseSensitiveNoDefault: smart case (case-insensitive unless the query has capitals)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.1.4
    • addedInput schema / properties / exclude / description
      Added value: +"Glob patterns of files to skip, e.g. [\"*.bib\"]"
    • changedInput schema / properties / maxResults / description
      Previous value: -"Default 100"New value: +"Most matches to return (default 100)"
    • addedInput schema / properties / regex / description
      Added value: +"Treat query as a regular expression (default false: plain text)"
    • addedInput schema / properties / wholeWord / description
      Added value: +"Only match whole words (default false)"
  2. First observedv2.1.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, openWorldHint=true), so the description's job is to add context — and it does, disclosing that searches run against local snapshots that refresh automatically when Overleaf reports changes, which signals potential staleness. It also describes the file:line output and optional context lines. It stops short of stating failure behavior or how the snapshot staleness interacts with the 'refresh' flag beyond what the schema says.

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?

Three short sentences, zero redundancy: capability and output shape first, data-freshness caveat second, sibling routing last. Every sentence carries distinct information.

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?

For a 10-parameter tool the description covers purpose, result format, data-freshness behavior, and the alternative tool, with the fully-annotated schema handling parameter detail. The only thin spot is interaction between the snapshot model and the explicit refresh option, but nothing essential to a correct call is missing.

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 100%, so every parameter is already documented with defaults and examples, making 3 the baseline. The description adds little parameter-level meaning beyond noting 'optional context' and regex-capable queries, both of which the schema already states.

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 and resource ('Exact text or regex search (ripgrep) across one or many projects'), names the underlying engine, and describes the result shape (file:line). It explicitly separates itself from the sibling 'search' tool, so an agent can discriminate without opening the schema.

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 topic-style questions to 'search' instead, giving both the condition and the alternative. The phrase 'exact text or regex' also implies when this tool is the right pick over semantic lookup.

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