Skip to main content
Glama

Search project

search_project
Read-onlyIdempotent

Search project file contents with a timed .NET regex to locate symbols, phrases, or declarations, returning grouped matches with context and continuation for code inspection.

Instructions

Searches transformed text with a timed .NET regex. It matches file content, never paths; find names with get_tree include_patterns. Use it for symbols or phrases; symbols=true finds declarations, not uses; use related_files for dependency links. Returns grouped numbered matches, merged context, complete|partial status, inspected/retained/written counts, and continuation. Line numbers use returned text; generated redaction replacements never match. Key parameters: pattern, paths, context_lines, ignore_case, max_results=1..200, include_patterns, exclude_patterns, and max_file_bytes. The best unique declaration includes up to 1,800 protected body characters within the same cap.

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": {
      "pattern": "<pattern>"
    },
    "name": "search_project"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathsNoNarrows selection to literal paths for existing project-relative files or directories; glob characters are ordinary.
patternYesRequired .NET regex with a 2-second timeout over redacted file content, never paths; use get_tree include_patterns for names. Text inserted by redaction never matches.
symbolsNoMatch declarations of the name in pattern (Foo, class Foo, Foo|Bar), not uses; a regular expression is searched as text instead.
ignore_caseNoEnables case-insensitive matching; accepts a boolean or its string form.
max_resultsNoLimits displayed match lines while scanning continues; the boundary reports encountered, retained, and written counts.
context_linesNoContext lines per match; overlapping windows merge.
max_file_bytesNoExcludes selected files larger than this byte count; accepts an integer or numeric string.
exclude_patternsNoRemoves paths with the same project-relative glob syntax as include_patterns.
include_patternsNoNarrows with project-relative '/' globs: '*' and '?' stay in one segment, '**/' spans depths, and '{a,b}' alternates; matching is case-sensitive, while '!' and '[...]' are rejected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changedv5.2.5
    • removedInput schema / properties / branch
      Removed value: -{
      -  "description": "Remote Git branch; invalid for local projects.",
      -  "minLength": 1,
      -  "type": "string"
      -}
    • changedInput schema / properties / context_lines / oneOf
      Previous value: -[
      -  {
      -    "maximum": 20,
      -    "minimum": 0,
      -    "type": "integer"
      -  },
      -  {
      -    "pattern": "^[0-9]+$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "maximum": 20,
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / exclude_patterns / oneOf
      Previous value: -[
      -  {
      -    "maxLength": 512,
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  {
      -    "items": {
      -      "maxLength": 512,
      -      "minLength": 1,
      -      "type": "string"
      -    },
      -    "maxItems": 256,
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / git_scope
      Removed value: -{
      -  "description": "Narrows to staged, changed (including untracked files), or diff:<ref>..<ref> paths; content stays from the current working tree.",
      -  "maxLength": 4096,
      -  "oneOf": [
      -    {
      -      "enum": [
      -        "staged",
      -        "changes"
      -      ],
      -      "type": "string"
      -    },
      -    {
      -      "pattern": "^diff:(?!.*\\.\\.\\.)(?!.*\\.\\..*\\.\\.)[^\\s-]\\S*\\.\\.[^\\s-]\\S*$",
      -      "type": "string"
      -    }
      -  ]
      -}
    • changedInput schema / properties / include_patterns / oneOf
      Previous value: -[
      -  {
      -    "maxLength": 512,
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  {
      -    "items": {
      -      "maxLength": 512,
      -      "minLength": 1,
      -      "type": "string"
      -    },
      -    "maxItems": 256,
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / max_file_bytes / oneOf
      Previous value: -[
      -  {
      -    "minimum": 1,
      -    "type": "integer"
      -  },
      -  {
      -    "pattern": "^0*[1-9][0-9]*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / max_results / oneOf
      Previous value: -[
      -  {
      -    "maximum": 200,
      -    "minimum": 1,
      -    "type": "integer"
      -  },
      -  {
      -    "pattern": "^0*[1-9][0-9]*$",
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "maximum": 200,
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / paths / oneOf
      Previous value: -[
      -  {
      -    "maxLength": 4096,
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  {
      -    "items": {
      -      "maxLength": 4096,
      -      "minLength": 1,
      -      "type": "string"
      -    },
      -    "maxItems": 256,
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / pattern / maxLength
      Removed value: -4096
    • removedInput schema / properties / pattern / minLength
      Removed value: -1
    • removedInput schema / properties / project
      Removed value: -{
      -  "description": "unique listed name, absolute path returned by list_projects, or #index.",
      -  "type": "string"
      -}
    • changedInput schema / properties / symbols / description
      Previous value: -"Match declarations of the name in pattern (Foo, class Foo, Foo|Bar), not uses."New value: +"Match declarations of the name in pattern (Foo, class Foo, Foo|Bar), not uses; a regular expression is searched as text instead."
    • removedInput schema / properties / tracked_only
      Removed value: -{
      -  "default": false,
      -  "description": "Restricts results to Git-tracked files; accepts a boolean or its string form.",
      -  "oneOf": [
      -    {
      -      "type": "boolean"
      -    },
      -    {
      -      "enum": [
      -        "true",
      -        "false"
      -      ],
      -      "type": "string"
      -    }
      -  ]
      -}
  2. Changed21 schema fields changedv5.2.0
    • changedInput schema / properties / branch / description
      Previous value: -"Optional Git branch for a remote project URL; invalid for local project paths."New value: +"Remote Git branch; invalid for local projects."
    • changedInput schema / properties / context_lines / description
      Previous value: -"Context lines from 0 to 20; default 2; integer or numeric string."New value: +"Context lines per match; overlapping windows merge."
    • changedInput schema / properties / exclude_patterns / description
      Previous value: -"Project-relative glob patterns using '/' to exclude additional paths."New value: +"Removes paths with the same project-relative glob syntax as include_patterns."
    • removedInput schema / properties / exclude_patterns / items
      Removed value: -{
      -  "maxLength": 512,
      -  "minLength": 1,
      -  "type": "string"
      -}
    • removedInput schema / properties / exclude_patterns / maxItems
      Removed value: -256
    • addedInput schema / properties / exclude_patterns / oneOf
      Added value: +[
      +  {
      +    "maxLength": 512,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "maxLength": 512,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "maxItems": 256,
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / exclude_patterns / type
      Removed value: -"array"
    • changedInput schema / properties / git_scope / description
      Previous value: -"Further restrict results to staged files, all current changes, or files changed between two Git refs."New value: +"Narrows to staged, changed (including untracked files), or diff:<ref>..<ref> paths; content stays from the current working tree."
    • changedInput schema / properties / ignore_case / description
      Previous value: -"Case-insensitive matching; accepts a boolean or the string 'true' or 'false'."New value: +"Enables case-insensitive matching; accepts a boolean or its string form."
    • changedInput schema / properties / include_patterns / description
      Previous value: -"Project-relative glob patterns using '/'. They only narrow built-in and gitignore filtering."New value: +"Narrows with project-relative '/' globs: '*' and '?' stay in one segment, '**/' spans depths, and '{a,b}' alternates; matching is case-sensitive, while '!' and '[...]' are rejected."
    • removedInput schema / properties / include_patterns / items
      Removed value: -{
      -  "maxLength": 512,
      -  "minLength": 1,
      -  "type": "string"
      -}
    • removedInput schema / properties / include_patterns / maxItems
      Removed value: -256
    • addedInput schema / properties / include_patterns / oneOf
      Added value: +[
      +  {
      +    "maxLength": 512,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "maxLength": 512,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "maxItems": 256,
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / include_patterns / type
      Removed value: -"array"
    • changedInput schema / properties / max_file_bytes / description
      Previous value: -"Exclude otherwise selected files strictly larger than this byte count; integer or numeric string."New value: +"Excludes selected files larger than this byte count; accepts an integer or numeric string."
    • changedInput schema / properties / max_results / description
      Previous value: -"Maximum matches from 1 to 200; default 50; integer or numeric string."New value: +"Limits displayed match lines while scanning continues; the boundary reports encountered, retained, and written counts."
    • addedInput schema / properties / paths
      Added value: +{
      +  "description": "Narrows selection to literal paths for existing project-relative files or directories; glob characters are ordinary.",
      +  "oneOf": [
      +    {
      +      "maxLength": 4096,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    {
      +      "items": {
      +        "maxLength": 4096,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "maxItems": 256,
      +      "type": "array"
      +    }
      +  ]
      +}
    • changedInput schema / properties / pattern / description
      Previous value: -"A .NET regular expression evaluated against redacted text with a 2-second timeout."New value: +"Required .NET regex with a 2-second timeout over redacted file content, never paths; use get_tree include_patterns for names. Text inserted by redaction never matches."
    • changedInput schema / properties / project / description
      Previous value: -"Absolute root path returned by list_projects, or a Git URL when the server allows remote sources. Optional only when one local root is configured."New value: +"unique listed name, absolute path returned by list_projects, or #index."
    • addedInput schema / properties / symbols
      Added value: +{
      +  "default": false,
      +  "description": "Match declarations of the name in pattern (Foo, class Foo, Foo|Bar), not uses.",
      +  "oneOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "enum": [
      +        "true",
      +        "false"
      +      ],
      +      "type": "string"
      +    }
      +  ]
      +}
    • changedInput schema / properties / tracked_only / description
      Previous value: -"Restrict results to files tracked by Git; accepts a boolean or the string 'true' or 'false'."New value: +"Restricts results to Git-tracked files; accepts a boolean or its string form."
  3. First observedv5.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the readOnly/idempotent/closed-world annotations, it discloses the 2-second regex timeout, that content is redacted before matching and redaction-inserted text never matches, that max_results truncates display while scanning continues, and that results carry complete|partial status plus continuation. That is substantial added context; only the return-shape detail is slightly under-specified for a complex search tool.

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

Conciseness3/5

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

The most important constraints (content not paths, alternative tool) are front-loaded and the prose is dense with signal rather than filler. However, the trailing 'Key parameters: …' roster restates the 100%-covered schema, and the final sentence about 1,800 protected body characters 'within the same cap' is cryptic enough that a reader cannot act on it, so several words do not fully earn their place.

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 and nine parameters, the description still explains the response contract: grouped numbered matches, merged context, complete|partial status, inspected/retained/written counts, and continuation. It also states the line-number convention and the redaction caveat. Nothing an agent needs to invoke or interpret this tool correctly appears to be 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 coverage is 100%, so the schema already documents pattern, paths, symbols, context_lines, ignore_case, max_file_bytes, and the glob parameters, and much of the description's 'Key parameters' list merely repeats that. The one genuine addition is the note that the best unique declaration includes up to 1,800 protected body characters within the same cap, but phrasing is opaque enough to be only marginally useful. Baseline 3 is appropriate.

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 opening sentence names a specific verb and resource ('Searches transformed text with a timed .NET regex') and immediately bounds scope ('matches file content, never paths'), then routes path-name lookups to get_tree include_patterns. An agent can distinguish this from get_tree, related_files, and get_file without inspecting any 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?

It gives explicit selection rules: use it for symbols or phrases, set symbols=true for declarations rather than uses, use related_files for dependency links, and use get_tree include_patterns for names. Both when-to-use and the alternative for the excluded case are stated, leaving little to inference.

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