pub struct LuaToolAdapter {
definition: ToolDefinition,
config: Arc<Config>,
}Expand description
Adapter that wraps a Lua ToolDefinition as a Tool trait object.
This allows Lua tools to participate in the unified tool dispatch alongside built-in and custom Rust tools.
Fields§
§definition: ToolDefinitionThe underlying Lua tool definition.
config: Arc<Config>Application config needed for the Lua context bridge.
Implementations§
Source§impl LuaToolAdapter
impl LuaToolAdapter
Sourcepub fn new(definition: ToolDefinition, config: Arc<Config>) -> Self
pub fn new(definition: ToolDefinition, config: Arc<Config>) -> Self
Create a new adapter wrapping a Lua tool definition.
Trait Implementations§
Source§impl Tool for LuaToolAdapter
impl Tool for LuaToolAdapter
Source§fn description(&self) -> &str
fn description(&self) -> &str
Returns a one-line description for agent discovery. Read more
Source§fn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
Returns the OpenAI function-calling JSON Schema for parameters. Read more
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Value,
_ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Value,
_ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with validated parameters. Read more
Source§fn capabilities(&self) -> Option<Vec<Capability>>
fn capabilities(&self) -> Option<Vec<Capability>>
Runtime capability requirements. Unknown metadata is denied by the local
agent runtime; existing MCP tools retain their existing behavior.
Source§fn binding_metadata(&self) -> Option<Value>
fn binding_metadata(&self) -> Option<Value>
Sanitized immutable identity for declaratively bound tools. History and
recovery use this without loading implementations or resolving secrets.
Source§fn runtime_dispatch(&self) -> ToolRuntimeDispatch
fn runtime_dispatch(&self) -> ToolRuntimeDispatch
Select runtime-owned execution context without coupling the dispatcher
to a public tool name. Most tools execute directly.
Source§fn preparation(&self) -> Option<ToolPreparation>
fn preparation(&self) -> Option<ToolPreparation>
Optional host-owned preparation that must complete through the durable
approval lifecycle before this tool can be advertised to a model.
fn prepare<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn is_builtin(&self) -> bool
fn is_builtin(&self) -> bool
Whether this tool is a built-in (true for search/get/sources). Read more
Auto Trait Implementations§
impl Freeze for LuaToolAdapter
impl RefUnwindSafe for LuaToolAdapter
impl Send for LuaToolAdapter
impl Sync for LuaToolAdapter
impl Unpin for LuaToolAdapter
impl UnsafeUnpin for LuaToolAdapter
impl UnwindSafe for LuaToolAdapter
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more