Skip to main content
Glama

Search the project

search_project
Read-only

Search an Overleaf project's .tex, .bib, and other text files for a literal string or regular expression, returning matching lines as path:line to locate terms, labels, or citations.

Instructions

Search the project's text sources for a literal string or a regular expression, returning matching lines as path:line: text. Use it to find where a term, citation key, label or command appears when you do not know which file holds it; once you do, use read_file, with sectionTitle for one section, and use read_project (view files) to find a file by name. Only .tex, .ltx, .bib, .cls, .sty, .bst, .txt and .md files are searched, and a file created locally is not searched until push_changes commits it. Both modes are case-insensitive and match one line at a time, so a pattern cannot span lines. A regular expression uses JavaScript syntax, sees the first 4,000 characters of each line, and is abandoned with an error after 10 seconds; an invalid one fails with its syntax error. maximumMatches counts matching lines, taken in path order. Pulls from Overleaf first.

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": "search_project"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesWhat to look for. Literal text by default, so LaTeX backslashes need no escaping; a regular expression when isRegularExpression is true.
projectNoWhich project to use: its Overleaf address, its 24-character id, or a registered project name. Omit to use the default project.
maximumMatchesNoStop after this many matches, between 1 and 500 (default 100).
isRegularExpressionNoTreat query as a regular expression instead of literal text (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.8

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description goes well beyond them. It discloses the searched file-type allowlist, that locally created files are invisible until push_changes commits, that matching is case-insensitive and line-bounded, that regexes are JavaScript-flavored with a 4,000-character line window and a 10-second abort, and that results are pulled from Overleaf first (a freshness caveat).

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 and return format, then constraints — no filler sentences. It is on the dense side, with several constraints packed into single sentences (the regex clause especially), but every sentence carries information an agent needs before calling.

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 no output schema, the description supplies the return format, truncation semantics via maximumMatches, the error behavior for invalid regexes, and the staleness caveat about unpushed files. Nothing material for correct invocation or result interpretation is missing.

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 100%, so the baseline is 3, but the description adds real meaning: maximumMatches counts matching lines and is applied in path order, and the regex mode's 4,000-character window and time limit constrain what query can express. It does not restate the literal-vs-regex escaping rule beyond what the schema already says for query.

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 the specific verb and resource ("Search the project's text sources") plus the two query modes and the exact return shape ("path:line: text"). It is clearly distinguishable from read_file and read_project, both of which are named and contrasted.

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?

Gives an explicit when-to-use trigger: "find where a term, citation key, label or command appears when you do not know which file holds it." It then routes onward, naming read_file (with sectionTitle) for a known section and read_project for finding a file by name — the alternatives and the conditions selecting them are spelled out.

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