feat: unified error type (#308)
* feat: unified error type * fix: use type id to compare transport type
This commit is contained in:
parent
c74b26b3e3
commit
e615300fea
1 changed files with 286 additions and 161 deletions
|
|
@ -134,7 +134,7 @@ impl ServerHandler for MyToolHandler {
|
|||
&self,
|
||||
request: CallToolRequestParam,
|
||||
context: RequestContext<RoleServer>,
|
||||
) -> Result<CallToolResult, rmcp::Error> {
|
||||
) -> Result<CallToolResult, rmcp::ErrorData> {
|
||||
let tcc = ToolCallContext::new(self, request, context);
|
||||
self.tool_router.call(tcc).await
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ impl ServerHandler for MyToolHandler {
|
|||
&self,
|
||||
_request: Option<PaginatedRequestParam>,
|
||||
_context: RequestContext<RoleServer>,
|
||||
) -> Result<ListToolsResult, rmcp::Error> {
|
||||
) -> Result<ListToolsResult, rmcp::ErrorData> {
|
||||
let items = self.tool_router.list_all();
|
||||
Ok(ListToolsResult::with_all_items(items))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue