use rmcp::handler::server::router::tool::ToolRouter;
pub const FULL: &[(&str, &str)] = &[
(
"memstead_changes_since",
include_str!("../descriptions/full/memstead_changes_since.md"),
),
(
"memstead_check",
include_str!("../descriptions/full/memstead_check.md"),
),
(
"memstead_create",
include_str!("../descriptions/full/memstead_create.md"),
),
(
"memstead_delete",
include_str!("../descriptions/full/memstead_delete.md"),
),
(
"memstead_diff",
include_str!("../descriptions/full/memstead_diff.md"),
),
(
"memstead_entity",
include_str!("../descriptions/full/memstead_entity.md"),
),
(
"memstead_health",
include_str!("../descriptions/full/memstead_health.md"),
),
(
"memstead_mem_configure",
include_str!("../descriptions/full/memstead_mem_configure.md"),
),
(
"memstead_mem_create",
include_str!("../descriptions/full/memstead_mem_create.md"),
),
(
"memstead_mem_delete",
include_str!("../descriptions/full/memstead_mem_delete.md"),
),
(
"memstead_mem_set_schema",
include_str!("../descriptions/full/memstead_mem_set_schema.md"),
),
(
"memstead_mem_set_version",
include_str!("../descriptions/full/memstead_mem_set_version.md"),
),
(
"memstead_overview",
include_str!("../descriptions/full/memstead_overview.md"),
),
(
"memstead_relate",
include_str!("../descriptions/full/memstead_relate.md"),
),
(
"memstead_reload",
include_str!("../descriptions/full/memstead_reload.md"),
),
(
"memstead_rename",
include_str!("../descriptions/full/memstead_rename.md"),
),
(
"memstead_retype",
include_str!("../descriptions/full/memstead_retype.md"),
),
(
"memstead_schema",
include_str!("../descriptions/full/memstead_schema.md"),
),
(
"memstead_search",
include_str!("../descriptions/full/memstead_search.md"),
),
(
"memstead_update",
include_str!("../descriptions/full/memstead_update.md"),
),
];
pub const FILESYSTEM: &[(&str, &str)] = &[
(
"memstead_changes_since",
include_str!("../descriptions/filesystem/memstead_changes_since.md"),
),
(
"memstead_check",
include_str!("../descriptions/filesystem/memstead_check.md"),
),
(
"memstead_create",
include_str!("../descriptions/filesystem/memstead_create.md"),
),
(
"memstead_delete",
include_str!("../descriptions/filesystem/memstead_delete.md"),
),
(
"memstead_diff",
include_str!("../descriptions/filesystem/memstead_diff.md"),
),
(
"memstead_entity",
include_str!("../descriptions/filesystem/memstead_entity.md"),
),
(
"memstead_health",
include_str!("../descriptions/filesystem/memstead_health.md"),
),
(
"memstead_overview",
include_str!("../descriptions/filesystem/memstead_overview.md"),
),
(
"memstead_relate",
include_str!("../descriptions/filesystem/memstead_relate.md"),
),
(
"memstead_rename",
include_str!("../descriptions/filesystem/memstead_rename.md"),
),
(
"memstead_retype",
include_str!("../descriptions/filesystem/memstead_retype.md"),
),
(
"memstead_schema",
include_str!("../descriptions/filesystem/memstead_schema.md"),
),
(
"memstead_search",
include_str!("../descriptions/filesystem/memstead_search.md"),
),
(
"memstead_update",
include_str!("../descriptions/filesystem/memstead_update.md"),
),
];
pub fn text(table: &[(&'static str, &'static str)], name: &str) -> Option<&'static str> {
table
.iter()
.find(|(n, _)| *n == name)
.map(|(_, t)| t.strip_suffix('\n').unwrap_or(t))
}
pub fn apply<S>(router: &mut ToolRouter<S>, table: &[(&'static str, &'static str)]) {
for (name, route) in router.map.iter_mut() {
let t = text(table, name).unwrap_or_else(|| {
panic!(
"no description file for MCP tool `{name}` — add \
crates/memstead-mcp/descriptions/<surface>/{name}.md and register \
it in src/descriptions.rs"
)
});
route.attr.description = Some(t.into());
}
}