feat(mcp): switch to YAML serialization for tool outputs

- Replaced serde_json with serde_yaml in all handler endpoints.

- This drastically reduces token consumption for large list/graph responses by removing JSON braces and quotes.
This commit is contained in:
Riz Ashraf committed 2026-10-08 23:46:32 +01:00
1 parent 410b0c42ca
commit cb0c55775a
12 files changed
+65 -37

No files matched your search

Generated
+20
View File
@@ -2654,6 +2654,7 @@ dependencies = [
"schemars",
"serde",
"serde_json",
"serde_yaml",
"tantivy",
"tempfile",
"thiserror 2.0.20",
@@ -4342,6 +4343,19 @@ dependencies = [
"serde",
]
[[package]]
name = "serde_yaml"
version = "0.9.34+deprecated"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
dependencies = [
"indexmap",
"itoa",
"ryu",
"serde",
"unsafe-libyaml",
]
[[package]]
name = "sha1"
version = "0.10.7"
@@ -5438,6 +5452,12 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e"
[[package]]
name = "unsafe-libyaml"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
[[package]]
name = "untrusted"
version = "0.9.0"