Problem types
Every error a Castra API returns has a type of the form https://castra.mehmetozer.dev/problems/<code>.
Clients can branch on it; it does not change between releases.
audit_failed | 500 | The MCP call could not be written to the audit log, so it was not served. |
conflict | 409 | The row changed while your update was running. |
constraint | 409 | The write violates a database constraint. |
forbidden | 403 | You are signed in, but the policy does not allow this operation for you. |
insufficient_scope | 403 | The MCP token does not have the scope this tool needs. |
internal | 500 | An unexpected error. The response never contains SQL, parameters or stack traces. |
invalid_body | 400 | The request body is not usable. |
invalid_cursor | 400 | The pagination cursor is not valid for this request. |
invalid_filter | 400 | A filter in the query string cannot be used. |
invalid_identity | 400 | The MCP as argument is not a valid identity. |
invalid_include | 400 | An include names a relation that is not available to you. |
invalid_input | 400 | The policy engine rejected the input before checking any rule. |
invalid_reference | 400 | A foreign key column points at a row that does not exist. |
invalid_request | 400 | The query string or request shape is not valid. |
invalid_sort | 400 | The order parameter names a column you cannot sort on. |
invalid_value | 400 | A value does not match its column type. |
method_not_allowed | 405 | The HTTP method is not supported on this path. |
missing_column | 400 | A required column (NOT NULL, no default) is missing from the create body. |
not_found | 404 | The table, row or route does not exist, or you are not allowed to know that it exists. |
payload_too_large | 413 | The request body is larger than the limit (1 MiB for REST and /mcp). |
readonly_column | 400 | The body tries to change a column that cannot be changed. |
roles_not_allowed | 400 | The remote /mcp server does not accept as.roles. |
server_column | 400 | The body sets a column the server fills in. |
unauthenticated | 401 | This operation needs a signed-in user, API key or MCP token, and the request had none (or an invalid one). |
unknown_column | 400 | The body or query names a column that does not exist for you. |
unknown_role | 400 | MCP as.roles names a role that is not in the config. |
unknown_user | 400 | MCP as.userId does not name an existing user. |
unsafe_schema | 403 | Creates and updates are disabled on this table for everyone, because its schema can silently delete rows. |
unsupported_media_type | 415 | The request body is not JSON. |
write_check_failed | 403 | The row as stored would not satisfy the policy, so the write was rolled back. |
write_unavailable | 500 | Writes are disabled because the Worker has no D1 binding. |