Skip to main content
Glama

search_code

Search indexed code symbols by name, qualified name, kind, language, file, export status, and cyclomatic complexity to locate matching functions, classes, or other nodes.

Instructions

Multi-criteria search across indexed symbols filtering by name, qualified name, kind, language, file, export status, and cyclomatic complexity.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindsNoList of node kinds (Function, Class, Struct, Interface, etc.).
limitNoMaximum results to return (default 50).
offsetNoPagination offset.
languagesNoList of languages to include.
file_patternNoFile path pattern (* / ? / substring).
name_patternNoSymbol name pattern (* / ? / substring).
exported_onlyNoWhen true, match only exported symbols.
qname_patternNoQualified name pattern (* / ? / substring).
max_complexityNoMaximum cyclomatic complexity filter (0 means unbounded).
min_complexityNoMinimum cyclomatic complexity filter.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden and leaves most of it unaddressed. It never states whether filters combine with AND semantics, whether pattern matching is case-sensitive, how results are ordered, or what happens when results exceed the limit. The read-only nature is only implied by "search," not declared.

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 dense sentence with no wasted framing, and the core action is front-loaded before the filter list. It is efficient, though the unbroken enumeration reads as a schema restatement rather than structured guidance.

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 ten-parameter tool with zero annotations and no output schema, the definition is thin. It does not describe the returned symbol records, ordering, or pagination interaction with the limit and offset parameters, leaving meaningful gaps an agent would need to guess at before calling it.

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 one of the ten parameters is already documented in the schema, which sets the baseline at 3. The description merely restates the filter categories in prose and adds no semantics beyond the schema, such as precedence between conflicting filters or the default behavior when a filter is omitted.

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?

"Multi-criteria search across indexed symbols" gives a specific verb and resource, and the enumeration of filter dimensions (name, qualified name, kind, language, file, export status, complexity) makes the scope concrete. It stops short of distinguishing this from siblings like find_symbol or file_outline, so the agent must infer which one is appropriate.

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, when-not-to-use, or named alternative. The phrase "multi-criteria" faintly implies this is the tool for combining several filters, but that is inference rather than guidance, and the definition never says how this relates to find_symbol or the outline tools.

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