Skip to main content
Glama

Search Indexed Code

search_code
Read-onlyIdempotent

Search indexed code definitions and workspace files by symbol or query to return ranked matches with file paths and line numbers.

Instructions

Search indexed code definitions and workspace source files by symbol or query, returning ranked definitions with file and line numbers.

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
pathNoOptional workspace directory to scan.
typeNoDefinition kind filter (function, class, const, file, or any).any
queryYesSymbol name or code search query.
namespaceNoOptional Memoria namespace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and closed-world scope, so the safety profile is covered. The description adds useful context that results are ranked and include file/line locations, but says nothing about result limits, pagination, index staleness, or whether unindexed files are searched.

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?

A single front-loaded sentence that identifies the resource, the input modes, and the return format with no filler. Nothing in it is redundant with the title alone.

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 four-parameter read-only search tool with no output schema, the description adequately covers what is searched and what comes back. The remaining gap is behavioral detail about result volume and index coverage, which is minor relative to tool complexity.

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, making the baseline 3. The description adds only marginal meaning, hinting that 'path' scopes the workspace-files portion of the search, without clarifying the interaction between 'query', 'type', and 'namespace'.

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 two concrete resources ('indexed code definitions and workspace source files') and states the return shape ('ranked definitions with file and line numbers'). It does not differentiate itself from a likely-overlapping sibling such as explain_code, so it falls short of a 5.

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: 'by symbol or query' suggests lookups by name versus free-text, and 'workspace source files' hints at filesystem scanning. There is no explicit when-to-use, when-not-to-use, or named alternative for the case where a conceptual explanation is wanted rather than a location.

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