Skip to main content
Glama

search_text

Read-onlyIdempotent

Search codebases for strings, regex, comments, TODOs, config values, and error messages across indexed files. Filter by file glob or language; secret .env values are excluded.

Instructions

Full-text search across all indexed files. Supports regex, glob file patterns, language filter. Use for finding strings, comments, TODOs, config values, error messages — anything not captured as a symbol. Skips .env files: secret values are never searched or returned, use get_env_vars for env keys. For symbol search (functions, classes) use search instead. Read-only. Returns JSON: { files: [{ file, language, hits: [{ line, column, match, context }] }], total_matches } — hits grouped per file, so a long path is paid once. Pass grouping: "flat" for the ungrouped matches[] shape.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch string or regex pattern
groupingNoPayload shape. "by_file" (default) groups hits per file, so a long path is paid once; "flat" is a single matches[] array.by_file
is_regexNoTreat query as regex (default false)
languageNoFilter by language (e.g. "typescript", "python")
timeout_msNoWall-clock budget in ms — caps a catastrophic-backtracking regex. Default 2000; 0 disables.
max_resultsNoMax matches to return (default 50)
file_patternNoGlob filter, e.g. "src/**/*.ts"
context_linesNoLines of context before/after each match (default 0 — set higher if you need surrounding code)
case_sensitiveNoCase-sensitive search (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv3.22.0
    • changedInput schema / properties / grouping / default
      Previous value: -"flat"New value: +"by_file"
    • changedInput schema / properties / grouping / description
      Previous value: -"Payload shape. \"flat\" (default) is a single matches[] array; \"by_file\" groups hits per file — saves tokens on long paths with many hits."New value: +"Payload shape. \"by_file\" (default) groups hits per file, so a long path is paid once; \"flat\" is a single matches[] array."
    • changedInput schema / required
      Previous value: -[
      -  "query",
      -  "file_pattern"
      -]New value: +[
      +  "query"
      +]
  2. Changed3 schema fields changedv3.3.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • changedInput schema / properties / grouping / description
      Previous value: -"Payload shape. \"flat\" returns a single matches[] array (default). \"by_file\" groups hits under each file — saves tokens on long paths with many hits."New value: +"Payload shape. \"flat\" (default) is a single matches[] array; \"by_file\" groups hits per file — saves tokens on long paths with many hits."
    • changedInput schema / properties / timeout_ms / description
      Previous value: -"Wall-clock budget in milliseconds. Catastrophic-backtracking regex cannot pin a worker beyond this. Default 2000. Set 0 to disable."New value: +"Wall-clock budget in ms — caps a catastrophic-backtracking regex. Default 2000; 0 disables."
  3. Addedv1.41.0
  4. Removedv1.38.0
  5. Changed3 schema fields changedv1.35.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / timeout_ms
      Added value: +{
      +  "description": "Wall-clock budget in milliseconds. Catastrophic-backtracking regex cannot pin a worker beyond this. Default 2000. Set 0 to disable.",
      +  "maximum": 30000,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "query"
      -]New value: +[
      +  "query",
      +  "file_pattern"
      +]
  6. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare read-only and idempotent, but the description adds substantial behavioral detail: it skips .env files (secrets never searched/returned), describes the return JSON shape and grouping behavior, and mentions the timeout parameter's purpose (caps catastrophic-backtracking regex). This goes beyond the annotations and provides context an agent needs.

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?

Although the description is lengthier than average, every sentence earns its place. It front-loads the purpose, then usage, then behavioral and return details, with no redundancy. The structure is logical and each sentence adds substantive information, making it efficient despite its length.

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?

Given the tool's complexity (9 parameters, no output schema), the description is remarkably complete. It covers the return JSON shape (since no output schema exists), usage scenarios, exclusions, alternatives, and even explains grouping and timeout behavior. An agent can confidently invoke this tool correctly without additional context.

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 description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by explaining the 'grouping' parameter's trade-off ('hits grouped per file, so a long path is paid once') and the 'timeout_ms' rationale (caps catastrophic-backtracking regex). While not all parameters get extra semantics, the added context is valuable, earning a 4.

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 states a specific verb and resource ('Full-text search across all indexed files') and explicitly differentiates from the sibling 'search' by stating 'For symbol search (functions, classes) use search instead.' It also enumerates the types of content it targets (strings, comments, TODOs, config values, error messages), making the purpose unambiguous.

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?

It gives explicit usage guidance: 'Use for finding strings, comments, TODOs, config values, error messages — anything not captured as a symbol.' It also specifies when not to use it (symbol search) and directs the agent to 'get_env_vars' for environment keys, covering exclusions and alternatives clearly.

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