-
Notifications
You must be signed in to change notification settings - Fork 1
Feature Gating
Saltus Framework allows fine-grained control over which features are exposed via REST API routes and MCP/Abilities tools. This is managed through model-level options and per-feature configuration in the config array.
Two master options in the options array control access:
| Option | Type | Default | Description |
|---|---|---|---|
show_in_rest |
bool |
true |
Controls whether model-scoped REST routes are registered. If explicitly set to false, all model-scoped REST capabilities are disabled. |
mcp_tools |
bool |
false |
Must be set and truthy to enable any MCP tools for that model. |
The framework-scoped health capability (get_health) is independent of per-model opt-in and is always available.
return [
'type' => 'cpt',
'name' => 'book',
'options' => [
'show_in_rest' => true,
'mcp_tools' => true,
],
];Each individual capability can be gated independently in the model's config array:
| Feature | Config Key | Location |
|---|---|---|
| Meta | meta |
Root level of config
|
| Settings | settings |
Root level of config
|
| Duplicate | duplicate |
Nested under config.features
|
| Single Export | single_export |
Nested under config.features
|
| Drag & Drop | drag_and_drop |
Nested under config.features
|
For each feature configuration section:
-
Omitted (Null): Falls back to the master model option. If the master option is omitted or false, the feature is disabled. If the master option is true, the feature is enabled.
-
Boolean Value: A simple boolean acts as a joint gate.
falsedisables both REST and MCP.trueenables both. -
Array Value: REST and MCP can be configured independently:
-
show_in_rest— governs REST route availability. Falls back to mastershow_in_restif omitted. -
show_in_mcp— governs MCP tool availability. Falls back to mastermcp_toolsif omitted.
-
return [
'type' => 'cpt',
'name' => 'book',
'options' => [
'show_in_rest' => true,
'mcp_tools' => true,
],
'config' => [
// Array style: enabled for REST but disabled for MCP
'meta' => [
'show_in_rest' => true,
'show_in_mcp' => false,
],
// Boolean style: disabled for both REST and MCP
'settings' => false,
'features' => [
// Array style: enabled for REST, defaults to master (enabled) for MCP
'duplicate' => [
'show_in_rest' => true,
],
// Omitted: both single_export and drag_and_drop
// default to matching the master options (enabled)
],
],
];If show_in_rest is explicitly false, Saltus does not register the model-scoped REST routes. The mcp_tools option controls whether MCP tools are exposed.