Skip to content

Edge Kinds ​

Edges in the Ctxo dependency graph carry one of five kinds. The kind tells you how two symbols are related, and it controls which edges each MCP tool will traverse. The enum is closed: plugins do not invent new kinds.

The five kinds ​

KindDirectionExampleEmitted by
importsmodule A β†’ module Bimport { foo } from './bar'TypeScript, Go, C# (module-level)
callscaller β†’ calleefoo() inside bar()All parsers (call-site)
extendssubclass β†’ baseclass A extends BTypeScript, C#, Go (struct embedding)
implementsclass β†’ interfaceclass A implements ITypeScript, C#
usesreference β†’ targettype annotation, generic parameter, identifier referenceAll parsers

All edges are directed. The index stores each edge as { from, to, kind, typeOnly? } where from and to are symbol IDs.

When each is emitted ​

imports ​

Emitted once per module-level import binding. The from side is usually the symbol that owns the import (commonly the file-level module symbol or the top-level declaration that uses the binding). Type-only imports set typeOnly: true so tools can distinguish erased imports from runtime edges.

calls ​

Emitted at each call-site. If foo calls bar twice within the same function body, a single calls edge is emitted (the graph is a set of edges, not a multiset).

extends ​

Emitted for class inheritance. In Go, struct embedding is modelled as extends on the embedding struct. Interface inheritance in TypeScript (interface A extends B) also uses extends.

implements ​

Emitted when a class declares conformance to an interface. In Go, implicit interface satisfaction is not traced; implements only fires for explicit declarations (TypeScript implements, C# : list).

uses ​

The catch-all for non-call references: type positions, generic arguments, identifier reads, and decorator targets. Use this edge when you need every mention of a symbol, not just its invocations.

JSON shape ​

json
{
  "from": "packages/cli/src/foo.ts::myFn::function",
  "to":   "packages/cli/src/bar.ts::TokenValidator::class",
  "kind": "imports",
  "typeOnly": false
}

typeOnly is optional and only set by the TypeScript plugin. Tools treat missing typeOnly as false.

How tools traverse edges ​

ToolTraverses
get_logic_sliceall forward edges from the root
get_blast_radiusreverse edges across calls, uses, imports
find_importersreverse edges; filterable via edgeKinds
get_class_hierarchyextends and implements in both directions

All tools that accept an edgeKinds parameter validate the input against the five canonical values. Passing any other value returns { error: true, message: ... }.

TIP

When asking "who uses this?" via find_importers, restrict edgeKinds to ["calls", "uses"] to exclude module-level imports and see only runtime dependencies.

WARNING

Go's structural interface satisfaction is intentionally not materialised as implements edges. Use uses plus the interface type to find likely implementers, or call get_class_hierarchy on a concrete type.

See also ​

Released under the MIT License.