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:
1 parent
410b0c42ca
commit
cb0c55775a
12 files changed
+65
-37
No files matched your search
@@ -87,7 +87,7 @@ impl McpTool for GetActiveWorktreeContextHandler {
|
||||
.await
|
||||
.map_err(|e| crate::error::AppError::Internal(format!("Task panic: {}", e)))??;
|
||||
|
||||
Ok::<String, crate::error::AppError>(serde_json::to_string_pretty(&result)?)
|
||||
Ok::<String, crate::error::AppError>(serde_yaml::to_string(&result)?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ impl McpTool for QueryGitDiffsHandler {
|
||||
matches.extend(git_matches);
|
||||
}
|
||||
|
||||
Ok(serde_json::to_string_pretty(&matches)?)
|
||||
Ok(serde_yaml::to_string(&matches)?)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user