MCPcopy Create free account
hub / github.com/GCWing/BitFun / update_tool

Method update_tool

src/apps/cli/src/chat_state.rs:929–935  ·  view source on GitHub ↗

Update an existing tool in current_flow_items via tool_index. No-op if the tool_id is not found (defensive).

(&mut self, tool_id: &str, update_fn: impl FnOnce(&mut ToolDisplayState))

Source from the content-addressed store, hash-verified

927 /// Update an existing tool in current_flow_items via tool_index.
928 /// No-op if the tool_id is not found (defensive).
929 fn update_tool(&mut self, tool_id: &str, update_fn: impl FnOnce(&mut ToolDisplayState)) {
930 if let Some(&idx) = self.tool_index.get(tool_id) {
931 if let Some(FlowItem::Tool { tool_state }) = self.current_flow_items.get_mut(idx) {
932 update_fn(tool_state);
933 }
934 }
935 }
936}
937
938/// Extract a human-readable summary from a tool result JSON Value.

Callers 2

handle_tool_eventMethod · 0.80
handle_subagent_eventMethod · 0.80

Calls 2

get_mutMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected