Skip to main content
← MCP Tools

search_symbol

Find symbol definitions matching a name across the indexed graph. Accepts exact symbol names, partial matches, and natural-language queries (e.g. "auth session validation", "mcp dispatch tool call"). Query normalisation is deterministic, no model or API key required.

Availability: single-repo stdio (travsr mcp), global stdio (travsr mcp --global), and SSE (travsr serve).

Input schema​

{
"type": "object",
"required": ["name"],
"properties": {
"name": {
"type": "string",
"description": "Symbol name or natural-language query (1-200 chars). Partial and NL queries are supported."
},
"exact": {
"type": "boolean",
"description": "If true, drops loose substring matches and keeps only exact, word-boundary, and prefix matches. Use for short or common names to cut noise."
},
"repo": {
"type": "string",
"description": "Repo name (run repos_list to discover). Only present in global (multi-repo) sessions and on SSE."
}
},
"additionalProperties": false
}

Prefix matching is the default​

A bare identifier (letters, digits and underscores only, such as handle_tool_call) is matched by name prefix, not by substring. Exact hits and names that begin with the query are returned; a name that merely contains it in the middle (dispatch_tool_call, WatcherHandle) is dropped, which keeps a real definition from being buried under loose matches. If no name begins with the query, the loose results are returned unchanged, so a mid-identifier search such as tool_call still finds something. A qualified name (T::m, a.b) or a multi-word query is matched as before.

There is no kind, match, language, or max_results parameter. A language filter is expressed inline in name instead (see below), and exact is the only match-mode control.

Language filtering​

Append a language word to the query and it is stripped out and used as a filter rather than searched for literally: "PaymentService in Kotlin" searches for PaymentService scoped to Kotlin, and "auth handler javascript" works the same way without the in. This covers all indexed languages (typescript, javascript, python, rust, go, java, kotlin, scala, csharp, ruby, php, c, cpp, swift, objectivec, dart, plus common aliases like golang, objc, c++, c#).

Output format​

Plain text (wrapped in a <travsr-data> envelope), one match per line: the label with its kind prefix (fn:, class:, use:, ...), the kind spelled out in parentheses, an em-dash separator (U+2014), and path:line (just path when the node has no line, as for an import). Results are capped; past the cap, extras are simply not shown (there is no explicit total/count field). An empty result reads as No symbols matching '<name>' found in the graph., never a blank string.

Example​

Request:

{ "name": "wrap_envelope", "exact": true }

Response (from the Travsr repository):

fn:wrap_envelope (function) — crates/travsr-mcp/src/sanitize.rs:138
use:crate::sanitize::wrap_envelope (import) — crates/travsr-mcp/src/tools.rs
use:crate::sanitize::wrap_envelope (import) — crates/travsr-mcp/src/observability.rs

Request with an inline language filter:

{ "name": "PaymentService in Kotlin" }

When to use​

  • Navigation: jump to the definition of a symbol you know by name.
  • Discovery: loose (non-exact) search to find related symbols by partial name or natural-language description.
  • Cross-language: omit a language filter to find a name across every indexed language at once; add one inline ("in <language>") to narrow it.