fix: add tool_info schema discovery for WASM tools (#1086)

* fix: add tool_info schema discovery for WASM tools

* refactor: simplify WASM schema and hint state

* refactor: store tool_info registry reference as Weak
This commit is contained in:
Henry Park
2026-03-12 16:30:38 -07:00
committed by GitHub
parent c7dec64b2d
commit 8a60fa2d37
13 changed files with 658 additions and 189 deletions
+11
View File
@@ -336,6 +336,17 @@ pub trait Tool: Send + Sync {
None
}
/// Full parameter schema for discovery and coercion purposes.
///
/// Unlike `parameters_schema()` (which may be permissive to keep the tools
/// array compact), this returns the complete typed schema. Used by the
/// `tool_info` built-in and by WASM parameter coercion.
///
/// Default: delegates to `parameters_schema()`.
fn discovery_schema(&self) -> serde_json::Value {
self.parameters_schema()
}
/// Get the tool schema for LLM function calling.
fn schema(&self) -> ToolSchema {
ToolSchema {