get_definitions
Retrieve TypeScript symbol definitions by specifying the root directory, file path, line number, and symbol name. Includes options to display surrounding lines for context.
Instructions
Get the definition(s) of a TypeScript symbol
Input Schema
Name | Required | Description | Default |
---|---|---|---|
after | No | Number of lines to show after the definition | |
before | No | Number of lines to show before the definition | |
filePath | Yes | File path (relative to root) | |
line | Yes | Line number (1-based) or string to match in the line | |
root | Yes | Root directory for resolving relative paths | |
symbolName | Yes | Name of the symbol |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"after": {
"default": 0,
"description": "Number of lines to show after the definition",
"type": "number"
},
"before": {
"default": 0,
"description": "Number of lines to show before the definition",
"type": "number"
},
"filePath": {
"description": "File path (relative to root)",
"type": "string"
},
"line": {
"description": "Line number (1-based) or string to match in the line",
"type": [
"number",
"string"
]
},
"root": {
"description": "Root directory for resolving relative paths",
"type": "string"
},
"symbolName": {
"description": "Name of the symbol",
"type": "string"
}
},
"required": [
"root",
"filePath",
"line",
"symbolName"
],
"type": "object"
}