Skip to main content

validate_item_path

Function validate_item_path 

Source
pub fn validate_item_path(
    tool_name: &str,
    item_path: &str,
) -> Result<(), CallToolError>
Expand description

Validate an item path supplied by a tool caller.

Item paths are Rust paths made of identifier segments separated by :: (for example serde::Serialize or std::vec::Vec::push). This rejects path-traversal sequences and characters such as /, . or whitespace that could escape the docs.rs path or otherwise form an invalid request, giving callers an actionable error instead of an opaque HTTP 400.

ยงErrors

Returns a CallToolError describing the first problem found.