spreadsheet_mcp/
caps.rs

1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
5pub struct BackendCaps {
6    pub backend: BackendKind,
7    pub supports_styles: bool,
8    pub supports_tables: bool,
9    pub supports_comments: bool,
10    pub supports_defined_names: bool,
11    pub supports_conditional_formatting: bool,
12    pub supports_formula_graph: bool,
13}
14
15impl BackendCaps {
16    pub fn xlsx() -> Self {
17        Self {
18            backend: BackendKind::XlsxUmya,
19            supports_styles: true,
20            supports_tables: true,
21            supports_comments: true,
22            supports_defined_names: true,
23            supports_conditional_formatting: true,
24            supports_formula_graph: true,
25        }
26    }
27
28    pub fn degraded_for_ods() -> Self {
29        Self {
30            backend: BackendKind::OdsFuture,
31            supports_styles: false,
32            supports_tables: false,
33            supports_comments: false,
34            supports_defined_names: true,
35            supports_conditional_formatting: false,
36            supports_formula_graph: true,
37        }
38    }
39}
40
41#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
42#[serde(rename_all = "snake_case")]
43pub enum BackendKind {
44    XlsxUmya,
45    OdsFuture,
46}