Skip to main content
Glama

Search files

code_grep
Read-only

Find matching lines under an address, as path and line number: a literal string unless regex, optionally with lines of context.

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>",
      "path": "<path>",
      "org": "<org>"
    },
    "name": "code_grep"
  }
}

Input Schema

NameRequiredDescriptionDefault
orgYesslug of the organization whose trees and sites to use. Required on every call, even when only one organization is listed; a path never names it.
pathYesWhere to search, <tree>:<path>; <tree>: is the whole tree.
limitNoAt most this many matches.
regexNoRead pattern as a regular expression.
contextNoLines of context around each match.
patternYesThe text, or with regex a JavaScript regular expression.
ignoreCaseNoMatch regardless of case.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds genuinely new behavioural detail by stating the result shape (path plus line number) and that pattern matching is literal by default unless regex is set, which matters because there is no output schema. It says nothing about truncation, ordering, or what happens when limit is hit.

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?

It is a single compact sentence with the core action front-loaded and the result shape immediately after the colon. Nothing is redundant, though the phrasing is dense enough that 'under an address' takes a moment to parse.

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

Completeness3/5

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

For a seven-parameter, three-required search tool with no output schema, the description covers the action and the return shape adequately, and the schema carries the org/path addressing rules. It omits result-count limits, ordering, and match-count behaviour, which an agent would want when deciding how to page or narrow a search.

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 in the schema and the baseline of 3 applies. The description reinforces the literal-versus-regex default and the optional context lines, but adds no syntax, formatting, or addressing detail beyond what the schema already states.

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?

The description names a specific verb and resource: it finds matching lines beneath a given address, which pins it down as a grep-style content search rather than a file reader or lister. It does not contrast itself with neighbours like code_read, code_tree, or wiki_search, so sibling differentiation is left to the name.

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 when-to-use or when-not-to-use statement, and no named alternative for the common adjacent tasks (reading a whole file, listing a tree, searching wiki content). An agent can infer that this is for locating text inside files, but nothing in the text routes it away from the wrong sibling.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources