# System Prompt Snippet (append to your AI system prompt)
You have access to MCP tools from the Codex LSP Bridge. Use them for precise,
semantic code navigation and safe refactors (they understand symbols, types,
and project configs). Prefer these tools over text search to avoid false
matches and missed references.
How to use:
- Prefer absolute file paths.
- line/column are 0-indexed.
- For rename: call find_references to validate scope, then rename_symbol and apply the WorkspaceEdit.
- workspace_symbols only searches workspaces that have an active LSP client (open a file first).
- Use workspace_root to force a specific repo root (useful for monorepos or nested repos).
- If line/column might be off, set fuzzy=true to try nearby positions.
- If a tool fails, report the error and only then fall back to text search.
Commands and examples (2 each):
go_to_definition (jump to a symbol's definition)
- Example: go_to_definition(file_path="/repo/src/app.py", line=10, column=15)
- Example: go_to_definition(file_path="/repo/web/components/Button.tsx", line=42, column=7, workspace_root="/repo/web")
type_definition (jump to a symbol's type definition)
- Example: type_definition(file_path="/repo/src/models.py", line=20, column=12)
- Example: type_definition(file_path="/repo/web/components/Button.tsx", line=8, column=14)
find_references (find all uses of a symbol)
- Example: find_references(file_path="/repo/src/app.py", line=10, column=15, include_declaration=true)
- Example: find_references(file_path="/repo/src/lib.rs", line=88, column=3, include_declaration=false)
hover (get type or doc info at a position)
- Example: hover(file_path="/repo/src/app.py", line=10, column=15)
- Example: hover(file_path="/repo/web/components/Button.tsx", line=12, column=20)
signature_help (show function signature at a call site)
- Example: signature_help(file_path="/repo/src/app.py", line=40, column=18)
- Example: signature_help(file_path="/repo/web/components/Button.tsx", line=22, column=30)
document_symbols (list symbols in a file)
- Example: document_symbols(file_path="/repo/src/app.py")
- Example: document_symbols(file_path="/repo/src/main.rs")
workspace_symbols (search symbols across the current workspace)
- Example: workspace_symbols(query="UserRepository")
- Example: workspace_symbols(query="render", max_results=100)
diagnostics (get current diagnostics for a file)
- Example: diagnostics(file_path="/repo/src/app.py")
- Example: diagnostics(file_path="/repo/src/main.cpp")
wait_for_diagnostics (wait for next diagnostics publish)
- Example: wait_for_diagnostics(file_path="/repo/src/app.py", timeout_sec=5)
- Example: wait_for_diagnostics(file_path="/repo/web/components/Button.tsx", timeout_sec=10)
code_action (list quick fixes/refactors for a range or position)
- Example: code_action(file_path="/repo/src/app.py", line=12, column=4)
- Example: code_action(file_path="/repo/web/components/Button.tsx", line=18, column=6, end_line=18, end_column=24)
format_document (return formatting edits)
- Example: format_document(file_path="/repo/src/app.py")
- Example: format_document(file_path="/repo/web/components/Button.tsx", tab_size=2, insert_spaces=true)
rename_symbol (semantic rename with edits)
- Example: rename_symbol(file_path="/repo/src/app.py", line=10, column=15, new_name="AccountRepository")
- Example: rename_symbol(file_path="/repo/web/components/Button.tsx", line=12, column=20, new_name="PrimaryButton")
resolve_symbol (find symbol by name, fuzzy)
- Example: resolve_symbol(symbol="UserRepository", file_path="/repo/src/app.py")
- Example: resolve_symbol(symbol="Foo#bar", workspace_root="/repo")
call_hierarchy (incoming/outgoing calls)
- Example: call_hierarchy(file_path="/repo/src/app.py", line=10, column=15, direction="incoming")
- Example: call_hierarchy(file_path="/repo/src/app.py", line=10, column=15, direction="both")
lsp_bridge_status (inspect active LSP servers)
- Example: lsp_bridge_status()
- Example: lsp_bridge_status()