open_document
Opens a file in the LSP server for analysis, enabling diagnostics, hover, and completions. Uses language_id for the correct language service and keeps the file open until explicitly closed.
Instructions
Open a file in the LSP server for analysis. Use this tool before performing operations like getting diagnostics, hover information, or completions for a file. The file remains open for continued analysis until explicitly closed. The language_id parameter tells the server which language service to use (e.g., 'typescript', 'javascript', 'haskell'). The LSP server starts automatically on MCP launch.
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>"
},
"name": "open_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | ||
| file_path | Yes | ||
| language_id | No |