Expand description
Shared error helpers to reduce repetitive .with_context() patterns
Constants§
- PATCH_
PARAMETER_ HINT - Standard hint when the model sends a patch payload to the wrong tool.
- READ_
FILE_ FIRST_ HINT - Canonical guidance to read a file before attempting a precise edit or patch.
- USE_
PATCH_ FOR_ LARGE_ EDITS - Canonical guidance for routing large edits away from edit_file.
- USE_
PATCH_ OR_ WRITE_ FOR_ LARGE_ FILES - Canonical guidance for routing large-file edits away from edit_file.
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.