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

+3 -3
View File
@@ -504,7 +504,7 @@ impl McpTool for FindSymbolReferencesHandler {
matches.extend(disk_matches);
}
Ok(serde_json::to_string_pretty(&matches)?)
Ok(serde_yaml::to_string(&matches)?)
}
}
@@ -560,7 +560,7 @@ impl McpTool for GetCallersHandler {
callers.extend(disk_callers);
}
Ok(serde_json::to_string_pretty(&callers)?)
Ok(serde_yaml::to_string(&callers)?)
}
}
@@ -649,7 +649,7 @@ impl McpTool for AnalyzeImpactHandler {
}
});
Ok(serde_json::to_string_pretty(&result)?)
Ok(serde_yaml::to_string(&result)?)
}
}