From 0193ffc4ff9253fa0708c8cfe94871be9636d951 Mon Sep 17 00:00:00 2001 From: Alex Hancock Date: Mon, 28 Sep 2026 12:59:29 +0000 Subject: [PATCH] fix: GDK tools with no args still advertise empty params input schema (#12527) --- .../src/formats/databricks.rs | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/crates/goose-provider-types/src/formats/databricks.rs b/crates/goose-provider-types/src/formats/databricks.rs index 12a37ed4c..79273e432 100644 --- a/crates/goose-provider-types/src/formats/databricks.rs +++ b/crates/goose-provider-types/src/formats/databricks.rs @@ -349,27 +349,17 @@ pub fn format_tools(tools: &[Tool], _model_name: &str) -> anyhow::Result anyhow::Result<()> { + let tool = Tool::new( + "list_sessions", + "A tool that takes no arguments", + object!({ + "type": "object", + "properties": {} + }), + ); + + let spec = format_tools(std::slice::from_ref(&tool), "glm-5-3")?; + + let function = &spec[0]["function"]; + assert!( + function.get("parameters").is_some(), + "Databricks rejects a function object without `parameters`" + ); + assert_eq!(function["parameters"]["type"], "object"); + + Ok(()) + } + #[test] fn test_format_tools_duplicate() -> anyhow::Result<()> { let tool1 = Tool::new(