pub fn validate_input_path(path: &str, kind: &str) -> Result<PathBuf, McpError>Expand description
Validate a user-supplied file path that must already exist.
Must be absolute, must exist, must canonicalize cleanly with no ..
components in the result. Returns the canonical path on success.
kind is a short label used in error messages (e.g. "data file",
"export", "chart output"). For attach paths use validate_local_path
which uses "attach path" as the label.
§Errors
- Returns
ErrorCode::InvalidArgumentifpathis relative or if the canonicalized path contains..components. - Returns
ErrorCode::FileNotFoundifstd::fs::canonicalizefails.