Skip to main content

Module tools

Module tools 

Source
Expand description

MCP 工具模块

提供用于 Rust crate 文档查询的 MCP 工具。

§工具列表

  • docs::lookup_crate::LookupCrateToolImpl: 查找 crate 文档
  • docs::search::SearchCratesToolImpl: 搜索 crate
  • docs::lookup_item::LookupItemToolImpl: 查找特定项目
  • health::HealthCheckToolImpl: 健康检查

§示例

use std::sync::Arc;
use crates_docs::tools::{ToolRegistry, create_default_registry};
use crates_docs::tools::docs::DocService;
use crates_docs::cache::memory::MemoryCache;

let cache = Arc::new(MemoryCache::new(1000));
let doc_service = Arc::new(DocService::new(cache).unwrap());
let registry = create_default_registry(&doc_service);

Modules§

docs
文档查询工具模块
health
Health check tool

Structs§

ToolRegistry
工具注册表

Traits§

Tool
工具 trait

Functions§

create_default_registry
创建默认工具注册表