From a468ee1154521a49f69859a5f6dbdcbf8c038a05 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Tue, 21 Oct 2025 10:04:38 -0600 Subject: [PATCH] bug: Fixed a bug when passing tools to Claude for tools that don't have any inputs --- src/client/claude.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/client/claude.rs b/src/client/claude.rs index 29aa6b0..28f8225 100644 --- a/src/client/claude.rs +++ b/src/client/claude.rs @@ -286,14 +286,22 @@ pub fn claude_build_chat_completions_body( body["tools"] = functions .iter() .map(|v| { - json!({ + if v.parameters.type_value.is_none() { + json!({ "name": v.name, "description": v.description, - "input_schema": v.parameters, - }) - }) - .collect(); - } + "input_schema": { "type": "object", "properties": {}, "required": [] }, + }) + } else { + json!({ + "name": v.name, + "description": v.description, + "input_schema": v.parameters, + }) + } + }) + .collect(); + } Ok(body) }