Skip to content

Craft Anything: understand how any software works, and craft your own.

Rust

Emit object schemas for compare inputs (#93)

Max Mittelstädtf6725c2b8c54
diff --git a/crates/engine/src/registry.rs b/crates/engine/src/registry.rs
index 17463a5b..6e3e5088 100644
--- a/crates/engine/src/registry.rs
+++ b/crates/engine/src/registry.rs
@@ -197,6 +197,17 @@ mod tests {
}
}
+ #[test]
+ fn every_mcp_input_property_has_an_object_schema() {
+ let r = Registry::with_all_tools();
+ for spec in r.all() {
+ let schema = &r.mcp_descriptor(spec)["inputSchema"];
+ for (property, value) in schema["properties"].as_object().into_iter().flatten() {
+ assert!(value.is_object(), "{}.{property} schema must be an object, got {value}", spec.id);
+ }
+ }
+ }
+
#[test]
fn any_name_a_client_uses_resolves_to_the_tool_id() {
let r = Registry::with_all_tools();
diff --git a/crates/engine/src/tools/process_tools.rs b/crates/engine/src/tools/process_tools.rs
index 47b8b801..8792b373 100644
--- a/crates/engine/src/tools/process_tools.rs
+++ b/crates/engine/src/tools/process_tools.rs
@@ -453,6 +453,7 @@ fn runtime_walkthrough_record(ctx: &mut Ctx<'_>, params: Value) -> Result<ToolOu
pub struct CompareParams {
/// The first run: runtime_walkthrough_record evidence (inline, {"kind":"saved",…} or a bare id).
pub left: Value,
+ /// The second run, in the same forms.
pub right: Value,
}