Skip to content

goToDefinition

Resolve symbol’s definition location(s) within repo.

goToDefinition(repo: str, symbol: str)
ParameterTypeRequiredDescription
repostringyesThe repo slug
symbolstringyesA bare name (Greeter), a qualified name (Greeter.greet), or a full SCIP symbol string
{
"symbol": "Greeter",
"resolvedSymbol": "scip-typescript npm @toy/pkg 0.0.1 src/`greeter.ts`/Greeter#",
"definitions": [
{
"path": "toy/greeter.ts",
"range": { "start": { "line": 0, "character": 6 }, "end": { "line": 0, "character": 13 } }
}
],
"commit": "abc1234",
"generated_at": "2026-07-08T12:00:00+00:00",
"stale": false,
"freshness": "fresh",
"checked_at": "2026-07-08T12:00:05+00:00"
}

resolvedSymbol appears only when resolution changed the input — a caller passing the exact full SCIP symbol string sees no resolvedSymbol key at all.

Call:

{ "repo": "toy-repo", "symbol": "Greeter" }

Response:

{
"symbol": "Greeter",
"resolvedSymbol": "scip-typescript npm @toy/pkg 0.0.1 src/`greeter.ts`/Greeter#",
"definitions": [
{
"path": "toy/greeter.ts",
"range": { "start": { "line": 0, "character": 6 }, "end": { "line": 0, "character": 13 } }
}
],
"commit": "abc1234",
"generated_at": "2026-07-08T12:00:00+00:00",
"stale": false,
"freshness": "fresh",
"checked_at": "2026-07-08T12:00:05+00:00"
}

Every tool returns a JSON object with an "error" string instead of raising. When symbol is ambiguous, the error payload also carries a structured candidates list instead of an unparseable prose message:

{
"error": "'dup' is ambiguous in toy-repo (2 matches). Retry with a qualifier, e.g. 'a.C.dup'.",
"candidates": [
{ "symbol": "sym-a", "dottedPath": "a.C.dup", "kind": "METHOD" },
{ "symbol": "sym-b", "dottedPath": "b.D.dup", "kind": "METHOD" }
],
"candidateTotal": 2
}