db-mcp 2.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -91
- package/dist/.tsbuildinfo +1 -0
- package/dist/adapters/database-adapter.d.ts +173 -0
- package/dist/adapters/database-adapter.d.ts.map +1 -0
- package/dist/adapters/query-validation.d.ts +20 -0
- package/dist/adapters/query-validation.d.ts.map +1 -0
- package/dist/adapters/registration/index.d.ts +4 -0
- package/dist/adapters/registration/index.d.ts.map +1 -0
- package/dist/adapters/registration/prompts.d.ts +7 -0
- package/dist/adapters/registration/prompts.d.ts.map +1 -0
- package/dist/adapters/registration/resources.d.ts +7 -0
- package/dist/adapters/registration/resources.d.ts.map +1 -0
- package/dist/adapters/registration/tools.d.ts +9 -0
- package/dist/adapters/registration/tools.d.ts.map +1 -0
- package/dist/adapters/sqlite/index.d.ts +9 -0
- package/dist/adapters/sqlite/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/json-utils.d.ts +100 -0
- package/dist/adapters/sqlite/json-utils.d.ts.map +1 -0
- package/dist/adapters/sqlite/prompts/analysis.d.ts +23 -0
- package/dist/adapters/sqlite/prompts/analysis.d.ts.map +1 -0
- package/dist/adapters/sqlite/prompts/index.d.ts +16 -0
- package/dist/adapters/sqlite/prompts/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/prompts/query.d.ts +19 -0
- package/dist/adapters/sqlite/prompts/query.d.ts.map +1 -0
- package/dist/adapters/sqlite/prompts/schema.d.ts +20 -0
- package/dist/adapters/sqlite/prompts/schema.d.ts.map +1 -0
- package/dist/adapters/sqlite/query-executor.d.ts +38 -0
- package/dist/adapters/sqlite/query-executor.d.ts.map +1 -0
- package/dist/adapters/sqlite/resources.d.ts +13 -0
- package/dist/adapters/sqlite/resources.d.ts.map +1 -0
- package/dist/adapters/sqlite/schema-manager.d.ts +69 -0
- package/dist/adapters/sqlite/schema-manager.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/admin.d.ts +459 -0
- package/dist/adapters/sqlite/schemas/admin.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/codemode.d.ts +30 -0
- package/dist/adapters/sqlite/schemas/codemode.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/common.d.ts +9 -0
- package/dist/adapters/sqlite/schemas/common.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/core.d.ts +530 -0
- package/dist/adapters/sqlite/schemas/core.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/error-mixin.d.ts +10 -0
- package/dist/adapters/sqlite/schemas/error-mixin.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/fts.d.ts +106 -0
- package/dist/adapters/sqlite/schemas/fts.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/geo.d.ts +135 -0
- package/dist/adapters/sqlite/schemas/geo.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/index.d.ts +23 -0
- package/dist/adapters/sqlite/schemas/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/introspection.d.ts +583 -0
- package/dist/adapters/sqlite/schemas/introspection.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/json.d.ts +849 -0
- package/dist/adapters/sqlite/schemas/json.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/migration.d.ts +220 -0
- package/dist/adapters/sqlite/schemas/migration.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/native.d.ts +235 -0
- package/dist/adapters/sqlite/schemas/native.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/server.d.ts +13 -0
- package/dist/adapters/sqlite/schemas/server.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/spatialite.d.ts +114 -0
- package/dist/adapters/sqlite/schemas/spatialite.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/stats.d.ts +780 -0
- package/dist/adapters/sqlite/schemas/stats.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/text.d.ts +570 -0
- package/dist/adapters/sqlite/schemas/text.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/vector.d.ts +252 -0
- package/dist/adapters/sqlite/schemas/vector.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/virtual.d.ts +257 -0
- package/dist/adapters/sqlite/schemas/virtual.d.ts.map +1 -0
- package/dist/adapters/sqlite/schemas/where.d.ts +20 -0
- package/dist/adapters/sqlite/schemas/where.d.ts.map +1 -0
- package/dist/adapters/sqlite/sqlite-adapter/lifecycle.d.ts +13 -0
- package/dist/adapters/sqlite/sqlite-adapter/lifecycle.d.ts.map +1 -0
- package/dist/adapters/sqlite/sqlite-adapter/schema.d.ts +7 -0
- package/dist/adapters/sqlite/sqlite-adapter/schema.d.ts.map +1 -0
- package/dist/adapters/sqlite/sqlite-adapter.d.ts +138 -0
- package/dist/adapters/sqlite/sqlite-adapter.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/backup/analyze.d.ts +7 -0
- package/dist/adapters/sqlite/tools/admin/backup/analyze.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/backup/create.d.ts +11 -0
- package/dist/adapters/sqlite/tools/admin/backup/create.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/backup/dump.d.ts +7 -0
- package/dist/adapters/sqlite/tools/admin/backup/dump.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/backup/index.d.ts +7 -0
- package/dist/adapters/sqlite/tools/admin/backup/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/backup/integrity.d.ts +7 -0
- package/dist/adapters/sqlite/tools/admin/backup/integrity.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/backup/optimize.d.ts +7 -0
- package/dist/adapters/sqlite/tools/admin/backup/optimize.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/backup/restore.d.ts +7 -0
- package/dist/adapters/sqlite/tools/admin/backup/restore.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/helpers.d.ts +18 -0
- package/dist/adapters/sqlite/tools/admin/helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/index.d.ts +10 -0
- package/dist/adapters/sqlite/tools/admin/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/pragma.d.ts +37 -0
- package/dist/adapters/sqlite/tools/admin/pragma.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/reindex.d.ts +10 -0
- package/dist/adapters/sqlite/tools/admin/reindex.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/verify.d.ts +13 -0
- package/dist/adapters/sqlite/tools/admin/verify.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/admin/wal.d.ts +10 -0
- package/dist/adapters/sqlite/tools/admin/wal.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/codemode.d.ts +22 -0
- package/dist/adapters/sqlite/tools/codemode.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/column-validation.d.ts +26 -0
- package/dist/adapters/sqlite/tools/column-validation.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/alter-table.d.ts +11 -0
- package/dist/adapters/sqlite/tools/core/alter-table.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/constraints.d.ts +10 -0
- package/dist/adapters/sqlite/tools/core/constraints.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/convenience-helpers.d.ts +20 -0
- package/dist/adapters/sqlite/tools/core/convenience-helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/convenience-schemas.d.ts +20 -0
- package/dist/adapters/sqlite/tools/core/convenience-schemas.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/convenience.d.ts +29 -0
- package/dist/adapters/sqlite/tools/core/convenience.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/datetime.d.ts +11 -0
- package/dist/adapters/sqlite/tools/core/datetime.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/index.d.ts +14 -0
- package/dist/adapters/sqlite/tools/core/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/indexes.d.ts +20 -0
- package/dist/adapters/sqlite/tools/core/indexes.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/queries.d.ts +16 -0
- package/dist/adapters/sqlite/tools/core/queries.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/tables.d.ts +37 -0
- package/dist/adapters/sqlite/tools/core/tables.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/core/triggers.d.ts +18 -0
- package/dist/adapters/sqlite/tools/core/triggers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/fts.d.ts +13 -0
- package/dist/adapters/sqlite/tools/fts.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/geo.d.ts +14 -0
- package/dist/adapters/sqlite/tools/geo.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/index.d.ts +33 -0
- package/dist/adapters/sqlite/tools/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/analysis/constraints.d.ts +10 -0
- package/dist/adapters/sqlite/tools/introspection/analysis/constraints.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/analysis/diff.d.ts +11 -0
- package/dist/adapters/sqlite/tools/introspection/analysis/diff.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/analysis/index.d.ts +10 -0
- package/dist/adapters/sqlite/tools/introspection/analysis/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/analysis/risks.d.ts +9 -0
- package/dist/adapters/sqlite/tools/introspection/analysis/risks.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/analysis/snapshot.d.ts +40 -0
- package/dist/adapters/sqlite/tools/introspection/analysis/snapshot.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/diagnostics/index.d.ts +9 -0
- package/dist/adapters/sqlite/tools/introspection/diagnostics/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/diagnostics/indexes.d.ts +10 -0
- package/dist/adapters/sqlite/tools/introspection/diagnostics/indexes.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/diagnostics/query-plan.d.ts +10 -0
- package/dist/adapters/sqlite/tools/introspection/diagnostics/query-plan.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/diagnostics/storage.d.ts +10 -0
- package/dist/adapters/sqlite/tools/introspection/diagnostics/storage.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/graph/helpers.d.ts +44 -0
- package/dist/adapters/sqlite/tools/introspection/graph/helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/graph/index.d.ts +9 -0
- package/dist/adapters/sqlite/tools/introspection/graph/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/graph/tools.d.ts +12 -0
- package/dist/adapters/sqlite/tools/introspection/graph/tools.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/introspection/index.d.ts +17 -0
- package/dist/adapters/sqlite/tools/introspection/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-helpers/helpers.d.ts +21 -0
- package/dist/adapters/sqlite/tools/json-helpers/helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-helpers/index.d.ts +17 -0
- package/dist/adapters/sqlite/tools/json-helpers/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-helpers/read.d.ts +24 -0
- package/dist/adapters/sqlite/tools/json-helpers/read.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-helpers/write.d.ts +24 -0
- package/dist/adapters/sqlite/tools/json-helpers/write.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-operations/crud.d.ts +39 -0
- package/dist/adapters/sqlite/tools/json-operations/crud.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-operations/diff.d.ts +11 -0
- package/dist/adapters/sqlite/tools/json-operations/diff.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-operations/helpers.d.ts +18 -0
- package/dist/adapters/sqlite/tools/json-operations/helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-operations/index.d.ts +10 -0
- package/dist/adapters/sqlite/tools/json-operations/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-operations/query.d.ts +24 -0
- package/dist/adapters/sqlite/tools/json-operations/query.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-operations/security.d.ts +19 -0
- package/dist/adapters/sqlite/tools/json-operations/security.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/json-operations/transform.d.ts +24 -0
- package/dist/adapters/sqlite/tools/json-operations/transform.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/migration/helpers.d.ts +34 -0
- package/dist/adapters/sqlite/tools/migration/helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/migration/index.d.ts +15 -0
- package/dist/adapters/sqlite/tools/migration/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/migration/tracking/apply.d.ts +4 -0
- package/dist/adapters/sqlite/tools/migration/tracking/apply.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/migration/tracking/history.d.ts +4 -0
- package/dist/adapters/sqlite/tools/migration/tracking/history.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/migration/tracking/index.d.ts +7 -0
- package/dist/adapters/sqlite/tools/migration/tracking/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/migration/tracking/init.d.ts +4 -0
- package/dist/adapters/sqlite/tools/migration/tracking/init.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/migration/tracking/record.d.ts +4 -0
- package/dist/adapters/sqlite/tools/migration/tracking/record.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/migration/tracking/rollback.d.ts +4 -0
- package/dist/adapters/sqlite/tools/migration/tracking/rollback.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/migration/tracking/status.d.ts +4 -0
- package/dist/adapters/sqlite/tools/migration/tracking/status.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/advanced.d.ts +28 -0
- package/dist/adapters/sqlite/tools/stats/advanced.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/anomaly-detection.d.ts +22 -0
- package/dist/adapters/sqlite/tools/stats/anomaly-detection.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/basic.d.ts +32 -0
- package/dist/adapters/sqlite/tools/stats/basic.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/helpers.d.ts +27 -0
- package/dist/adapters/sqlite/tools/stats/helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/index.d.ts +12 -0
- package/dist/adapters/sqlite/tools/stats/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/inference/hypothesis.d.ts +7 -0
- package/dist/adapters/sqlite/tools/stats/inference/hypothesis.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/inference/index.d.ts +4 -0
- package/dist/adapters/sqlite/tools/stats/inference/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/inference/outlier.d.ts +7 -0
- package/dist/adapters/sqlite/tools/stats/inference/outlier.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/inference/regression.d.ts +7 -0
- package/dist/adapters/sqlite/tools/stats/inference/regression.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/math-helpers.d.ts +17 -0
- package/dist/adapters/sqlite/tools/stats/math-helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/stats/schema-risks.d.ts +15 -0
- package/dist/adapters/sqlite/tools/stats/schema-risks.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/text/formatting.d.ts +48 -0
- package/dist/adapters/sqlite/tools/text/formatting.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/text/helpers.d.ts +22 -0
- package/dist/adapters/sqlite/tools/text/helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/text/index.d.ts +10 -0
- package/dist/adapters/sqlite/tools/text/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/text/regex.d.ts +21 -0
- package/dist/adapters/sqlite/tools/text/regex.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/text/search.d.ts +17 -0
- package/dist/adapters/sqlite/tools/text/search.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/text/sentiment.d.ts +13 -0
- package/dist/adapters/sqlite/tools/text/sentiment.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/text/validate.d.ts +11 -0
- package/dist/adapters/sqlite/tools/text/validate.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/vector/helpers.d.ts +11 -0
- package/dist/adapters/sqlite/tools/vector/helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/vector/index.d.ts +14 -0
- package/dist/adapters/sqlite/tools/vector/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/vector/metadata.d.ts +28 -0
- package/dist/adapters/sqlite/tools/vector/metadata.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/vector/search.d.ts +16 -0
- package/dist/adapters/sqlite/tools/vector/search.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/vector/storage.d.ts +24 -0
- package/dist/adapters/sqlite/tools/vector/storage.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/vector/tools.d.ts +9 -0
- package/dist/adapters/sqlite/tools/vector/tools.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/analysis.d.ts +24 -0
- package/dist/adapters/sqlite/tools/virtual/analysis.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/extensions.d.ts +13 -0
- package/dist/adapters/sqlite/tools/virtual/extensions.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/helpers.d.ts +18 -0
- package/dist/adapters/sqlite/tools/virtual/helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/index.d.ts +10 -0
- package/dist/adapters/sqlite/tools/virtual/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/views.d.ts +21 -0
- package/dist/adapters/sqlite/tools/virtual/views.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/analyze-csv.d.ts +4 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/analyze-csv.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/csv.d.ts +4 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/csv.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/drop.d.ts +4 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/drop.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/index.d.ts +6 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/index.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/info.d.ts +4 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/info.d.ts.map +1 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/list.d.ts +4 -0
- package/dist/adapters/sqlite/tools/virtual/vtable/list.d.ts.map +1 -0
- package/dist/adapters/sqlite/types.d.ts +89 -0
- package/dist/adapters/sqlite/types.d.ts.map +1 -0
- package/dist/adapters/sqlite-helpers.d.ts +51 -0
- package/dist/adapters/sqlite-helpers.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/extensions.d.ts +17 -0
- package/dist/adapters/sqlite-native/extensions.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/index.d.ts +11 -0
- package/dist/adapters/sqlite-native/index.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/native-query-executor.d.ts +24 -0
- package/dist/adapters/sqlite-native/native-query-executor.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/native-sqlite-adapter.d.ts +160 -0
- package/dist/adapters/sqlite-native/native-sqlite-adapter.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/registration/index.d.ts +12 -0
- package/dist/adapters/sqlite-native/registration/index.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/tools/spatialite/analysis.d.ts +23 -0
- package/dist/adapters/sqlite-native/tools/spatialite/analysis.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/tools/spatialite/index.d.ts +15 -0
- package/dist/adapters/sqlite-native/tools/spatialite/index.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/tools/spatialite/loader.d.ts +22 -0
- package/dist/adapters/sqlite-native/tools/spatialite/loader.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/tools/spatialite/schemas.d.ts +78 -0
- package/dist/adapters/sqlite-native/tools/spatialite/schemas.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/tools/spatialite/tools.d.ts +30 -0
- package/dist/adapters/sqlite-native/tools/spatialite/tools.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/tools/transactions.d.ts +12 -0
- package/dist/adapters/sqlite-native/tools/transactions.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/tools/window.d.ts +7 -0
- package/dist/adapters/sqlite-native/tools/window.d.ts.map +1 -0
- package/dist/adapters/sqlite-native/transaction-methods.d.ts +36 -0
- package/dist/adapters/sqlite-native/transaction-methods.d.ts.map +1 -0
- package/dist/audit/backup-manager.d.ts +90 -0
- package/dist/audit/backup-manager.d.ts.map +1 -0
- package/dist/audit/index.d.ts +11 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/interceptor.d.ts +54 -0
- package/dist/audit/interceptor.d.ts.map +1 -0
- package/dist/audit/logger.d.ts +62 -0
- package/dist/audit/logger.d.ts.map +1 -0
- package/dist/audit/types.d.ts +112 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/auth/auth-context.d.ts +28 -0
- package/dist/auth/auth-context.d.ts.map +1 -0
- package/dist/auth/authorization-server-discovery.d.ts +90 -0
- package/dist/auth/authorization-server-discovery.d.ts.map +1 -0
- package/dist/auth/errors.d.ts +74 -0
- package/dist/auth/errors.d.ts.map +1 -0
- package/dist/auth/middleware/core.d.ts +22 -0
- package/dist/auth/middleware/core.d.ts.map +1 -0
- package/dist/auth/middleware/express-auth.d.ts +13 -0
- package/dist/auth/middleware/express-auth.d.ts.map +1 -0
- package/dist/auth/middleware/express-scopes.d.ts +6 -0
- package/dist/auth/middleware/express-scopes.d.ts.map +1 -0
- package/dist/auth/middleware/extraction.d.ts +2 -0
- package/dist/auth/middleware/extraction.d.ts.map +1 -0
- package/dist/auth/middleware/index.d.ts +5 -0
- package/dist/auth/middleware/index.d.ts.map +1 -0
- package/dist/auth/oauth-resource-server.d.ts +74 -0
- package/dist/auth/oauth-resource-server.d.ts.map +1 -0
- package/dist/auth/scope-map.d.ts +24 -0
- package/dist/auth/scope-map.d.ts.map +1 -0
- package/dist/auth/scopes/constants.d.ts +40 -0
- package/dist/auth/scopes/constants.d.ts.map +1 -0
- package/dist/auth/scopes/display.d.ts +5 -0
- package/dist/auth/scopes/display.d.ts.map +1 -0
- package/dist/auth/scopes/enforcement.d.ts +27 -0
- package/dist/auth/scopes/enforcement.d.ts.map +1 -0
- package/dist/auth/scopes/index.d.ts +6 -0
- package/dist/auth/scopes/index.d.ts.map +1 -0
- package/dist/auth/scopes/mapping.d.ts +39 -0
- package/dist/auth/scopes/mapping.d.ts.map +1 -0
- package/dist/auth/scopes/validation.d.ts +27 -0
- package/dist/auth/scopes/validation.d.ts.map +1 -0
- package/dist/auth/token-validator.d.ts +63 -0
- package/dist/auth/token-validator.d.ts.map +1 -0
- package/dist/auth/transport-agnostic.d.ts +11 -0
- package/dist/auth/transport-agnostic.d.ts.map +1 -0
- package/dist/auth/types.d.ts +257 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/{chunk-WBER5YY4.js → chunk-37G4DLL6.js} +1010 -409
- package/dist/chunk-E5IESRTK.js +489 -0
- package/dist/{chunk-645ZEFLA.js → chunk-L552U3QS.js} +887 -309
- package/dist/{chunk-5Y42NPBP.js → chunk-NV34JSQM.js} +4656 -1829
- package/dist/{chunk-Z7C2TM4L.js → chunk-W5WQVNVX.js} +169 -57
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +47 -26
- package/dist/codemode/api-constants.d.ts +40 -0
- package/dist/codemode/api-constants.d.ts.map +1 -0
- package/dist/codemode/api.d.ts +70 -0
- package/dist/codemode/api.d.ts.map +1 -0
- package/dist/codemode/auto-return.d.ts +25 -0
- package/dist/codemode/auto-return.d.ts.map +1 -0
- package/dist/codemode/index.d.ts +12 -0
- package/dist/codemode/index.d.ts.map +1 -0
- package/dist/codemode/sandbox-factory.d.ts +72 -0
- package/dist/codemode/sandbox-factory.d.ts.map +1 -0
- package/dist/codemode/sandbox.d.ts +54 -0
- package/dist/codemode/sandbox.d.ts.map +1 -0
- package/dist/codemode/security.d.ts +45 -0
- package/dist/codemode/security.d.ts.map +1 -0
- package/dist/codemode/types.d.ts +167 -0
- package/dist/codemode/types.d.ts.map +1 -0
- package/dist/constants/server-instructions.d.ts +22 -0
- package/dist/constants/server-instructions.d.ts.map +1 -0
- package/dist/filtering/tool-constants.d.ts +45 -0
- package/dist/filtering/tool-constants.d.ts.map +1 -0
- package/dist/filtering/tool-filter.d.ts +82 -0
- package/dist/filtering/tool-filter.d.ts.map +1 -0
- package/dist/{http-6KF4ULDI.js → http-HWTUVFIA.js} +498 -391
- package/dist/index.d.ts +9 -1065
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -6
- package/dist/server/mcp-server.d.ts +66 -0
- package/dist/server/mcp-server.d.ts.map +1 -0
- package/dist/server/registration/audit-tools.d.ts +13 -0
- package/dist/server/registration/audit-tools.d.ts.map +1 -0
- package/dist/server/registration/built-in-tools.d.ts +8 -0
- package/dist/server/registration/built-in-tools.d.ts.map +1 -0
- package/dist/server/registration/help-resources.d.ts +7 -0
- package/dist/server/registration/help-resources.d.ts.map +1 -0
- package/dist/server/registration/index.d.ts +4 -0
- package/dist/server/registration/index.d.ts.map +1 -0
- package/dist/{sqlite-U5KSYQXK.js → sqlite-TB56Z7G3.js} +61 -17
- package/dist/{sqlite-native-JXMCFQBA.js → sqlite-native-IF75BB3O.js} +459 -254
- package/dist/transports/http/index.d.ts +8 -0
- package/dist/transports/http/index.d.ts.map +1 -0
- package/dist/transports/http/middleware.d.ts +25 -0
- package/dist/transports/http/middleware.d.ts.map +1 -0
- package/dist/transports/http/oauth.d.ts +24 -0
- package/dist/transports/http/oauth.d.ts.map +1 -0
- package/dist/transports/http/session.d.ts +2 -0
- package/dist/transports/http/session.d.ts.map +1 -0
- package/dist/transports/http/sessions/index.d.ts +4 -0
- package/dist/transports/http/sessions/index.d.ts.map +1 -0
- package/dist/transports/http/sessions/legacy-sse.d.ts +6 -0
- package/dist/transports/http/sessions/legacy-sse.d.ts.map +1 -0
- package/dist/transports/http/sessions/mutex.d.ts +6 -0
- package/dist/transports/http/sessions/mutex.d.ts.map +1 -0
- package/dist/transports/http/sessions/stateful.d.ts +12 -0
- package/dist/transports/http/sessions/stateful.d.ts.map +1 -0
- package/dist/transports/http/sessions/stateless.d.ts +6 -0
- package/dist/transports/http/sessions/stateless.d.ts.map +1 -0
- package/dist/transports/http/transport.d.ts +65 -0
- package/dist/transports/http/transport.d.ts.map +1 -0
- package/dist/transports/http/type-adapters.d.ts +20 -0
- package/dist/transports/http/type-adapters.d.ts.map +1 -0
- package/dist/transports/http/types.d.ts +120 -0
- package/dist/transports/http/types.d.ts.map +1 -0
- package/dist/types/adapter.d.ts +138 -0
- package/dist/types/adapter.d.ts.map +1 -0
- package/dist/types/auth.d.ts +79 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/database.d.ts +100 -0
- package/dist/types/database.d.ts.map +1 -0
- package/dist/types/filtering.d.ts +41 -0
- package/dist/types/filtering.d.ts.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/server.d.ts +48 -0
- package/dist/types/server.d.ts.map +1 -0
- package/dist/utils/annotations.d.ts +62 -0
- package/dist/utils/annotations.d.ts.map +1 -0
- package/dist/utils/errors/base.d.ts +33 -0
- package/dist/utils/errors/base.d.ts.map +1 -0
- package/dist/utils/errors/categories.d.ts +41 -0
- package/dist/utils/errors/categories.d.ts.map +1 -0
- package/dist/utils/errors/classes.d.ts +124 -0
- package/dist/utils/errors/classes.d.ts.map +1 -0
- package/dist/utils/errors/error-response-fields.d.ts +24 -0
- package/dist/utils/errors/error-response-fields.d.ts.map +1 -0
- package/dist/utils/errors/format.d.ts +74 -0
- package/dist/utils/errors/format.d.ts.map +1 -0
- package/dist/utils/errors/index.d.ts +11 -0
- package/dist/utils/errors/index.d.ts.map +1 -0
- package/dist/utils/errors/suggestions.d.ts +16 -0
- package/dist/utils/errors/suggestions.d.ts.map +1 -0
- package/dist/utils/icons.d.ts +19 -0
- package/dist/utils/icons.d.ts.map +1 -0
- package/dist/utils/identifiers.d.ts +121 -0
- package/dist/utils/identifiers.d.ts.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/insights-manager.d.ts +39 -0
- package/dist/utils/insights-manager.d.ts.map +1 -0
- package/dist/utils/logger/error-codes.d.ts +48 -0
- package/dist/utils/logger/error-codes.d.ts.map +1 -0
- package/dist/utils/logger/index.d.ts +22 -0
- package/dist/utils/logger/index.d.ts.map +1 -0
- package/dist/utils/logger/logger.d.ts +94 -0
- package/dist/utils/logger/logger.d.ts.map +1 -0
- package/dist/utils/logger/module-logger.d.ts +28 -0
- package/dist/utils/logger/module-logger.d.ts.map +1 -0
- package/dist/utils/logger/types.d.ts +36 -0
- package/dist/utils/logger/types.d.ts.map +1 -0
- package/dist/utils/progress-utils.d.ts +54 -0
- package/dist/utils/progress-utils.d.ts.map +1 -0
- package/dist/utils/redaction.d.ts +4 -0
- package/dist/utils/redaction.d.ts.map +1 -0
- package/dist/utils/resource-annotations.d.ts +36 -0
- package/dist/utils/resource-annotations.d.ts.map +1 -0
- package/dist/utils/validate-json-path.d.ts +43 -0
- package/dist/utils/validate-json-path.d.ts.map +1 -0
- package/dist/utils/validate-path.d.ts +37 -0
- package/dist/utils/validate-path.d.ts.map +1 -0
- package/dist/utils/where-clause.d.ts +42 -0
- package/dist/utils/where-clause.d.ts.map +1 -0
- package/dist/version.d.ts +10 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +26 -13
- package/.gitattributes +0 -2
- package/.gitleaks.toml +0 -9
- package/.trivyignore +0 -8
- package/dist/chunk-OKOVZ5QE.js +0 -28
- package/dist/chunk-SFJQCNG7.js +0 -131
- package/dist/chunk-VIDSICEL.js +0 -85
- package/dist/chunk-X3MUUOWM.js +0 -152
- package/dist/worker-script.d.ts +0 -2
- package/dist/worker-script.js +0 -150
- package/logs/.gitkeep +0 -1
- package/mcp-config-example.json +0 -83
- package/playwright.config.ts +0 -101
- package/scripts/generate-server-instructions.ts +0 -111
- package/scripts/update-badges.ts +0 -99
- package/server.json +0 -54
- package/test-server/README.md +0 -115
- package/test-server/code-map.md +0 -421
- package/test-server/fixtures/sample.csv +0 -6
- package/test-server/reset-database.ps1 +0 -415
- package/test-server/sample.csv +0 -11
- package/test-server/scripts/README.md +0 -27
- package/test-server/scripts/test-help-resources.mjs +0 -245
- package/test-server/scripts/test-prompts.mjs +0 -251
- package/test-server/scripts/test-tool-annotations.mjs +0 -162
- package/test-server/test-advanced/README.md +0 -70
- package/test-server/test-advanced/test-codemode-advanced-admin.md +0 -174
- package/test-server/test-advanced/test-codemode-advanced-core.md +0 -193
- package/test-server/test-advanced/test-codemode-advanced-geo.md +0 -157
- package/test-server/test-advanced/test-codemode-advanced-introspection.md +0 -171
- package/test-server/test-advanced/test-codemode-advanced-json.md +0 -169
- package/test-server/test-advanced/test-codemode-advanced-migration.md +0 -160
- package/test-server/test-advanced/test-codemode-advanced-stats.md +0 -185
- package/test-server/test-advanced/test-codemode-advanced-text.md +0 -183
- package/test-server/test-advanced/test-codemode-advanced-transactions.md +0 -136
- package/test-server/test-advanced/test-codemode-advanced-vector.md +0 -141
- package/test-server/test-codemode/README.md +0 -121
- package/test-server/test-codemode/test-codemode-admin.md +0 -223
- package/test-server/test-codemode/test-codemode-core.md +0 -286
- package/test-server/test-codemode/test-codemode-geo.md +0 -177
- package/test-server/test-codemode/test-codemode-introspection.md +0 -190
- package/test-server/test-codemode/test-codemode-json.md +0 -237
- package/test-server/test-codemode/test-codemode-migration.md +0 -278
- package/test-server/test-codemode/test-codemode-sandbox.md +0 -413
- package/test-server/test-codemode/test-codemode-stats.md +0 -232
- package/test-server/test-codemode/test-codemode-text.md +0 -237
- package/test-server/test-codemode/test-codemode-transactions.md +0 -236
- package/test-server/test-codemode/test-codemode-vector.md +0 -244
- package/test-server/test-codemode/test-codemode-wasm-degradation.md +0 -394
- package/test-server/test-database.sql +0 -424
- package/test-server/test-preflight.md +0 -53
- package/test-server/test-prompts.md +0 -354
- package/test-server/test-resources.md +0 -272
- package/test-server/test-tool-groups/README.md +0 -100
- package/test-server/test-tool-groups/test-admin-core.md +0 -165
- package/test-server/test-tool-groups/test-admin-extensions.md +0 -133
- package/test-server/test-tool-groups/test-core-data.md +0 -262
- package/test-server/test-tool-groups/test-core-schema.md +0 -240
- package/test-server/test-tool-groups/test-geo-haversine.md +0 -130
- package/test-server/test-tool-groups/test-geo-spatialite.md +0 -110
- package/test-server/test-tool-groups/test-introspection-diagnostics.md +0 -123
- package/test-server/test-tool-groups/test-introspection-schema.md +0 -133
- package/test-server/test-tool-groups/test-json-read.md +0 -219
- package/test-server/test-tool-groups/test-json-write.md +0 -157
- package/test-server/test-tool-groups/test-migration.md +0 -193
- package/test-server/test-tool-groups/test-stats-advanced.md +0 -118
- package/test-server/test-tool-groups/test-stats-basic.md +0 -156
- package/test-server/test-tool-groups/test-text-advanced.md +0 -169
- package/test-server/test-tool-groups/test-text-basic.md +0 -177
- package/test-server/test-tool-groups/test-transactions.md +0 -179
- package/test-server/test-tool-groups/test-vector-read.md +0 -130
- package/test-server/test-tool-groups/test-vector-write.md +0 -115
- package/test-server/tool-reference.md +0 -257
- package/tsconfig.build.json +0 -6
- package/tsconfig.test.json +0 -9
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
# db-mcp Tool Group Testing: [core-data]
|
|
2
|
-
|
|
3
|
-
> [!IMPORTANT]
|
|
4
|
-
> **Do not track progress in this file.** Track your test progress, coverage matrix, and findings in your internal task tracking system (artifact). However, you SHOULD edit this file to fix any factual errors, broken code, or incorrect assertions in the test prompts.
|
|
5
|
-
> If there is nothing to fix, don't update UNRELEASED.md.
|
|
6
|
-
> We're currently testing Native mode.
|
|
7
|
-
|
|
8
|
-
## WASM Mode
|
|
9
|
-
|
|
10
|
-
> When testing against a **WASM backend** (`sqlite-wasm` / sql.js): All 7 core data tools are fully WASM-compatible. No items to skip or adjust.
|
|
11
|
-
|
|
12
|
-
**Step 1:** Confirm you read the server help content sourced from `C:\Users\chris\Desktop\db-mcp\src\constants\server-instructions\gotchas.md` using `view_file` (not grep or search) — to understand documented behaviors, edge cases, and response structures for this tool group.
|
|
13
|
-
|
|
14
|
-
**Step 2:** Please conduct an exhaustive test of the **core-data** tool group specified in the group-specific checklist below using live MCP server tool calls directly — not scripts/terminal.
|
|
15
|
-
|
|
16
|
-
**Step 3:** The agent should update C:\Users\chris\Desktop\db-mcp\UNRELEASED.md with any/all changes/fixes.
|
|
17
|
-
|
|
18
|
-
**Note** If temp tables are present from a previous test pass, it's because the database is locked. Ignore them.
|
|
19
|
-
|
|
20
|
-
## Reporting Format
|
|
21
|
-
|
|
22
|
-
- ❌ Fail: Tool errors or produces incorrect results (include error message)
|
|
23
|
-
- ⚠️ Issue: Unexpected behavior or improvement opportunity
|
|
24
|
-
- 📦 Payload: Unnecessarily large response that should be optimized — **blocking, equally important as ❌ bugs**. Oversized payloads waste LLM context window tokens and degrade downstream tool-calling quality. Report the response size in KB and suggest a concrete optimization (e.g., filter system tables, add `compact` option, omit empty arrays).
|
|
25
|
-
|
|
26
|
-
## Test Database Schema
|
|
27
|
-
|
|
28
|
-
The test database (test-server/test.db) contains these tables with JSON-relevant columns:
|
|
29
|
-
|
|
30
|
-
| Table | Rows | Columns | JSON Columns |
|
|
31
|
-
| ----------------- | ---- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
32
|
-
| test_products | 16 | id, name, description, price, category, created_at | — |
|
|
33
|
-
| test_orders | 20 | id, product_id (FK), customer_name, quantity, total_price, order_date, status | — |
|
|
34
|
-
| test_jsonb_docs | 6 | id, doc, metadata, tags, created_at | **doc**, **metadata** (nested), **tags** (array) |
|
|
35
|
-
| test_articles | 8 | id, title, body, author, category, published_at | — |
|
|
36
|
-
| test_users | 9 | id, username, email, phone, bio, created_at | — |
|
|
37
|
-
| test_measurements | 200 | id, sensor_id, temperature, humidity, pressure, measured_at | — |
|
|
38
|
-
| test_embeddings | 20 | id, content, category, embedding | **embedding** (8-dim float array); category values: database, fitness, food, tech, travel |
|
|
39
|
-
| test_locations | 15 | id, name, city, latitude, longitude, type | — |
|
|
40
|
-
| test_categories | 17 | id, name, path, level | — |
|
|
41
|
-
| test_events | 100 | id, event_type, user_id (INT, 8 values), payload, event_date | **payload** (JSON) |
|
|
42
|
-
|
|
43
|
-
**Primary JSON test tables:**
|
|
44
|
-
|
|
45
|
-
- `test_jsonb_docs.doc` — Row 1: `{"type":"article","title":"Getting Started with SQLite","author":"Alice","views":1250,"rating":4.5}`, Row 3: `{"type":"video",...,"duration":3600}`, Row 4 has `nested.level1.level2 = "deep value"`
|
|
46
|
-
- `test_jsonb_docs.metadata` — Object with keys: source, language, version, quality, subscribers
|
|
47
|
-
- `test_jsonb_docs.tags` — Array of strings like `["database","tutorial","beginner"]`
|
|
48
|
-
- `test_events.payload` — Object with keys: page (values: home, products, cart, checkout), session (values: sess_1000+)
|
|
49
|
-
|
|
50
|
-
> **Note:** String values in test data use **lowercase** (e.g., `category = 'electronics'`, not `'Electronics'`). Use case-sensitive matching in queries.
|
|
51
|
-
|
|
52
|
-
> **Note:** `test_measurements.sensor_id` is an **INTEGER** column (values 1-5), not a string. Use `sensor_id = 1`, not `sensor_id = 'S001'`.
|
|
53
|
-
|
|
54
|
-
## Testing Requirements
|
|
55
|
-
|
|
56
|
-
> [!CAUTION]
|
|
57
|
-
> **Zero tolerance for raw MCP errors.** ANY response that is a raw MCP error (e.g., `-32602`, `isError: true`, no `success` field) is a **bug that must be reported and fixed** — never an acceptable design choice, SDK limitation, or expected behavior. If you see one, report it as ❌ immediately. Do not rationalize it as "the SDK rejecting at the boundary" or "by design for range-constrained params." The handler MUST catch it.
|
|
58
|
-
|
|
59
|
-
1. Use existing `test_*` tables for read operations (SELECT, COUNT, queries)
|
|
60
|
-
2. Create temporary tables with `temp_*` prefix for write operations
|
|
61
|
-
3. Test each tool with realistic inputs based on the schema above
|
|
62
|
-
4. Report all failures, unexpected behaviors, improvement opportunities, or unnecessarily large payloads
|
|
63
|
-
5. Do not mention what already works well or issues well documented in help resources and runtime hints which are already optimal
|
|
64
|
-
6. **Error path testing**: For **every** tool, test at least **two** invalid inputs: (a) a domain error (nonexistent table, invalid column, missing required parameter) and (b) a **Zod validation error** (call the tool with `{}` empty params if it has required parameters, or pass the wrong type). Both must return a **structured handler error** (`{success: false, error: "..."}`) — NOT a raw MCP error frame. See the "Structured Error Response Pattern" section below for how to distinguish the two. This is the most common deficiency found across tool groups.
|
|
65
|
-
7. **Output schema testing**: For **every** tool that has an `outputSchema`, confirm that at least one valid happy-path call returns a structured JSON response — NOT a raw MCP `-32602` "output schema" error. Output schema mismatches (handler returns fields not declared in the schema) produce the same `-32602` code as input errors but are only caught with valid inputs. See "Output Schema Validation Errors" below. Also check for the inverse: if a schema is **defined** in `src/adapters/sqlite/schemas/` but **not wired** to the tool definition, report as ⚠️ — the schema exists but provides no enforcement.
|
|
66
|
-
8. **Deterministic checklist first**: Complete ALL items in the group-specific checklist before moving to freeform exploration. The checklist uses exact inputs and expected outputs to ensure reproducible coverage every run.
|
|
67
|
-
9. **Code Over Docs**: Fix the handler code if standards (Structured Errors/Zod) are violated. Do NOT change docs/prompts to accommodate broken code.
|
|
68
|
-
|
|
69
|
-
## Structured Error Response Pattern
|
|
70
|
-
|
|
71
|
-
All tools should return errors as structured objects instead of throwing. A thrown error propagates as a raw MCP error, which is unhelpful to clients. The expected pattern:
|
|
72
|
-
|
|
73
|
-
```json
|
|
74
|
-
{ "success": false, "error": "Human-readable error message" }
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Handler Error vs MCP Error — How to Distinguish
|
|
78
|
-
|
|
79
|
-
There are two kinds of error responses. Only one is correct:
|
|
80
|
-
|
|
81
|
-
| Type | Source | What you see | Verdict |
|
|
82
|
-
| -------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | ------------------ |
|
|
83
|
-
| **Handler error** ✅ | Handler catches error and returns `{success: false, error: "..."}` | Parseable JSON object with `success` and `error` fields | Correct |
|
|
84
|
-
| **MCP error** ❌ | Uncaught throw propagates to MCP framework | Raw text error string, often prefixed with `Error:`, wrapped in an `isError: true` content block — no `success` field | Bug — report as ❌ |
|
|
85
|
-
|
|
86
|
-
**Concrete examples:**
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
✅ Handler error (correct):
|
|
90
|
-
{"success": false, "error": "Table 'nonexistent_xyz' does not exist"}
|
|
91
|
-
|
|
92
|
-
❌ MCP error (bug — handler threw instead of catching):
|
|
93
|
-
content: [{type: "text", text: "Error: SQLITE_ERROR: no such table: nonexistent_xyz"}]
|
|
94
|
-
isError: true
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
The MCP error case means the handler is missing a `try/catch` block. When testing, if you see a raw error string (especially one containing `SQLITE_ERROR` without a `success` field), report it as ❌.
|
|
98
|
-
|
|
99
|
-
### Zod Validation Errors
|
|
100
|
-
|
|
101
|
-
Calling a tool with wrong parameter types or missing required fields triggers a Zod validation error. If the handler has no outer `try/catch`, this surfaces as a raw MCP error (often `-32602`). Test every tool with `{}` (empty params) if it has required parameters — the response must be a handler error, not an MCP error.
|
|
102
|
-
|
|
103
|
-
**Zod refinement leak pattern:** `DatabaseAdapter.registerTool()` uses `.partial()` on input schemas so the SDK accepts `{}`. But `.partial()` only makes keys **optional** — it does NOT strip refinements like `.min(1)`, `.max(90)`, or `.min(-90).max(90)`. This applies to **ALL types** — strings, arrays, AND numbers:
|
|
104
|
-
|
|
105
|
-
- `z.string().min(1)` + empty `""` → SDK rejects with raw MCP `-32602`
|
|
106
|
-
- `z.array().min(1)` + empty `[]` → SDK rejects with raw MCP `-32602`
|
|
107
|
-
- `z.number().min(-90).max(90)` + value `91` → SDK rejects with raw MCP `-32602`
|
|
108
|
-
|
|
109
|
-
**Fix:** Remove ALL `.min(N)` / `.max(N)` refinements from the schema and validate inside the handler instead (see `sqlite_query_plan` in `diagnostics.ts`, `sqlite_append_insight` in `pragma.ts`, and `validateCoordinates()` in `geo.ts` for examples). Optional fields with `.default()` are safe because the default satisfies the constraint.
|
|
110
|
-
|
|
111
|
-
**Required enum coercion pattern:** For **optional** enum params with defaults, `z.preprocess(coercer, z.enum([...]).optional().default(...))` works — the coercer returns `undefined` for invalid values → the `.default()` kicks in. For **required** enum params (no `.optional().default(...)`), this pattern **fails**: the SDK's `.partial()` wraps the preprocess in `.optional()`, but the inner `z.enum()` still rejects `undefined` → raw MCP `-32602`. **Fix:** Use `z.string()` in the schema and validate the enum inside the handler's `try/catch`, returning a structured error (see `VALID_ANALYSIS_TYPES` / `VALID_OPERATIONS` / `VALID_FORMATS` in SpatiaLite `analysis.ts` for examples).
|
|
112
|
-
|
|
113
|
-
**What to report:**
|
|
114
|
-
|
|
115
|
-
- If a tool call returns a raw MCP error (no JSON body with `success` field), report it as ❌ with the tool name and the raw error message
|
|
116
|
-
- If a tool returns `{success: false, error: "..."}`, that is the correct behavior — do not report it as a failure
|
|
117
|
-
- If a tool returns a successful response for an obviously invalid input (e.g., nonexistent table returns `{success: true}`), report it as ⚠️
|
|
118
|
-
|
|
119
|
-
### Wrong-Type Numeric Parameter Coercion
|
|
120
|
-
|
|
121
|
-
For every tool with optional numeric parameters (e.g., `limit`, `buckets`, `windowSize`, `radius`, `sampleSize`), call the tool with `param: "abc"` (string instead of number). The tool must NOT return a raw MCP `-32602` error. Acceptable behaviors:
|
|
122
|
-
|
|
123
|
-
- Handler returns `{success: false, error: "..."}` with a validation message
|
|
124
|
-
- Handler silently applies the default value
|
|
125
|
-
- Handler coerces to NaN and returns a descriptive error
|
|
126
|
-
|
|
127
|
-
Unacceptable: Raw MCP error frame with `-32602` code.
|
|
128
|
-
|
|
129
|
-
### Output Schema Validation Errors
|
|
130
|
-
|
|
131
|
-
The MCP SDK enforces `additionalProperties: false` on **output** schemas. If a handler returns fields not declared in its output schema, the SDK rejects the response with a raw `-32602` error — even though the handler logic succeeded. This is a different failure mode from input validation:
|
|
132
|
-
|
|
133
|
-
- **Input `-32602`**: Triggered by sending unrecognized/invalid parameters → caught by the Zod sweep (call with `{}` or `extraParam`)
|
|
134
|
-
- **Output `-32602`**: Triggered by the handler **returning** undeclared fields → caught by a valid happy-path call that still produces a raw MCP error
|
|
135
|
-
|
|
136
|
-
**How to detect:** If a tool call with **correct, valid inputs** returns a raw MCP `-32602` mentioning "does not match the tool's output schema" or "additional properties", the output schema in `src/adapters/sqlite/schemas/` is missing fields that the handler returns. Report as ❌ with both the tool name and the missing field(s).
|
|
137
|
-
|
|
138
|
-
**Fix pattern:** Add the missing fields to the output schema (e.g., `durationMs: z.number().optional()`, `message: z.string().optional()`). Do NOT remove fields from the handler response — the schema must match reality.
|
|
139
|
-
|
|
140
|
-
**Systematic check:** For every tool that has an `outputSchema`, make at least one valid happy-path call and confirm it returns a parseable JSON object with a `success` field — not a raw MCP error. This is separate from (and complementary to) the Zod validation sweep, which tests invalid inputs.
|
|
141
|
-
|
|
142
|
-
### Error Consistency Audit
|
|
143
|
-
|
|
144
|
-
During testing, check for these inconsistencies across tool groups:
|
|
145
|
-
|
|
146
|
-
1. **Throw-vs-return**: If a tool throws a raw error instead of returning `{success: false}`, report as ❌. Document which tool groups have raw-error leakage.
|
|
147
|
-
2. **Error field name**: All `{success: false}` responses should use `error` as the field name. The `reason` field is reserved for `{success: true, skipped: true}` informational responses.
|
|
148
|
-
3. **Zod validation leaks**: If calling a tool with an invalid enum value or missing required field produces a raw MCP `-32602` error instead of a structured response, report as ❌.
|
|
149
|
-
4. **Output schema leaks**: If calling a tool with valid inputs produces a raw MCP `-32602` mentioning "output schema" or "additional properties", report as ❌ (see "Output Schema Validation Errors" above).
|
|
150
|
-
5. **Centralized error formatting**: db-mcp uses `DbMcpError`. If any tool group catches errors but formats them inconsistently (e.g., different message patterns for the same error type), report as ⚠️.
|
|
151
|
-
6. **Orphaned output schemas**: If a schema is exported from `src/adapters/sqlite/schemas/` (e.g., `TransactionBeginOutputSchema`) but the corresponding tool definition does not reference it via `outputSchema`, report as ⚠️. Use `grep_search` to check whether the schema name appears in any tool file under `src/adapters/`. Defined-but-unwired schemas provide zero enforcement.
|
|
152
|
-
7. **Inline output schemas**: If any tool defines `outputSchema: z.object({...})` inline in the handler file instead of importing a named schema from `schemas/`, report as ⚠️. All output schemas must live in `src/adapters/sqlite/schemas/` with named exports. Use `grep_search` with pattern `outputSchema: z.object` across `src/adapters/` to detect violations.
|
|
153
|
-
|
|
154
|
-
## Error Path Testing Checklist
|
|
155
|
-
|
|
156
|
-
For each tool group under test, verify at least one scenario from each applicable row:
|
|
157
|
-
|
|
158
|
-
| Error Scenario | Tool Groups to Test | Example Input |
|
|
159
|
-
| --------------------------------- | ----------------------------------- | ----------------------------------------------------------------------- |
|
|
160
|
-
| Nonexistent table | All table-accepting tools | `table: "nonexistent_xyz"` |
|
|
161
|
-
| Invalid SQL syntax | Core (`read_query`, `write_query`) | `query: "SELEKT * FROM"` |
|
|
162
|
-
| Invalid column name | Stats, JSON, text, vector, geo | `column: "nonexistent_col"` |
|
|
163
|
-
| Missing required field | All tools with required params | Omit `table`, `query`, etc. |
|
|
164
|
-
| **Zod validation (empty params)** | **Every tool with required params** | `{}` (empty object — must return handler error, not MCP `-32602` error) |
|
|
165
|
-
| **Zod validation (wrong type)** | **Tools with typed params** | Pass string where number expected, etc. |
|
|
166
|
-
|
|
167
|
-
### Split Schema Pattern Verification
|
|
168
|
-
|
|
169
|
-
All tools use the Split Schema pattern: a plain `z.object()` Base schema for MCP parameter visibility, and a `z.preprocess()` wrapper for handler parsing. Verify:
|
|
170
|
-
|
|
171
|
-
1. **Parameter visibility**: For tools with optional parameters (e.g., `limit`, `readonly`), make a direct MCP call using those parameters. If the tool ignores or rejects documented parameters, report as a Split Schema violation.
|
|
172
|
-
2. **Alias acceptance**: For tools with documented parameter aliases (e.g., `table`/`tableName`, `query`/`sql`, `indexName`/`name`), verify that direct MCP tool calls correctly accept the aliases.
|
|
173
|
-
|
|
174
|
-
## Cleanup Conventions
|
|
175
|
-
|
|
176
|
-
During testing, use these naming conventions:
|
|
177
|
-
|
|
178
|
-
- **Temporary tables**: Prefix with `temp_` (e.g., `temp_core_test`)
|
|
179
|
-
|
|
180
|
-
After testing, clean up:
|
|
181
|
-
|
|
182
|
-
```sql
|
|
183
|
-
-- Drop temp table
|
|
184
|
-
DROP TABLE IF EXISTS temp_core_test;
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## Group Focus: core-data
|
|
190
|
-
|
|
191
|
-
> **Instructions**: Execute every numbered checklist item with the exact inputs shown. Compare responses against the expected results. Report any deviation.
|
|
192
|
-
|
|
193
|
-
### Built-in Tools (3)
|
|
194
|
-
|
|
195
|
-
1. server_info
|
|
196
|
-
2. server_health
|
|
197
|
-
3. list_adapters
|
|
198
|
-
|
|
199
|
-
### core-data Group Tools (7)
|
|
200
|
-
|
|
201
|
-
4. sqlite_read_query
|
|
202
|
-
5. sqlite_write_query
|
|
203
|
-
6. sqlite_upsert
|
|
204
|
-
7. sqlite_batch_insert
|
|
205
|
-
8. sqlite_count
|
|
206
|
-
9. sqlite_exists
|
|
207
|
-
10. sqlite_truncate
|
|
208
|
-
|
|
209
|
-
**Checklist:**
|
|
210
|
-
|
|
211
|
-
1. `server_info` → verify server name, version, adapter info present
|
|
212
|
-
2. `server_health` → verify healthy status
|
|
213
|
-
3. `list_adapters` → verify at least one adapter listed
|
|
214
|
-
4. `sqlite_read_query({query: "SELECT COUNT(*) AS n FROM test_products"})` → `{rows: [{n: 16}]}`
|
|
215
|
-
5. `sqlite_read_query({query: "SELECT name, price FROM test_products WHERE price > ?", params: [500]})` → 1 result: `Laptop Pro 15` (1299.99) (Note: Parameter binding test)
|
|
216
|
-
6. `sqlite_read_query({query: "SELECT COUNT(*) AS n FROM test_orders WHERE status = 'completed'"})` → `{rows: [{n: 8}]}`
|
|
217
|
-
7. `sqlite_create_table({table: "temp_core_test2", columns: [{name: "id", type: "INTEGER", primaryKey: true}, {name: "val", type: "TEXT"}]})` → success
|
|
218
|
-
8. `sqlite_batch_insert({table: "temp_core_test2", rows: [{id: 1, val: "a"}, {id: 2, val: "b"}], returning: true})` → `{rowsAffected: 2}` and returns inserted rows (Note: Test `returning` parameter)
|
|
219
|
-
9. `sqlite_upsert({table: "temp_core_test2", data: {id: 1, val: "c"}, conflictColumns: ["id"], updateColumns: ["val"], returning: true})` → `{rowsAffected: 1}` and returns updated row
|
|
220
|
-
10. `sqlite_count({table: "test_products"})` → `{count: 16}`
|
|
221
|
-
11. `sqlite_exists({table: "test_products", where: "id = 1"})` → `{exists: true}`
|
|
222
|
-
12. `sqlite_truncate({table: "temp_core_test2"})` → `{rowsAffected: 2}`
|
|
223
|
-
13. `sqlite_drop_table({table: "temp_core_test2"})` → success
|
|
224
|
-
|
|
225
|
-
**Error path testing:**
|
|
226
|
-
|
|
227
|
-
🔴 14. `sqlite_read_query({query: "SELECT * FROM nonexistent_table_xyz"})` → structured error mentioning table name
|
|
228
|
-
|
|
229
|
-
**Zod validation sweep** — call each tool with `{}` (empty params). Every response must be a handler error (`{success: false, error: "Validation error: ..."}`) — NOT a raw MCP error frame:
|
|
230
|
-
|
|
231
|
-
🔴 15. `sqlite_read_query({})` → handler error
|
|
232
|
-
🔴 16. `sqlite_write_query({})` → handler error
|
|
233
|
-
🔴 17. `sqlite_upsert({})` → handler error
|
|
234
|
-
🔴 18. `sqlite_batch_insert({})` → handler error
|
|
235
|
-
🔴 19. `sqlite_count({})` → handler error
|
|
236
|
-
🔴 20. `sqlite_exists({})` → handler error
|
|
237
|
-
🔴 21. `sqlite_truncate({})` → handler error
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
## Post-Test Procedures
|
|
242
|
-
|
|
243
|
-
### Reporting Rules
|
|
244
|
-
|
|
245
|
-
- Use ✅ only in inline notes during testing; omit from Final Summary
|
|
246
|
-
- Do not mention what already works well or issues already documented in help resources and runtime hints
|
|
247
|
-
|
|
248
|
-
### After Testing
|
|
249
|
-
|
|
250
|
-
1. **Triage findings**: If issues were found, create an implementation plan, making sure they are consistent with working patterns in other tools/tool groups. If the plan requires no user decisions, proceed directly to implementation
|
|
251
|
-
2. **Scope of fixes** includes corrections to any of:
|
|
252
|
-
- Handler code
|
|
253
|
-
- `src/constants/server-instructions/*.md` (per-group help files) — run `npm run generate:instructions` after editing to regenerate `server-instructions.ts`
|
|
254
|
-
- Test database (`test-server/test.db`)
|
|
255
|
-
- This prompt
|
|
256
|
-
|
|
257
|
-
### After Implementation
|
|
258
|
-
|
|
259
|
-
3. **Validate**: Instruct the user to run the test suite (Vitest/Playwright), lint, and typecheck. Do NOT run them yourself.
|
|
260
|
-
4. **Commit**: Stage and commit all changes — do NOT push
|
|
261
|
-
5. **Live re-test**: Test fixes with direct MCP tool calls. I will have already rebuilt and restarted the server.
|
|
262
|
-
6. **Final summary**: If no issues found, provide the final summary after testing. If issues were fixed, provide the summary after live MCP re-testing confirms fixes are working. If the test prompt/database can be improved, make the improvements.
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
# db-mcp Tool Group Testing: [core-schema]
|
|
2
|
-
|
|
3
|
-
> [!IMPORTANT]
|
|
4
|
-
> **Do not track progress in this file.** Track your test progress, coverage matrix, and findings in your internal task tracking system (artifact). However, you SHOULD edit this file to fix any factual errors, broken code, or incorrect assertions in the test prompts.
|
|
5
|
-
> If there is nothing to fix, don't update UNRELEASED.md.
|
|
6
|
-
> We're currently testing Native mode.
|
|
7
|
-
|
|
8
|
-
## WASM Mode
|
|
9
|
-
|
|
10
|
-
> When testing against a **WASM backend** (`sqlite-wasm` / sql.js): All 8 core schema tools are fully WASM-compatible. No items to skip or adjust.
|
|
11
|
-
|
|
12
|
-
**Step 1:** Confirm you read the server help content sourced from `C:\Users\chris\Desktop\db-mcp\src\constants\server-instructions\gotchas.md` using `view_file` (not grep or search) — to understand documented behaviors, edge cases, and response structures for this tool group.
|
|
13
|
-
|
|
14
|
-
**Step 2:** Please conduct an exhaustive test of the **core-schema** tool group specified in the group-specific checklist below using live MCP server tool calls directly — not scripts/terminal.
|
|
15
|
-
|
|
16
|
-
**Step 3:** The agent should update C:\Users\chris\Desktop\db-mcp\UNRELEASED.md with any/all changes/fixes.
|
|
17
|
-
|
|
18
|
-
**Note** If temp tables are present from a previous test pass, it's because the database is locked. Ignore them.
|
|
19
|
-
|
|
20
|
-
## Reporting Format
|
|
21
|
-
|
|
22
|
-
- ❌ Fail: Tool errors or produces incorrect results (include error message)
|
|
23
|
-
- ⚠️ Issue: Unexpected behavior or improvement opportunity
|
|
24
|
-
- 📦 Payload: Unnecessarily large response that should be optimized — **blocking, equally important as ❌ bugs**. Oversized payloads waste LLM context window tokens and degrade downstream tool-calling quality. Report the response size in KB and suggest a concrete optimization (e.g., filter system tables, add `compact` option, omit empty arrays).
|
|
25
|
-
|
|
26
|
-
## Test Database Schema
|
|
27
|
-
|
|
28
|
-
The test database (test-server/test.db) contains these tables with JSON-relevant columns:
|
|
29
|
-
|
|
30
|
-
| Table | Rows | Columns | JSON Columns |
|
|
31
|
-
| ----------------- | ---- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
32
|
-
| test_products | 16 | id, name, description, price, category, created_at | — |
|
|
33
|
-
| test_orders | 20 | id, product_id (FK), customer_name, quantity, total_price, order_date, status | — |
|
|
34
|
-
| test_jsonb_docs | 6 | id, doc, metadata, tags, created_at | **doc**, **metadata** (nested), **tags** (array) |
|
|
35
|
-
| test_articles | 8 | id, title, body, author, category, published_at | — |
|
|
36
|
-
| test_users | 9 | id, username, email, phone, bio, created_at | — |
|
|
37
|
-
| test_measurements | 200 | id, sensor_id, temperature, humidity, pressure, measured_at | — |
|
|
38
|
-
| test_embeddings | 20 | id, content, category, embedding | **embedding** (8-dim float array); category values: database, fitness, food, tech, travel |
|
|
39
|
-
| test_locations | 15 | id, name, city, latitude, longitude, type | — |
|
|
40
|
-
| test_categories | 17 | id, name, path, level | — |
|
|
41
|
-
| test_events | 100 | id, event_type, user_id (INT, 8 values), payload, event_date | **payload** (JSON) |
|
|
42
|
-
|
|
43
|
-
## Testing Requirements
|
|
44
|
-
|
|
45
|
-
> [!CAUTION]
|
|
46
|
-
> **Zero tolerance for raw MCP errors.** ANY response that is a raw MCP error (e.g., `-32602`, `isError: true`, no `success` field) is a **bug that must be reported and fixed** — never an acceptable design choice, SDK limitation, or expected behavior. If you see one, report it as ❌ immediately. Do not rationalize it as "the SDK rejecting at the boundary" or "by design for range-constrained params." The handler MUST catch it.
|
|
47
|
-
|
|
48
|
-
1. Use existing `test_*` tables for read operations (SELECT, COUNT, queries)
|
|
49
|
-
2. Create temporary tables with `temp_*` prefix for write operations
|
|
50
|
-
3. Test each tool with realistic inputs based on the schema above
|
|
51
|
-
4. Report all failures, unexpected behaviors, improvement opportunities, or unnecessarily large payloads
|
|
52
|
-
5. Do not mention what already works well or issues well documented in help resources and runtime hints which are already optimal
|
|
53
|
-
6. **Error path testing**: For **every** tool, test at least **two** invalid inputs: (a) a domain error (nonexistent table, invalid column, missing required parameter) and (b) a **Zod validation error** (call the tool with `{}` empty params if it has required parameters, or pass the wrong type). Both must return a **structured handler error** (`{success: false, error: "..."}`) — NOT a raw MCP error frame. See the "Structured Error Response Pattern" section below for how to distinguish the two. This is the most common deficiency found across tool groups.
|
|
54
|
-
7. **Output schema testing**: For **every** tool that has an `outputSchema`, confirm that at least one valid happy-path call returns a structured JSON response — NOT a raw MCP `-32602` "output schema" error. Output schema mismatches (handler returns fields not declared in the schema) produce the same `-32602` code as input errors but are only caught with valid inputs. See "Output Schema Validation Errors" below. Also check for the inverse: if a schema is **defined** in `src/adapters/sqlite/schemas/` but **not wired** to the tool definition, report as ⚠️ — the schema exists but provides no enforcement.
|
|
55
|
-
8. **Deterministic checklist first**: Complete ALL items in the group-specific checklist before moving to freeform exploration. The checklist uses exact inputs and expected outputs to ensure reproducible coverage every run.
|
|
56
|
-
9. **Code Over Docs**: Fix the handler code if standards (Structured Errors/Zod) are violated. Do NOT change docs/prompts to accommodate broken code.
|
|
57
|
-
|
|
58
|
-
## Structured Error Response Pattern
|
|
59
|
-
|
|
60
|
-
All tools should return errors as structured objects instead of throwing. A thrown error propagates as a raw MCP error, which is unhelpful to clients. The expected pattern:
|
|
61
|
-
|
|
62
|
-
```json
|
|
63
|
-
{ "success": false, "error": "Human-readable error message" }
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Handler Error vs MCP Error — How to Distinguish
|
|
67
|
-
|
|
68
|
-
There are two kinds of error responses. Only one is correct:
|
|
69
|
-
|
|
70
|
-
| Type | Source | What you see | Verdict |
|
|
71
|
-
| -------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | ------------------ |
|
|
72
|
-
| **Handler error** ✅ | Handler catches error and returns `{success: false, error: "..."}` | Parseable JSON object with `success` and `error` fields | Correct |
|
|
73
|
-
| **MCP error** ❌ | Uncaught throw propagates to MCP framework | Raw text error string, often prefixed with `Error:`, wrapped in an `isError: true` content block — no `success` field | Bug — report as ❌ |
|
|
74
|
-
|
|
75
|
-
**Concrete examples:**
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
✅ Handler error (correct):
|
|
79
|
-
{"success": false, "error": "Table 'nonexistent_xyz' does not exist"}
|
|
80
|
-
|
|
81
|
-
❌ MCP error (bug — handler threw instead of catching):
|
|
82
|
-
content: [{type: "text", text: "Error: SQLITE_ERROR: no such table: nonexistent_xyz"}]
|
|
83
|
-
isError: true
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
The MCP error case means the handler is missing a `try/catch` block. When testing, if you see a raw error string (especially one containing `SQLITE_ERROR` without a `success` field), report it as ❌.
|
|
87
|
-
|
|
88
|
-
### Zod Validation Errors
|
|
89
|
-
|
|
90
|
-
Calling a tool with wrong parameter types or missing required fields triggers a Zod validation error. If the handler has no outer `try/catch`, this surfaces as a raw MCP error (often `-32602`). Test every tool with `{}` (empty params) if it has required parameters — the response must be a handler error, not an MCP error.
|
|
91
|
-
|
|
92
|
-
**Zod refinement leak pattern:** `DatabaseAdapter.registerTool()` uses `.partial()` on input schemas so the SDK accepts `{}`. But `.partial()` only makes keys **optional** — it does NOT strip refinements like `.min(1)`, `.max(90)`, or `.min(-90).max(90)`. This applies to **ALL types** — strings, arrays, AND numbers:
|
|
93
|
-
|
|
94
|
-
- `z.string().min(1)` + empty `""` → SDK rejects with raw MCP `-32602`
|
|
95
|
-
- `z.array().min(1)` + empty `[]` → SDK rejects with raw MCP `-32602`
|
|
96
|
-
- `z.number().min(-90).max(90)` + value `91` → SDK rejects with raw MCP `-32602`
|
|
97
|
-
|
|
98
|
-
**Fix:** Remove ALL `.min(N)` / `.max(N)` refinements from the schema and validate inside the handler instead (see `sqlite_query_plan` in `diagnostics.ts`, `sqlite_append_insight` in `pragma.ts`, and `validateCoordinates()` in `geo.ts` for examples). Optional fields with `.default()` are safe because the default satisfies the constraint.
|
|
99
|
-
|
|
100
|
-
**Required enum coercion pattern:** For **optional** enum params with defaults, `z.preprocess(coercer, z.enum([...]).optional().default(...))` works — the coercer returns `undefined` for invalid values → the `.default()` kicks in. For **required** enum params (no `.optional().default(...)`), this pattern **fails**: the SDK's `.partial()` wraps the preprocess in `.optional()`, but the inner `z.enum()` still rejects `undefined` → raw MCP `-32602`. **Fix:** Use `z.string()` in the schema and validate the enum inside the handler's `try/catch`, returning a structured error (see `VALID_ANALYSIS_TYPES` / `VALID_OPERATIONS` / `VALID_FORMATS` in SpatiaLite `analysis.ts` for examples).
|
|
101
|
-
|
|
102
|
-
**What to report:**
|
|
103
|
-
|
|
104
|
-
- If a tool call returns a raw MCP error (no JSON body with `success` field), report it as ❌ with the tool name and the raw error message
|
|
105
|
-
- If a tool returns `{success: false, error: "..."}`, that is the correct behavior — do not report it as a failure
|
|
106
|
-
- If a tool returns a successful response for an obviously invalid input (e.g., nonexistent table returns `{success: true}`), report it as ⚠️
|
|
107
|
-
|
|
108
|
-
### Output Schema Validation Errors
|
|
109
|
-
|
|
110
|
-
The MCP SDK enforces `additionalProperties: false` on **output** schemas. If a handler returns fields not declared in its output schema, the SDK rejects the response with a raw `-32602` error — even though the handler logic succeeded. This is a different failure mode from input validation:
|
|
111
|
-
|
|
112
|
-
- **Input `-32602`**: Triggered by sending unrecognized/invalid parameters → caught by the Zod sweep (call with `{}` or `extraParam`)
|
|
113
|
-
- **Output `-32602`**: Triggered by the handler **returning** undeclared fields → caught by a valid happy-path call that still produces a raw MCP error
|
|
114
|
-
|
|
115
|
-
**How to detect:** If a tool call with **correct, valid inputs** returns a raw MCP `-32602` mentioning "does not match the tool's output schema" or "additional properties", the output schema in `src/adapters/sqlite/schemas/` is missing fields that the handler returns. Report as ❌ with both the tool name and the missing field(s).
|
|
116
|
-
|
|
117
|
-
**Fix pattern:** Add the missing fields to the output schema (e.g., `durationMs: z.number().optional()`, `message: z.string().optional()`). Do NOT remove fields from the handler response — the schema must match reality.
|
|
118
|
-
|
|
119
|
-
**Systematic check:** For every tool that has an `outputSchema`, make at least one valid happy-path call and confirm it returns a parseable JSON object with a `success` field — not a raw MCP error. This is separate from (and complementary to) the Zod validation sweep, which tests invalid inputs.
|
|
120
|
-
|
|
121
|
-
### Error Consistency Audit
|
|
122
|
-
|
|
123
|
-
During testing, check for these inconsistencies across tool groups:
|
|
124
|
-
|
|
125
|
-
1. **Throw-vs-return**: If a tool throws a raw error instead of returning `{success: false}`, report as ❌. Document which tool groups have raw-error leakage.
|
|
126
|
-
2. **Error field name**: All `{success: false}` responses should use `error` as the field name. The `reason` field is reserved for `{success: true, skipped: true}` informational responses.
|
|
127
|
-
3. **Zod validation leaks**: If calling a tool with an invalid enum value or missing required field produces a raw MCP `-32602` error instead of a structured response, report as ❌.
|
|
128
|
-
4. **Output schema leaks**: If calling a tool with valid inputs produces a raw MCP `-32602` mentioning "output schema" or "additional properties", report as ❌ (see "Output Schema Validation Errors" above).
|
|
129
|
-
5. **Centralized error formatting**: db-mcp uses `DbMcpError`. If any tool group catches errors but formats them inconsistently (e.g., different message patterns for the same error type), report as ⚠️.
|
|
130
|
-
6. **Orphaned output schemas**: If a schema is exported from `src/adapters/sqlite/schemas/` (e.g., `TransactionBeginOutputSchema`) but the corresponding tool definition does not reference it via `outputSchema`, report as ⚠️. Use `grep_search` to check whether the schema name appears in any tool file under `src/adapters/`. Defined-but-unwired schemas provide zero enforcement.
|
|
131
|
-
7. **Inline output schemas**: If any tool defines `outputSchema: z.object({...})` inline in the handler file instead of importing a named schema from `schemas/`, report as ⚠️. All output schemas must live in `src/adapters/sqlite/schemas/` with named exports. Use `grep_search` with pattern `outputSchema: z.object` across `src/adapters/` to detect violations.
|
|
132
|
-
|
|
133
|
-
## Error Path Testing Checklist
|
|
134
|
-
|
|
135
|
-
For each tool group under test, verify at least one scenario from each applicable row:
|
|
136
|
-
|
|
137
|
-
| Error Scenario | Tool Groups to Test | Example Input |
|
|
138
|
-
| --------------------------------- | ------------------------------------- | ----------------------------------------------------------------------- |
|
|
139
|
-
| Nonexistent table | All table-accepting tools | `table: "nonexistent_xyz"` |
|
|
140
|
-
| Duplicate table/index | Core (`create_table`, `create_index`) | Create existing table |
|
|
141
|
-
| Missing required field | All tools with required params | Omit `table`, `query`, etc. |
|
|
142
|
-
| **Zod validation (empty params)** | **Every tool with required params** | `{}` (empty object — must return handler error, not MCP `-32602` error) |
|
|
143
|
-
| **Zod validation (wrong type)** | **Tools with typed params** | Pass string where number expected, etc. |
|
|
144
|
-
|
|
145
|
-
### Split Schema Pattern Verification
|
|
146
|
-
|
|
147
|
-
All tools use the Split Schema pattern: a plain `z.object()` Base schema for MCP parameter visibility, and a `z.preprocess()` wrapper for handler parsing. Verify:
|
|
148
|
-
|
|
149
|
-
1. **Parameter visibility**: For tools with optional parameters (e.g., `limit`, `readonly`), make a direct MCP call using those parameters. If the tool ignores or rejects documented parameters, report as a Split Schema violation.
|
|
150
|
-
2. **Alias acceptance**: For tools with documented parameter aliases (e.g., `table`/`tableName`, `query`/`sql`, `indexName`/`name`), verify that direct MCP tool calls correctly accept the aliases.
|
|
151
|
-
|
|
152
|
-
## Cleanup Conventions
|
|
153
|
-
|
|
154
|
-
During testing, use these naming conventions:
|
|
155
|
-
|
|
156
|
-
- **Temporary tables**: Prefix with `temp_` (e.g., `temp_core_test`)
|
|
157
|
-
- **Temporary indexes**: Prefix with `temp_idx_` (e.g., `temp_idx_name`)
|
|
158
|
-
|
|
159
|
-
After testing, clean up:
|
|
160
|
-
|
|
161
|
-
```sql
|
|
162
|
-
-- List temp tables
|
|
163
|
-
SELECT name FROM sqlite_master WHERE type='table' AND name LIKE 'temp_%';
|
|
164
|
-
|
|
165
|
-
-- Drop temp table
|
|
166
|
-
DROP TABLE IF EXISTS temp_core_test;
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Group Focus: core-schema
|
|
172
|
-
|
|
173
|
-
> **Instructions**: Execute every numbered checklist item with the exact inputs shown. Compare responses against the expected results. Report any deviation.
|
|
174
|
-
|
|
175
|
-
### core-schema Group Tools (8)
|
|
176
|
-
|
|
177
|
-
1. sqlite_list_tables
|
|
178
|
-
2. sqlite_describe_table
|
|
179
|
-
3. sqlite_create_table
|
|
180
|
-
4. sqlite_drop_table
|
|
181
|
-
5. sqlite_get_indexes
|
|
182
|
-
6. sqlite_create_index
|
|
183
|
-
7. sqlite_drop_index
|
|
184
|
-
8. sqlite_execute_code
|
|
185
|
-
|
|
186
|
-
**Checklist:**
|
|
187
|
-
|
|
188
|
-
1. `sqlite_list_tables({excludeSystemTables: true})` → verify `test_products`, `test_orders`, etc. all present, but `sqlite_master` or `sqlite_sequence` absent
|
|
189
|
-
2. `sqlite_describe_table({table: "test_products"})` → verify columns include `id` (INTEGER), `name` (TEXT), `price` (REAL), `category` (TEXT)
|
|
190
|
-
3. `sqlite_get_indexes({table: "test_orders", excludeSystemIndexes: true})` → verify `idx_orders_status` and `idx_orders_date` present
|
|
191
|
-
4. `sqlite_create_table({table: "temp_core_test", columns: [{name: "id", type: "INTEGER", primaryKey: true}, {name: "name", type: "TEXT"}, {name: "value", type: "REAL"}], ifNotExists: true})` → success
|
|
192
|
-
5. `sqlite_create_table({table: "temp_core_test", columns: [{name: "id", type: "INTEGER", primaryKey: true}], ifNotExists: true})` → success (should not fail if table already exists due to ifNotExists)
|
|
193
|
-
6. `sqlite_create_index({table: "temp_core_test", columns: ["name"], indexName: "idx_temp_core_name", unique: false, ifNotExists: true})` → success
|
|
194
|
-
7. `sqlite_drop_index({indexName: "idx_temp_core_name", ifExists: true})` → success
|
|
195
|
-
8. `sqlite_drop_table({table: "temp_core_test", ifExists: true})` → success
|
|
196
|
-
|
|
197
|
-
**Code mode testing:**
|
|
198
|
-
|
|
199
|
-
9. `sqlite_execute_code({code: "const tables = await sqlite.core.listTables(); return tables;"})` → returns list of tables including `test_products`, `test_orders`, etc.
|
|
200
|
-
10. `sqlite_execute_code({code: "const result = await sqlite.core.writeQuery('INSERT INTO test_products VALUES (999, \"x\", \"x\", 0, \"x\", \"x\")'); return result;", readonly: true})` → `result` contains `{success: false, code: "CODEMODE_READONLY_VIOLATION"}` (code mode returns errors as values, not thrown exceptions)
|
|
201
|
-
|
|
202
|
-
**Error path testing:**
|
|
203
|
-
|
|
204
|
-
🔴 11. `sqlite_describe_table({table: "nonexistent_table_xyz"})` → structured error response, NOT a raw MCP exception
|
|
205
|
-
🔴 12. `sqlite_drop_table({table: "nonexistent_table_xyz"})` → structured error or `{existed: false}` style response
|
|
206
|
-
|
|
207
|
-
**Zod validation sweep** — call each tool with `{}` (empty params). Every response must be a handler error (`{success: false, error: "Validation error: ..."}`) — NOT a raw MCP error frame:
|
|
208
|
-
|
|
209
|
-
🔴 13. `sqlite_create_table({})` → handler error
|
|
210
|
-
🔴 14. `sqlite_describe_table({})` → handler error
|
|
211
|
-
🔴 15. `sqlite_drop_table({})` → handler error
|
|
212
|
-
🔴 16. `sqlite_get_indexes({})` → success (returns all indexes, table is optional)
|
|
213
|
-
🔴 17. `sqlite_create_index({})` → handler error
|
|
214
|
-
🔴 18. `sqlite_drop_index({})` → handler error
|
|
215
|
-
🔴 19. `sqlite_execute_code({})` → handler error (has required `code` param)
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
## Post-Test Procedures
|
|
220
|
-
|
|
221
|
-
### Reporting Rules
|
|
222
|
-
|
|
223
|
-
- Use ✅ only in inline notes during testing; omit from Final Summary
|
|
224
|
-
- Do not mention what already works well or issues already documented in help resources and runtime hints
|
|
225
|
-
|
|
226
|
-
### After Testing
|
|
227
|
-
|
|
228
|
-
1. **Triage findings**: If issues were found, create an implementation plan, making sure they are consistent with working patterns in other tools/tool groups. If the plan requires no user decisions, proceed directly to implementation
|
|
229
|
-
2. **Scope of fixes** includes corrections to any of:
|
|
230
|
-
- Handler code
|
|
231
|
-
- `src/constants/server-instructions/*.md` (per-group help files) — run `npm run generate:instructions` after editing to regenerate `server-instructions.ts`
|
|
232
|
-
- Test database (`test-server/test.db`)
|
|
233
|
-
- This prompt
|
|
234
|
-
|
|
235
|
-
### After Implementation
|
|
236
|
-
|
|
237
|
-
3. **Validate**: Instruct the user to run the test suite (Vitest/Playwright), lint, and typecheck. Do NOT run them yourself.
|
|
238
|
-
4. **Commit**: Stage and commit all changes — do NOT push
|
|
239
|
-
5. **Live re-test**: Test fixes with direct MCP tool calls. I will have already rebuilt and restarted the server.
|
|
240
|
-
6. **Final summary**: If no issues found, provide the final summary after testing. If issues were fixed, provide the summary after live MCP re-testing confirms fixes are working. If the test prompt/database can be improved, make the improvements.
|