From 2778c7d851740631b4dbacf907b63db26a6e1816 Mon Sep 17 00:00:00 2001 From: Luccas Paroni Date: Tue, 5 Aug 2025 16:19:47 -0300 Subject: feat(core): Parse Multimodal MCP Tool responses (#5529) Co-authored-by: Luccas Paroni --- docs/core/tools-api.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs/core/tools-api.md') diff --git a/docs/core/tools-api.md b/docs/core/tools-api.md index e10333d2..0b52191c 100644 --- a/docs/core/tools-api.md +++ b/docs/core/tools-api.md @@ -15,9 +15,11 @@ The Gemini CLI core (`packages/core`) features a robust system for defining, reg - `execute()`: The core method that performs the tool's action and returns a `ToolResult`. - **`ToolResult` (`tools.ts`):** An interface defining the structure of a tool's execution outcome: - - `llmContent`: The factual string content to be included in the history sent back to the LLM for context. + - `llmContent`: The factual content to be included in the history sent back to the LLM for context. This can be a simple string or a `PartListUnion` (an array of `Part` objects and strings) for rich content. - `returnDisplay`: A user-friendly string (often Markdown) or a special object (like `FileDiff`) for display in the CLI. +- **Returning Rich Content:** Tools are not limited to returning simple text. The `llmContent` can be a `PartListUnion`, which is an array that can contain a mix of `Part` objects (for images, audio, etc.) and `string`s. This allows a single tool execution to return multiple pieces of rich content. + - **Tool Registry (`tool-registry.ts`):** A class (`ToolRegistry`) responsible for: - **Registering Tools:** Holding a collection of all available built-in tools (e.g., `ReadFileTool`, `ShellTool`). - **Discovering Tools:** It can also discover tools dynamically: -- cgit v1.2.3