Skip to main content
Glama
dalebrubaker

sourcegraph-mcp

by dalebrubaker

find_symbol_references

Search codebases for all usages of a symbol—function calls, variable accesses, or class instantiations—returning file paths and line numbers for each reference.

Instructions

Find all places where a symbol is USED/REFERENCED in the codebase. Returns file paths and line numbers for each usage.

This searches for actual code references, not the definition. Use this to see where a function is called, a class is instantiated, a method is invoked, or a variable is accessed.

Returns: File paths and line numbers showing code context for each reference.

Examples:

  • Find all calls to the ProcessOrder function

  • See where CustomerService class is instantiated

  • Find all references to API_KEY variable

  • Show me everywhere HandleRequest is called

Tips:

  • Use repo_filter to search specific repositories

  • Use file_filter to narrow down to specific files or directories

  • Add lang:csharp (or other language) to filter by programming language

Note: To find where a symbol is DEFINED, use find_symbol_definition instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbol_nameYesName of the symbol to find references for
repo_filterNoOptional: Filter by repository (e.g., 'repo:owner/name')
file_filterNoOptional: Filter by file path (e.g., 'file:\.cs$' for C# files)
lang_filterNoOptional: Filter by language (e.g., 'csharp', 'python', 'javascript')
max_resultsNoMaximum number of results (default: 20)
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses behavior: returns file paths and line numbers, searches across repos, supports filters. Minor omission: doesn't mention max_results default or any limitations like result size.

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?

Description is concise, well-structured with clear headings (Returns, Examples, Tips, Note). Front-loaded with main purpose, no 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?

For a 5-param tool with no output schema, the description is fairly complete: explains what is returned, gives examples, and details filters. Minor gap: doesn't mention max_results default or pagination behavior.

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 has 100% coverage, each parameter has description. The description adds examples and context but doesn't significantly enhance meaning beyond schema. Baseline 3 is appropriate.

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 finds where a symbol is USED/REFERENCED, returning file paths and line numbers. It distinguishes from sibling tool find_symbol_definition by explicitly saying use that for definitions.

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 explicitly tells when to use this tool (for references) and when not (for definitions, use find_symbol_definition). It also provides tips on using filters, which guides effective usage.

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/dalebrubaker/sourcegraph-mcp'

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