Run Lua in Neovim
nvim_exec_luaExecute Lua code inside Neovim to access plugin features that lack a dedicated tool. Pass arguments via ... and return values.
Instructions
Run a Lua chunk inside Neovim and return its value. The chunk receives its arguments through ... and must use return to send a value back. Use this to reach plugins that have no dedicated tool.
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": {
"code": "<code>"
},
"name": "nvim_exec_lua"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Values passed to the chunk as ... | |
| code | Yes | Lua source; use return to send a value back |