Skip to main content
Glama

search_token

Find any word in code symbol names, docstrings, or comments. Returns matching file paths and line numbers.

Instructions

Word-level reverse-index search.

Unlike lookup_symbol() which only matches defined symbol names, search_token() finds any word that appears in symbol names, docstrings, or inline comments across the indexed codebase.

Examples: search_token("background") → files containing 'background' in names/docs search_token("validate") → all functions whose docs mention validation search_token("github") → files where GitHub is referenced in comments

Returns a list of {file, line} dicts sorted by file path.

repo_path: optional absolute path to the target repository.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wordYes
repo_pathNo
Behavior4/5

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

No annotations provided, so description carries full burden. It explains that the tool finds words in names, docstrings, and comments, and specifies the return format (list of {file, line} dicts sorted by file path). It does not mention performance or side effects, but the description is transparent about its behavior.

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 well-structured: purpose, distinction, examples, return format, and parameter clarification. Every sentence adds value without redundancy.

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?

Given the tool has 2 parameters and no output schema or annotations, the description covers purpose, distinction, return format, and parameter details. It is complete for the tool's complexity, though additional context about performance or scope could further enhance it.

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 description coverage is 0%, so description must explain parameters. The examples illustrate usage of 'word', and the description notes 'repo_path' as an optional absolute path. This adds meaning beyond the schema's minimal type information.

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 states it performs word-level reverse-index search and explicitly distinguishes itself from lookup_symbol() by specifying it finds any word in symbol names, docstrings, or inline comments. This provides a specific verb-resource scope that differentiates it from siblings.

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

Usage Guidelines4/5

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

The description compares itself to lookup_symbol() and provides examples, implying when to use it (full-text search across code). However, it does not explicitly state when not to use it or list alternative tools, but the distinction is clear enough for an agent to select appropriately.

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/ashlesh-t/cognirepo'

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