pub struct GrepTool;Expand description
Search file contents by substring under the working directory. Read-only. Returns matching line snippets with file paths and line numbers; capped at 100 hits by default.
Trait Implementations§
Source§impl ToolLike for GrepTool
impl ToolLike for GrepTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description shown to the model.
Source§fn input_schema(&self) -> Value
fn input_schema(&self) -> Value
JSON Schema describing the tool’s arguments.
Source§fn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Whether this tool has no side effects. Read-only tools in the same
turn run concurrently; non-read-only tools run serially. Default:
false.Source§fn call<'a>(
&'a self,
input: Value,
ctx: &'a ToolContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'a>>
fn call<'a>( &'a self, input: Value, ctx: &'a ToolContext, ) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'a>>
Run the tool. The future is held by the agent loop and dropped on
cancellation; pair long-running work with
ToolContext::wait_for_cancel
in a tokio::select! to drop the losing branch promptly.Source§fn should_defer(&self) -> bool
fn should_defer(&self) -> bool
Whether the tool’s full definition is hidden until it is discovered
via
ToolSearchTool. Deferred tools appear to the model as
name-only stubs. Default: false.Auto Trait Implementations§
impl Freeze for GrepTool
impl RefUnwindSafe for GrepTool
impl Send for GrepTool
impl Sync for GrepTool
impl Unpin for GrepTool
impl UnsafeUnpin for GrepTool
impl UnwindSafe for GrepTool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more