Skip to main content
Glama
mcp-server-repo-context

mcp-server-repo-context

search_code

Search a repository for text or regex queries and return matching file paths, line numbers, and lines, with optional include/exclude globs to narrow results.

Instructions

Search the repository for a text or regex query; returns path, line number, and the matching line.

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_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYes
regexNo
excludeNoGlob patterns to exclude
includeNoGlob patterns to include, e.g. ['*.py', 'src/**']
max_resultsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the return shape, which compensates for the absent output schema, but says nothing about read-only safety, whether it scans the working tree or history, case sensitivity, default matching mode, or the 200-result cap.

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?

A single front-loaded sentence with no filler; the return-value clause is arguably the least essential part but still earns its place given there is no output schema.

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

Completeness2/5

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

For a five-parameter, annotation-free tool with low schema coverage and no output schema, the description leaves too much open: matching semantics, filter interplay, result limits, and safety profile are all undocumented. It is adequate for identifying the tool but not for calling it correctly in edge cases.

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

Parameters2/5

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

Schema coverage is only 40% across five parameters. The description mentions a 'regex query' but does not explain that the boolean regex flag toggles interpretation of query, nor does it describe include/exclude glob behavior, max_results, or any defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Search the repository for a text or regex query') and adds the return shape (path, line number, matching line). It is clearly distinguishable from siblings like read_file and repo_tree, though it never names or contrasts them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit when-to-use or when-not-to-use guidance, and no mention of alternatives such as repo_tree for structure or read_file for a known file. An agent must infer that this is the brute-force text locator from the name alone.

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