pub struct OpenApiHandler { /* private fields */ }Expand description
MCP handler that exposes OpenAPI operations as tools and resources.
Implementations§
Source§impl OpenApiHandler
impl OpenApiHandler
Sourcepub fn new(provider: Arc<OpenApiProvider>) -> Self
pub fn new(provider: Arc<OpenApiProvider>) -> Self
Create a new handler from a provider.
Sourcepub fn provider(&self) -> &OpenApiProvider
pub fn provider(&self) -> &OpenApiProvider
Get the underlying provider.
Trait Implementations§
Source§impl Clone for OpenApiHandler
impl Clone for OpenApiHandler
Source§fn clone(&self) -> OpenApiHandler
fn clone(&self) -> OpenApiHandler
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenApiHandler
impl Debug for OpenApiHandler
Source§impl McpHandler for OpenApiHandler
impl McpHandler for OpenApiHandler
Source§fn server_info(&self) -> ServerInfo
fn server_info(&self) -> ServerInfo
Returns server information (name, version, description, etc.) Read more
Source§fn call_tool<'a>(
&'a self,
name: &'a str,
args: Value,
_ctx: &'a RequestContext,
) -> impl Future<Output = McpResult<ToolResult>> + MaybeSend + 'a
fn call_tool<'a>( &'a self, name: &'a str, args: Value, _ctx: &'a RequestContext, ) -> impl Future<Output = McpResult<ToolResult>> + MaybeSend + 'a
Calls a tool by name with the given arguments. Read more
Source§fn read_resource<'a>(
&'a self,
uri: &'a str,
_ctx: &'a RequestContext,
) -> impl Future<Output = McpResult<ResourceResult>> + MaybeSend + 'a
fn read_resource<'a>( &'a self, uri: &'a str, _ctx: &'a RequestContext, ) -> impl Future<Output = McpResult<ResourceResult>> + MaybeSend + 'a
Reads a resource by URI. Read more
Source§fn get_prompt<'a>(
&'a self,
name: &'a str,
_args: Option<Value>,
_ctx: &'a RequestContext,
) -> impl Future<Output = McpResult<PromptResult>> + MaybeSend + 'a
fn get_prompt<'a>( &'a self, name: &'a str, _args: Option<Value>, _ctx: &'a RequestContext, ) -> impl Future<Output = McpResult<PromptResult>> + MaybeSend + 'a
Gets a prompt by name with optional arguments. Read more
Source§fn list_tasks<'a>(
&'a self,
_cursor: Option<&'a str>,
_limit: Option<usize>,
_ctx: &'a RequestContext,
) -> impl Future<Output = Result<ListTasksResult, McpError>> + MaybeSend + 'a
fn list_tasks<'a>( &'a self, _cursor: Option<&'a str>, _limit: Option<usize>, _ctx: &'a RequestContext, ) -> impl Future<Output = Result<ListTasksResult, McpError>> + MaybeSend + 'a
Lists all active and recent tasks. Read more
Source§fn get_task<'a>(
&'a self,
_task_id: &'a str,
_ctx: &'a RequestContext,
) -> impl Future<Output = Result<Task, McpError>> + MaybeSend + 'a
fn get_task<'a>( &'a self, _task_id: &'a str, _ctx: &'a RequestContext, ) -> impl Future<Output = Result<Task, McpError>> + MaybeSend + 'a
Gets the current state of a specific task. Read more
Source§fn cancel_task<'a>(
&'a self,
_task_id: &'a str,
_ctx: &'a RequestContext,
) -> impl Future<Output = Result<Task, McpError>> + MaybeSend + 'a
fn cancel_task<'a>( &'a self, _task_id: &'a str, _ctx: &'a RequestContext, ) -> impl Future<Output = Result<Task, McpError>> + MaybeSend + 'a
Cancels a running task. Read more
Source§fn get_task_result<'a>(
&'a self,
_task_id: &'a str,
_ctx: &'a RequestContext,
) -> impl Future<Output = Result<Value, McpError>> + MaybeSend + 'a
fn get_task_result<'a>( &'a self, _task_id: &'a str, _ctx: &'a RequestContext, ) -> impl Future<Output = Result<Value, McpError>> + MaybeSend + 'a
Gets the result of a completed task. Read more
Auto Trait Implementations§
impl Freeze for OpenApiHandler
impl !RefUnwindSafe for OpenApiHandler
impl Send for OpenApiHandler
impl Sync for OpenApiHandler
impl Unpin for OpenApiHandler
impl UnsafeUnpin for OpenApiHandler
impl !UnwindSafe for OpenApiHandler
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