Skip to main content

Module codes

Module codes 

Source
Expand description

Structured error codes emitted in the data.code field of every MCP error response. These are &'static str constants so callers can pattern-match them programmatically.

Constants§

AGGREGATOR_ERROR
Returned when the query_aggregate tool receives a structurally inconsistent request (empty sources, ATTACH-limit exceeded, inner-without-group-by, etc.) — distinct from per-field validation errors (those use VALIDATION_ERROR) and from raw SQLite failures (those use STORAGE_ERROR).
ALIAS_ALREADY_EXISTS
Returned when alias_create is called but an alias with the same name already exists in the table’s _aliases storage.
ALIAS_NOT_FOUND
Returned when a named query alias does not exist in _aliases.
ALIAS_PARAMS_REQUIRED
Returned when alias_run is called without params but the alias has a non-null params_schema (i.e. the alias requires parameter injection).
ALIAS_TEMPLATE_ERROR
Returned when MiniJinja template rendering fails (syntax error or missing variable) during alias_run.
AMBIGUOUS_ID
Returned when an id prefix matches more than one row and the caller must disambiguate by using a longer prefix or the full UUID.
AMBIGUOUS_MATCH
Returned when content_replace finds two or more occurrences of old_str and replace_all was not set — caller must scope with view_range or pass replace_all=true.
BACKUP_ERROR
Returned when a backup I/O or SQLite backup operation fails.
BATCH_ABORTED
Returned when schema_batch is aborted because one of its ops fails.
CONFIG_ERROR
Returned when environment-variable or .env configuration is invalid.
IO_ERROR
Returned when an I/O operation (file open, read) fails.
MATERIALIZE_DEST_INVALID
Returned when the row_materialize dest path is invalid for another reason.
MATERIALIZE_DEST_RELATIVE
Returned when the row_materialize dest path is relative (absolute required).
MATERIALIZE_EMPTY_RESULT
Returned when the filter in row_materialize matches zero rows.
MATERIALIZE_FIELD_UNKNOWN
Returned when a projected field name is not present in the schema.
MATERIALIZE_FORMAT_ERROR
Returned when serialization to the requested format fails during row_materialize.
MATERIALIZE_INVALID_PARAM
Returned when row_materialize parameters are structurally invalid.
MATERIALIZE_IO_ERROR
Returned when a file I/O error occurs during row_materialize.
MATERIALIZE_ROW_NOT_FOUND
Returned when the specified row id is not found during row_materialize.
MATERIALIZE_SHA256_ERROR
Returned when SHA-256 computation fails during row_materialize.
NOT_FOUND
Returned when a requested row does not exist.
OUT_OF_RANGE
Returned when content_insert receives a line value that exceeds total_lines + 1.
SCHEMA_ERROR
Returned when schema.yaml cannot be parsed or is structurally invalid.
SCHEMA_EXISTS
Returned when a schema file already exists and schema_create would overwrite it.
SNAPSHOT_ERROR
Returned when a snapshot I/O or SQLite snapshot operation fails.
STORAGE_ERROR
Returned when a SQLite operation fails.
STRING_NOT_FOUND
Returned when content_replace finds zero occurrences of old_str in the target field (or within the scoped view_range).
TABLE_NOT_FOUND
Returned when the requested table is not mounted in the registry.
TABLE_REQUIRED
Returned when table argument is required but was omitted.
TYPE_ERROR
Returned when a partial-edit tool (content_view / content_replace / content_insert) targets a field whose schema type is not String.
UPLOAD_FAILED
Returned when an S3-compatible upload operation fails (network error, auth rejection, or local snapshot file read failure).
UPLOAD_NOT_CONFIGURED
Returned when data_snapshot is called with upload=true but the server binary was built without the s3-upload feature, or the MINI_APP_S3_* environment variables are incomplete.
VALIDATION_ERROR
Returned when a required field is missing or a value has the wrong type.