agent: Improve compatibility when using MCP servers with Gemini models (#28700)

WIP

Release Notes:

- agent: Improve compatibility when using MCPs with Gemini models
This commit is contained in:
Bennet Bo Fenner 2025-04-14 13:55:25 -06:00 committed by GitHub
parent 6c93d107c2
commit 2603f36737
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 307 additions and 103 deletions

View file

@ -1,5 +1,6 @@
mod action_log;
mod tool_registry;
mod tool_schema;
mod tool_working_set;
use std::fmt;
@ -16,6 +17,7 @@ use project::Project;
pub use crate::action_log::*;
pub use crate::tool_registry::*;
pub use crate::tool_schema::*;
pub use crate::tool_working_set::*;
pub fn init(cx: &mut App) {
@ -51,8 +53,8 @@ pub trait Tool: 'static + Send + Sync {
fn needs_confirmation(&self, input: &serde_json::Value, cx: &App) -> bool;
/// Returns the JSON schema that describes the tool's input.
fn input_schema(&self, _: LanguageModelToolSchemaFormat) -> serde_json::Value {
serde_json::Value::Object(serde_json::Map::default())
fn input_schema(&self, _: LanguageModelToolSchemaFormat) -> Result<serde_json::Value> {
Ok(serde_json::Value::Object(serde_json::Map::default()))
}
/// Returns markdown to be displayed in the UI for this tool.