pub struct SessionRpcTools<'a> { /* private fields */ }Expand description
session.tools.* RPCs.
Implementations§
Source§impl<'a> SessionRpcTools<'a>
impl<'a> SessionRpcTools<'a>
Sourcepub async fn execute(
&self,
params: ToolsExecuteRequest,
) -> Result<ToolResult, Error>
pub async fn execute( &self, params: ToolsExecuteRequest, ) -> Result<ToolResult, Error>
Executes one tool from the session’s currently offered tool set through the native invocation pipeline.
Wire method: session.tools.execute.
§Parameters
params- A tool name and arguments to execute through the session’s native invocation pipeline.
§Returns
Canonical result returned by a session tool.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn get_builtin_descriptors(
&self,
params: ToolsGetBuiltinDescriptorsRequest,
) -> Result<ToolsGetBuiltinDescriptorsResult, Error>
pub async fn get_builtin_descriptors( &self, params: ToolsGetBuiltinDescriptorsRequest, ) -> Result<ToolsGetBuiltinDescriptorsResult, Error>
Returns the Rust-owned built-in tool descriptors used to construct the session’s offered tool set.
Wire method: session.tools.getBuiltinDescriptors.
§Parameters
params- Options controlling how Rust-owned built-in tool descriptors are materialized.
§Returns
Rust-owned built-in tool descriptors for the session.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn task_complete_event_data(
&self,
params: ToolsTaskCompleteEventDataRequest,
) -> Result<TaskCompleteData, Error>
pub async fn task_complete_event_data( &self, params: ToolsTaskCompleteEventDataRequest, ) -> Result<TaskCompleteData, Error>
Projects a completed task_complete tool call into its label-safe session event payload.
Wire method: session.tools.taskCompleteEventData.
§Parameters
params- Task-completion tool arguments and final result used to build a label-safe session event payload.
§Returns
Task completion notification with summary from the agent
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn handle_pending_tool_call(
&self,
params: HandlePendingToolCallRequest,
) -> Result<HandlePendingToolCallResult, Error>
pub async fn handle_pending_tool_call( &self, params: HandlePendingToolCallRequest, ) -> Result<HandlePendingToolCallResult, Error>
Provides the result for a pending external tool call.
Wire method: session.tools.handlePendingToolCall.
§Parameters
params- Pending external tool call request ID, with the tool result or an error describing why it failed.
§Returns
Indicates whether the external tool call result was handled successfully.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn initialize_and_validate(
&self,
) -> Result<ToolsInitializeAndValidateResult, Error>
pub async fn initialize_and_validate( &self, ) -> Result<ToolsInitializeAndValidateResult, Error>
Resolves, builds, and validates the runtime tool list for the session.
Wire method: session.tools.initializeAndValidate.
§Returns
Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before send invoke this. Default base-class implementation is a no-op for sessions that don’t support tool validation.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn get_current_metadata(
&self,
) -> Result<ToolsGetCurrentMetadataResult, Error>
pub async fn get_current_metadata( &self, ) -> Result<ToolsGetCurrentMetadataResult, Error>
Returns lightweight metadata for the session’s currently initialized tools.
Wire method: session.tools.getCurrentMetadata.
§Returns
Current lightweight tool metadata snapshot for the session.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn set(
&self,
params: ToolsSetRequest,
) -> Result<ToolsSetResult, Error>
pub async fn set( &self, params: ToolsSetRequest, ) -> Result<ToolsSetResult, Error>
Atomically replaces the complete externally implemented tool list supplied by the calling connection. Built-in, MCP/plugin, extension-discovered, subagent, and tools supplied by other connections remain unchanged.
Wire method: session.tools.set.
§Parameters
params- Complete externally implemented tool list for the calling connection. An empty list removes every tool previously supplied by that connection.
§Returns
Empty result after replacing the calling connection’s externally implemented tools.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn update_subagent_settings(
&self,
params: UpdateSubagentSettingsRequest,
) -> Result<ToolsUpdateSubagentSettingsResult, Error>
pub async fn update_subagent_settings( &self, params: UpdateSubagentSettingsRequest, ) -> Result<ToolsUpdateSubagentSettingsResult, Error>
Updates the current session’s live subagent settings after user settings change. The persisted user settings remain the source of truth for future sessions.
Wire method: session.tools.updateSubagentSettings.
§Parameters
params- Subagent settings to apply to the current session
§Returns
Empty result after applying subagent settings
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Trait Implementations§
Source§impl<'a> Clone for SessionRpcTools<'a>
impl<'a> Clone for SessionRpcTools<'a>
Source§fn clone(&self) -> SessionRpcTools<'a>
fn clone(&self) -> SessionRpcTools<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more