Skip to content

code_related

code_related is the most comprehensive single-call view of a symbol. It returns the function’s code, its callers, its callees, sibling functions defined in the same file, and any knowledge notes previously saved about it.

code_related(name="UserService")
code_related(name="processPayment", depth=2)
ParameterTypeDefaultDescription
namestringrequiredSymbol name
depthnumber1Levels of relationships to include (1–2)
  • Code — full function or class body
  • Callers — functions that call this symbol
  • Callees — functions this symbol calls
  • Siblings — other functions defined in the same file
  • Knowledge — any notes saved with code_knowledge linked to this symbol
  • Deep-dive on a symbol you have never seen before
  • Start of a task that touches a specific service or class
  • When code_context is not enough and you also want siblings and saved notes
ToolReturns
code_getCode only
code_contextCode + callers + callees
code_relatedCode + callers + callees + siblings + knowledge

Use code_related when you want the complete picture. Use code_context when you only need the call relationships.