This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
ollie-9p/prompts/tools-lsp.md

2.0 KiB

LSP Tools

Code intelligence via language servers. Bridge starts automatically on first use.

Supported languages: Go, C/C++, PHP.

Line/col are 1-indexed strings — use file_read line numbers directly. All args are strings.


lsp_definition

Go to definition of symbol at position.

Args: [path, line, col]

call_tool: calls=[{tool: "lsp_definition", args: ["/abs/path.go", "42", "10"]}]

Returns: file:line:col location(s).


lsp_references

Find all references to symbol at position. Capped at 50.

Args: [path, line, col]

call_tool: calls=[{tool: "lsp_references", args: ["/abs/path.go", "42", "10"]}]

Returns: file:line:col per reference.

Prefer over file_grep for semantic references — won't match comments, strings, or unrelated identifiers.


lsp_hover

Type signature and documentation for symbol at position.

Args: [path, line, col]

call_tool: calls=[{tool: "lsp_hover", args: ["/abs/path.go", "42", "10"]}]

lsp_rename

Rename symbol across workspace. Applies edits directly.

Args: [path, line, col, new_name]

call_tool: calls=[{tool: "lsp_rename", args: ["/abs/path.go", "42", "10", "NewName"]}]

Prefer over manual find-and-replace — understands scope, interfaces, cross-package references.


lsp_symbols

List symbols in a file, or search workspace-wide.

Args: [path] or [query, "--workspace"]

call_tool: calls=[{tool: "lsp_symbols", args: ["/abs/path.go"]}]
call_tool: calls=[{tool: "lsp_symbols", args: ["MyFunc", "--workspace"]}]

lsp_diagnostics

Errors and warnings for a file.

Args: [path]

call_tool: calls=[{tool: "lsp_diagnostics", args: ["/abs/path.go"]}]

lsp_completion

Completion candidates at cursor position.

Args: [path, line, col]

call_tool: calls=[{tool: "lsp_completion", args: ["/abs/path.go", "42", "10"]}]

Returns: up to 20 candidates.


All read-only LSP tools can be batched in a single call for parallel execution.