read_symbol
Retrieve source text for a function, class, or variable by name without loading the whole file. Choose full source, interface skeleton, or signature-only.
Instructions
Return source text for a single named symbol (function, class, method, config key) without reading the entire file. Read-only.
depth controls how much is returned:
"full" (default): Entire source of the symbol. Typical savings: 10-20x fewer tokens than reading the whole file.
"interface": For a class -> header + field declarations + method signatures with bodies replaced by ' ...'. For a function -> just the signature.
"signature": Signature-only. For a function -> the line(s) before the body. For a class -> the class header.
Use this when: You need to read a specific symbol without reading the
whole file. Pick the narrowest depth that contains what you need.
Don't use this when: You need a structural overview of the whole file
-> use list_symbols. You need to see the file's imports -> use
read_imports.
Example: target="LRUCache.get" # full method source target="LRUCache", depth="interface" # class skeleton target="LRUCache.get", depth="signature" # just the def line target="project.version" # config value
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| depth | No | full |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |