Skip to main content
Glama

kernel_code_search

Search project source code with regex patterns and file glob filters to locate matching lines and file paths; results are restricted to the src/ directory.

Instructions

Search for a pattern in the project source code (grep). Returns matching lines with file paths. Restricted to src/ directory.

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

Input Schema

NameRequiredDescriptionDefault
globNoFile glob filter (e.g. '*.ts', '*.svelte'). Default: all files
patternYesSearch pattern (regex supported)
max_resultsNoMax results (default: 30)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.1

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does meaningful work: it discloses the output format (matching lines with file paths) and a hard scope constraint ('Restricted to src/ directory') that would otherwise surprise an agent. It does not discuss regex failure behavior or result truncation semantics beyond the schema's max_results.

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?

Three short sentences with zero waste: capability first, return value second, scope restriction third. Every sentence contributes information an agent needs before calling.

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

Completeness4/5

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

For a simple three-parameter search tool with no output schema and no annotations, the definition covers what it does, what it returns, and a key limitation. It could add a line about the read-only nature and behavior when no matches are found, but nothing essential is 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 description coverage is 100% and all three parameters (pattern, glob, max_results) are documented in the schema, so the baseline is 3. The description adds only the phrase 'regex supported' by implication of grep, without elaborating on glob or result-count behavior.

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 states a specific verb and resource — searching for a pattern in project source code, characterized as grep — and notes the return shape (matching lines with file paths). It implicitly separates itself from kernel_code_read (whole-file read) and kernel_code_run (execution), though it never names those siblings.

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

Usage Guidelines3/5

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

Usage is only implied: 'Search for a pattern' suggests exploratory lookup rather than reading a known file, but there is no explicit when-to-use or when-not guidance and no mention of kernel_code_read as the alternative for targeted file reads.

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

Deploy Server

Other Tools