Skip to main content

Module middleware

Module middleware 

Source
Expand description

Middleware types for the tool execution pipeline.

Middleware wraps tool execution with cross-cutting concerns like validation, permissions, logging, and output formatting.

The pattern is identical to axum’s from_fn — each middleware receives a Next that it can call to continue the chain, or skip to short-circuit.

Structs§

Next
The remaining middleware chain plus the underlying tool.
ToolCall
A tool call in flight through the middleware pipeline.

Traits§

ToolMiddleware
Middleware that wraps tool execution.

Functions§

tool_middleware_fn
Create middleware from a closure (like axum’s from_fn).