Skip to main content
Glama
transparentlyok

MCP Context Manager

find_symbol

Locate specific functions, classes, or variables in code with fuzzy matching that corrects typos and returns exact file paths and line numbers.

Instructions

⭐ PREFERRED FOR SYMBOLS: Use this INSTEAD OF Grep when looking for specific functions, classes, or variables. Fuzzy matching automatically handles typos ("athenticate" → "authenticate"). Returns exact file path and line number. Much faster than Grep with better accuracy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesThe symbol name to find (e.g., function name, class name, variable name)
typeNoThe type of symbol to find. Use "any" to search all types.

Implementation Reference

  • Tool handler logic for `find_symbol` within the `CallToolRequestSchema` switch statement.
    case 'find_symbol': {
      const a = args as any;
      const symbol: string = a.symbol || a.name || a.symbolName;
      const type: string | undefined = a.type;
      if (!symbol) {
        return {
          content: [{ type: 'text', text: 'Error: symbol is required. Provide the symbol name to find.' }],
          isError: true,
        };
      }
      const results = await retriever.findSymbol(symbol, type);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(results, null, 2),
          },
        ],
      };
    }
  • `retriever.findSymbol` method which orchestrates the symbol lookup and includes fuzzy matching logic if direct lookup fails.
    async findSymbol(symbolName: string, type?: string): Promise<any> {
      const symbols = this.indexer.findSymbols(symbolName, type);
    
      if (symbols.length === 0) {
        // Try fuzzy search
        const allSymbols = this.getAllSymbols();
        const fuzzyMatches = allSymbols.filter(s => {
          const typeMatch = !type || type === 'any' || s.type === type;
          return typeMatch && CodeSearchEngine.isFuzzyMatch(symbolName, s.name, 0.65);
        });
    
        if (fuzzyMatches.length > 0) {
          return {
            found: false,
  • `indexer.findSymbols` method that performs the actual symbol retrieval from the `symbolMap`.
    findSymbols(name: string, type?: string): Symbol[] {
      const symbols = this.symbolMap.get(name) || [];
      if (type && type !== 'any') {
        return symbols.filter((s) => s.type === type);
      }
      return symbols;
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: fuzzy matching for typos, performance ('much faster'), accuracy ('better accuracy'), and output format ('returns exact file path and line number'). It doesn't mention error handling, rate limits, or authentication needs, but covers core operational traits well.

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 highly concise and front-loaded: the first sentence states the core purpose and key alternative, followed by supporting details. Every sentence earns its place by adding critical information (fuzzy matching, output, performance), with zero wasted words.

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's moderate complexity (2 parameters, no output schema, no annotations), the description is nearly complete. It covers purpose, usage, key behaviors, and output, but lacks details on error cases or response structure. With no output schema, it could better explain return values, but it's sufficient for effective use.

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 the schema already documents both parameters thoroughly. The description adds no specific parameter semantics beyond implying 'symbol' is for 'functions, classes, or variables' and 'type' filtering, which the schema's enum already covers. This meets the baseline for high schema coverage.

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 the tool's purpose with specific verbs ('find', 'returns') and resources ('symbols', 'functions, classes, or variables'), explicitly distinguishing it from sibling tool 'Grep' (likely referring to 'search_code'). It specifies the exact output ('file path and line number') and key features ('fuzzy matching', 'faster', 'better accuracy').

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 guidance: 'PREFERRED FOR SYMBOLS: Use this INSTEAD OF Grep when looking for specific functions, classes, or variables.' It clearly states when to use this tool (for symbols) and when not to (use Grep/search_code for other cases), naming the alternative tool directly.

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/transparentlyok/mcp-context-manager'

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