From 083f7222c40ffcfe3eb4c3505d7086ace3019a95 Mon Sep 17 00:00:00 2001 From: Pedro Perez Date: Sat, 21 Feb 2026 06:25:29 -0800 Subject: [PATCH] fix: serialize Tool schema as `parameters` instead of `parametersSchema` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The custom Serialize impl for Tool emitted the JSON key `parametersSchema`, but the Copilot CLI reads `parameters` when mapping external tool definitions (mapProtocolExternalTools in the CLI bundle). This mismatch caused every SDK-registered tool's schema to be silently dropped — the CLI fell back to an empty schema ({type: "object", properties: {}}) so the model never saw the tool's properties or required fields. The official Python SDK also uses `parameters` as the serialized field name (github/copilot-sdk@c4b3b36, copilot/types.py L138), confirming this is the expected wire format. Only the serialized JSON key changes; the Rust struct field (parameters_schema) and the builder method (.schema()) are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.rs b/src/types.rs index a85ac3a..761f094 100644 --- a/src/types.rs +++ b/src/types.rs @@ -544,7 +544,7 @@ impl Serialize for Tool { let mut state = serializer.serialize_struct("Tool", 3)?; state.serialize_field("name", &self.name)?; state.serialize_field("description", &self.description)?; - state.serialize_field("parametersSchema", &self.parameters_schema)?; + state.serialize_field("parameters", &self.parameters_schema)?; state.end() } }