docs: Update guidelines and effective discourse for MCP tools

This commit is contained in:
Riz Ashraf committed 2026-09-30 12:33:01 +01:00
1 parent 292a6e95ab
commit 3a46124676
3 files changed
+29 -4

No files matched your search

+9 -2
View File
@@ -115,8 +115,15 @@ To maintain absolute traceability, we link memory items directly to the exact gi
The project contains two MCP binaries (win-nvim and linux-nvim) that bridge JSON-RPC over stdio directly to the active Neovim instance.
- **Interactive UI (UDP):** The active editor connects to the backend via UDP (port 3002). The UI script (`gemini-ui.lua`) supports non-destructive **Ghost Text Diff Reviews** and native `vim.ui` prompts without spawning subprocesses. You can trigger these interactively using the backend server.
- **Tools:** These binaries expose basic tools (`nvim_get_cursor`, `nvim_get_active_buffer`, `nvim_list_buffers`, etc.).
- **Interactive Execution QoL:** Use `nvim_send_to_terminal` to run background terminal commands (like tests or builds) in a visible Neovim split so the user can interact with prompts and see ANSI colors.
- **God Mode**: They also expose `nvim_execute_lua`. This is the ultimate fallback tool. If you need to access *any* Neovim API that does not have a dedicated Rust tool (e.g., getting LSP diagnostics, evaluating a visual selection block based on modes, setting registers), you MUST write a short Lua script and pass it to `nvim_execute_lua`. Do not attempt to recompile the Rust server to add new basic tools; use the Lua escape hatch dynamically.
## 16. Tool Schema Discovery (Lazy Loading)
Antigravity automatically caches all MCP tool schemas to your disk to save tokens. Do **NOT** grep or search the Rust source code to find tool schemas or arguments. To understand a tool`s arguments, directly read `~/.gemini/antigravity-cli/mcp/<server_name>/<tool_name>.json`. Do NOT guess arguments. ALWAYS read the schema if you are unfamiliar with a tool to prevent invalid argument errors.
## 16. Structural Code & Architecture Exploration
To reduce token costs and eliminate exact-match string failures:
- **`read_directory_architecture`**: When exploring a new repository, use this to get a bird's-eye view of a directory structure with summaries of file responsibilities, instead of blindly reading files.
- **`replace_ast_node`**: Instead of string-matching `replace_file_content` (which fails on whitespace), use this to precisely replace functions or structs based on AST boundaries.
- **`semantic_code_search`**: Use conceptual vector search instead of raw regex (`grep`) when you need to locate abstract logic (e.g., "Where is authentication handled?").
## 17. Tool Schema Discovery (Lazy Loading)
Antigravity automatically caches all MCP tool schemas to your disk to save tokens. Do **NOT** grep or search the Rust source code to find tool schemas or arguments. To understand a tool's arguments, directly read `~/.gemini/antigravity-cli/mcp/<server_name>/<tool_name>.json`. Do NOT guess arguments. ALWAYS read the schema if you are unfamiliar with a tool to prevent invalid argument errors.