use mcp_host::prelude::*;
use mcp_host::registry::router::McpResourceRouter;
use super::super::McpState;
use super::super::tools::jailfile_create::JailfileCreateParams;
const URI: &str = "blackship:///schema/jailfile";
const MIME: &str = "application/schema+json";
impl McpState {
#[mcp_resource(
uri = "blackship:///schema/jailfile",
name = "schema/jailfile",
mime_type = "application/schema+json",
description = "JSON Schema of `jailfile_create` arguments. Absent field = inexpressible in TOML Jailfiles."
)]
async fn schema_jailfile(&self, _ctx: Ctx<'_>) -> ResourceResult {
let schema = serde_json::to_string(&schema_for::<JailfileCreateParams>())
.map_err(|e| ResourceError::Internal(format!("Failed to serialize schema: {e}")))?;
Ok(vec![text_resource_with_mime(URI, schema, MIME)])
}
}
pub fn mount(
router: McpResourceRouter<McpState>,
) -> Result<McpResourceRouter<McpState>, AppsError> {
Ok(router.with_resource(
McpState::schema_jailfile_resource_info()?,
McpState::schema_jailfile_handler,
None,
))
}