summaryrefslogtreecommitdiff
path: root/packages/server/src/tools
AgeCommit message (Collapse)Author
2025-05-30Rename server->core (#638)Tommaso Sciortino
2025-05-30use json block for mcp tool output (and re-enable markdown rendering) (#635)Olcan
2025-05-30confirm mcp tool executions from untrusted servers (per "trust" setting) (#631)Olcan
2025-05-30disable markdown for discovered (mcp) tools (#630)Olcan
2025-05-30add flags for markdown rendering and live updating to Tool to avoid ↵Olcan
special-casing shell tool by name, and open door for other tools to specify their rendering/updating (#629)
2025-05-30feat: Implement retry with backoff for API calls (#613)N. Taylor Mullen
2025-05-30truncate (hide) tool output at the top, add some spacing, also fix shell ↵Olcan
output interval change accidentally undone in a previous commit (#619)
2025-05-30tweaks to shell abort logic based on feedback (#618)Olcan
2025-05-30allow aborting of shell mode (!) commands, similar to shell tool commands. ↵Olcan
fix bug that prevented aborts after first abort. more robust killing logic (#616)
2025-05-30update shell output at an interval to reduce flicker (#614)Olcan
2025-05-29fix mcp tool names that are long or have invalid characters (based on 400 ↵Olcan
error) (#602)
2025-05-29Refactor read-file and support images. (#480)Jacob Richman
2025-05-29feat: Enhance web_fetch tool to process prompts with URLs using Gemini API ↵Allen Hutchison
(#587)
2025-05-29improve read-many-files output (#596)Seth Troisi
2025-05-29Change Config to use named parameters. (#593)Jacob Richman
2025-05-28refactor: Extract MCP discovery from ToolRegistryTaylor Mullen
- Moves MCP tool discovery logic from ToolRegistry into a new, dedicated MCP client (mcp-client.ts and mcp-tool.ts). - Updates ToolRegistry to utilize the new MCP client. - Adds comprehensive tests for the new MCP client and its integration with ToolRegistry. Part of https://github.com/google-gemini/gemini-cli/issues/577
2025-05-28much improved support for background processes, avoiding termination (via ↵Olcan
SIGPIPE) or eventual blocking (e.g. due to filled OS buffers) (#586)
2025-05-27feat: Allow cancellation of in-progress Gemini requests and pre-execution checksTaylor Mullen
- Implements cancellation for Gemini requests while they are actively being processed by the model. - Extends cancellation support to the logic within tools. This allows users to cancel operations during the phase where the system is determining if a tool execution requires user confirmation, which can include potentially long-running pre-flight checks or LLM-based corrections. - Underlying LLM calls for edit corrections (within and ) and next speaker checks can now also be cancelled. - Previously, cancellation of the main request was not possible until text started streaming, and pre-execution checks were not cancellable. - This change leverages the updated SDK's ability to accept an abort token and threads s throughout the request, tool execution, and pre-execution check lifecycle. Fixes https://github.com/google-gemini/gemini-cli/issues/531
2025-05-27live output from shell tool (#573)Olcan
2025-05-27improve shell tool output when cancelled in debug mode (#571)Olcan
2025-05-26Chore(deps): Upgrade @google/genai to v1.0.1Taylor Mullen
- Upgraded the @google/genai SDK from ^0.13.0 to ^1.0.1. - Addressed a related type error in `packages/server/src/tools/edit.test.ts` by updating a type assertion. Part of https://github.com/google-gemini/gemini-cli/issues/551
2025-05-25Fix(diff): Hide whitespace changes in diffs with content changesTaylor Mullen
- Updated the diff generation in `edit.ts` and `write-file.ts` to include the `ignoreWhitespace: true` option. - This ensures that whitespace-only changes are not highlighted in the diff output when there are other content modifications, making the diffs cleaner and easier to review. - Extract default diffing options into single source of truth. Fixes https://github.com/google-gemini/gemini-cli/issues/548
2025-05-25Fix(test): Improve write-file and editCorrector test suitesTaylor Mullen
- Enhanced by: - Mocking and utilities (, ) to allow for more focused unit testing of . - Adding comprehensive tests for the private method, covering new and existing file scenarios, as well as error handling. - Expanding tests for and to verify behavior with the new content correction logic, including diff generation and directory creation. - Refined by: - Introducing robust mocking for and its methods (, , ) to simulate LLM interactions accurately. - Adding extensive test scenarios for , categorized by how matches and how is processed, including direct matches, unescaping, and LLM-based corrections. - Including tests for edge cases like no matches or multiple matches. - Adding a utility for better test isolation. Final fix for https://github.com/google-gemini/gemini-cli/issues/484
2025-05-25Fix(write-file): Correct over-escaping and improve content generationTaylor Mullen
- Leveraged existing edit correction technology from `edit.ts` to address over-escaping issues in `write-file.ts`. - Introduced `ensureCorrectFileContent` for correcting content in new files, where a simple "replace" isnt applicable. This uses a new LLM prompt tailored for correcting potentially problematic string escaping. - Added caching for `ensureCorrectFileContent` to optimize performance. - Refactored `write-file.ts` to integrate these corrections, improving the reliability of file content generation and modification. Part of https://github.com/google-gemini/gemini-cli/issues/484
2025-05-25Correct edits even when auto-accept is enabled.Taylor Mullen
- Prior to this when a user would turn on auto-accept for edits we'd stop ensuring correct edits. This would result in a lot of back and forth by the model. This change also incoporates ensure correct edit into the normal execution flow. - Added edit tests for this. Part of https://github.com/google-gemini/gemini-cli/issues/484
2025-05-23MCP SSE support (#511)cornmander
Matches the config format used by other MCP clients.
2025-05-22fix: forward entire tool call confirmation object through useToolScheduler ↵Brandon Keiji
(#481)
2025-05-21feat: useToolScheduler hook to manage parallel tool calls (#448)Brandon Keiji
2025-05-21Remove unneeded linebreaks in tool description in read-many-files. (#476)Jacob Richman
2025-05-21Fix: Align WebSearchTool API key handling with GeminiClient (#474)Allen Hutchison
2025-05-21switch to spawn for shell mode (#467)Olcan
2025-05-21fix exit code for shell tool (#465)Olcan
2025-05-20Update docs and tool description for read-many-files. (#456)Jacob Richman
2025-05-20Support Images and PDFs (#447)Jacob Richman
2025-05-20Implementation of web search as a tool (#307)Allen Hutchison
2025-05-19fix SIGPIPE and race condition causing dropping of final output ( "command ↵Olcan
not found" error) on cloudtops (#429)
2025-05-18fix(server): Use console.debug in GrepTool for less verbose loggingTaylor Mullen
- Replaces `console.warn` and `console.error` calls with `console.debug` in `packages/server/src/tools/grep.ts`. This change reduces noise for the user, as `warn` and `error` messages are displayed directly, while `debug` messages are not. - Adds a comprehensive test suite for the GrepTool (`packages/server/src/tools/grep.test.ts`) to ensure its functionality remains robust after these changes and to cover various usage scenarios. - Improves error message consistency in `GrepTool`'s parameter validation and execution. Fixes https://b.corp.google.com/issues/418648813
2025-05-18fix(shell): Improve error reporting for shell command failuresTaylor Mullen
This commit enhances the tool to provide more informative feedback to the user when a shell command fails, especially in non-debug mode. Previously, if a command terminated due to a signal (e.g., SIGPIPE during a with no upstream) or failed without producing stdout/stderr, the user would see no output, making it difficult to diagnose the issue. Changes: - Modified to update the logic. - If a command produces no direct output but results in an error, signal, non-zero exit code, or user cancellation, a concise message indicating this outcome is now shown in . - Utilized the existing utility from for consistent error message formatting, which also resolved previous TypeScript type inference issues. This ensures users receive clearer feedback on command execution status, improving the tool's usability and aiding in troubleshooting. Fixes https://b.corp.google.com/issues/417998119
2025-05-18fix(glob): Improve glob tool accuracy and outputTaylor Mullen
This commit enhances the glob tool by: - Ensuring that glob patterns are used effectively. Previously, simple file names without glob syntax (e.g., "file.ts") would only search the root directory. This change encourages more precise glob patterns (e.g., "**\/file.ts") for broader searches. - Returning absolute file paths instead of relative paths. This provides clearer, less ambiguous output and avoids encouraging the use of relative paths in subsequent operations. - Adding comprehensive tests for various globbing scenarios, including case sensitivity and path specifications. These changes address an issue where the glob tool could not find an expected item when a specific path was provided without appropriate glob syntax, and improve the overall reliability and usability of the tool. Fixes https://b.corp.google.com/issues/418486553
2025-05-17refactor: Remove console.error from WriteFileToolTaylor Mullen
- Removes an unnecessary `console.error` call from the `shouldConfirmExecute` method in the `WriteFileTool` class. - This logging was redundant as validation errors are already handled and returned by the method. - Additionally, `console.error` is not suitable for this scenario, as incorrect arguments can be provided by the LLM, and these are anticipated and managed without needing an error log. Fixes https://b.corp.google.com/issues/418491206
2025-05-17ability to override core system prompt (via .gemini/system.md) and specify ↵Olcan
core tools via coreTools setting (e.g. coreTools:["ls", "GrepTool", ...]) ; added tests, but did not update docs for now (#413)
2025-05-17added timeout setting to mcp server config, also switched to custom config ↵Olcan
type without "stderr" field that does not make sense in settings (#410)
2025-05-17fix multiple mcp serversolcan
2025-05-17fix: Prevent WriteFileTool from writing to directory pathsTaylor Mullen
- Enhances WriteFileTool validation to check if the target file_path is an existing directory. - If it is, the tool now returns a validation error "Path is a directory, not a file: <filePath>", preventing the attempt to write. - This proactive check avoids underlying file system errors that would occur if fs.writeFileSync were called on a directory path, which could lead to console errors. - Test cases have been updated to reflect this stricter validation. Fixes https://b.corp.google.com/issues/418348176
2025-05-16refactor: Unify file modification confirmation stateTaylor Mullen
- Modifies `EditTool` and `WriteFileTool` to share a single confirmation preference. - The "Always Proceed" choice for file modifications is now stored in `Config.alwaysSkipModificationConfirmation`. - This ensures that if a user chooses to always skip confirmation for one file modification tool, this preference is respected by the other. - `WriteFileTool` constructor now accepts `Config` instead of `targetDir` to facilitate this shared state. - Tests updated to reflect the new shared confirmation logic. Fixes https://b.corp.google.com/issues/415897960
2025-05-16Refactor: Use String.prototype.replaceAll() and update TS libTaylor Mullen
- Replaces the custom `replaceAll` implementation in `packages/server/src/tools/edit.ts` with the standard `String.prototype.replaceAll()`. - Updates `packages/server/tsconfig.json` to include `ES2021` in the `lib` compiler options to ensure TypeScript recognizes this method. This aligns with the project's Node.js version requirements \(Node.js 16.x+\). Fixes https://github.com/google-gemini/gemini-cli/issues/7
2025-05-16feat: Strip schema props from MCP tool definitionsTaylor Mullen
- This change modifies the tool discovery process for MCP (Model Context Protocol) tools. - When tools are fetched from an MCP server, the `additionalProperties` and `$schema` fields are now recursively removed from their input schemas. This ensures cleaner and more concise tool definitions within the CLI, aligning with the expected schema structure and preventing potential conflicts or verbose outputs. - The corresponding tests in `tool-registry.test.ts` have been updated to reflect this new behavior and verify the correct stripping of these properties. Workaround for https://github.com/google-gemini/gemini-cli/issues/398
2025-05-16Avoid console.log for MCPTaylor Mullen
- Prior to this when attached MCP servers would report content we'd fall back to `console.log` which doesn't work well in an Ink application. Fixes https://github.com/google-gemini/gemini-cli/issues/397
2025-05-16GC "add tool registry tests"Taylor Mullen
- Ok
2025-05-16feat: Implement CLI and model memory management (#371)Allen Hutchison
Co-authored-by: N. Taylor Mullen <[email protected]>