definition
Locate the declaration of a symbol at a specific file position (line and column). Supports JS/TS, HTML, and CSS, including cross-file CSS selectors and custom properties.
Instructions
Go to the definition of the symbol at a position.
line and column are 1-indexed. column is a UTF-16 character offset
on the line (not a visual/display column): a leading tab counts as one
character. On a --custom-property/#id/.class token in a .css/
.html file (or a name inside an HTML id="..."/class="..." value),
answers from the cross-file index (see css_var/selector)
instead of the single-file language server: for definition, just the
definition(s) in the file's own root (each WEBNAV_MCP_ROOTS root
is separate); for references, that root's definitions and usages.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"line": "<line>",
"column": "<column>"
},
"name": "definition"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | ||
| column | Yes | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |