Expand description
Shared error helpers to reduce repetitive .with_context() patterns
Functionsยง
- deserialize_
tool_ args - Deserialize JSON tool arguments into a typed struct with a consistent error message.
- optional_
string_ field - Extract an optional string field from JSON args
- require_
field - Extract a required value from an
Option<T>, with a consistent error message referencing the field name and tool/operation name. - require_
int_ field - Extract a required integer field from JSON args
- require_
string_ field - Extract a required string field from JSON args, with a consistent error message
- with_
file_ context - Wrap a file operation result with standardized path context.
Works with any
Result<T, E>whereEimplementsstd::error::Error. - with_
path_ context - Like
with_file_contextbut accepts a string path instead of&Path.