Skip to main content
Glama

ctx_search

Search a codebase for symbols or file paths by name, returning JSON with definitions, signatures, and locations. Use it to locate functions, classes, or types before reading them.

Instructions

Search the project's code graph for symbols or file paths by name and return JSON. Symbol results give {name, parent, kind, path, line, signature}; with files=true results give {path, language, size}. Use to find where a function/class/type is defined before reading it, or to locate files by path fragment. Use ctx_symbol for deep detail on a single exact symbol, and ctx_impact to see what depends on a match. query is a case-insensitive substring/name match. Constrain with kind (function, method, class, struct, trait, enum, interface, type, constant, variable, module, field, constructor, impl) and limit results (default 50, 1-500).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoOptional: narrow results to this symbol kind. Omit to match any kind.
filesNoWhen true, search file paths instead of symbols and return {path, language, size}. Default false.
limitNoMaximum number of results. Default 50.
queryYesCase-insensitive substring to match against symbol names or (when files=true) file paths. Required. Empty or very short queries return many results.
Behavior4/5

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

There are no annotations, so the description carries the full disclosure burden. It does this well by specifying the JSON output shapes for both symbol and file modes, explaining that query matching is case-insensitive substring matching, and noting the default limit. It stops short of describing result ordering, error behavior, or empty-result behavior, but the core operational behavior is clearly disclosed.

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?

The description is dense but well-structured, leading with the core action, then result shapes, then use cases, then alternatives, then matching semantics, then constraints. Every sentence adds distinct information, and the most important behavioral guidance is front-loaded.

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

Completeness5/5

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

For a search tool with no output schema and no annotations, this description is complete: it covers what the tool returns, when to use it vs alternatives, how query matching works, how to constrain results with kind and limit, and the file-mode behavior. An agent has enough context to select and invoke the tool correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds value beyond the schema by specifying the symbol result shape {name, parent, kind, path, line, signature}, clarifying that files=true produces {path, language, size}, and framing the query as a way to find definitions or file paths. This supplements the parameter descriptions with meaningful output expectations.

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

Purpose5/5

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

The description clearly identifies the tool's purpose with a specific verb and resource: search the project's code graph for symbols or file paths and return JSON. It further differentiates from siblings by explicitly naming ctx_symbol for deep single-symbol detail and ctx_impact for dependency impact.

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

Usage Guidelines5/5

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

The description provides explicit usage context: use this to locate definitions before reading a file, or to find files by path fragment. It also names alternatives and when they are more appropriate, giving an agent direct routing guidance without needing to inspect sibling schemas.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/halloffame12/CTX'

If you have feedback or need assistance with the MCP directory API, please join our Discord server