MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / add_tool_call

Method add_tool_call

crates/opencode-session/src/message.rs:156–172  ·  view source on GitHub ↗
(
        &mut self,
        id: impl Into<String>,
        name: impl Into<String>,
        input: serde_json::Value,
    )

Source from the content-addressed store, hash-verified

154 }
155
156 pub fn add_tool_call(
157 &mut self,
158 id: impl Into<String>,
159 name: impl Into<String>,
160 input: serde_json::Value,
161 ) {
162 self.parts.push(MessagePart {
163 id: format!("prt_{}", uuid::Uuid::new_v4()),
164 part_type: PartType::ToolCall {
165 id: id.into(),
166 name: name.into(),
167 input,
168 },
169 created_at: Utc::now(),
170 message_id: None,
171 });
172 }
173
174 pub fn add_tool_result(
175 &mut self,

Calls

no outgoing calls