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.
Files changed (553) hide show
  1. package/README.md +96 -91
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/adapters/database-adapter.d.ts +173 -0
  4. package/dist/adapters/database-adapter.d.ts.map +1 -0
  5. package/dist/adapters/query-validation.d.ts +20 -0
  6. package/dist/adapters/query-validation.d.ts.map +1 -0
  7. package/dist/adapters/registration/index.d.ts +4 -0
  8. package/dist/adapters/registration/index.d.ts.map +1 -0
  9. package/dist/adapters/registration/prompts.d.ts +7 -0
  10. package/dist/adapters/registration/prompts.d.ts.map +1 -0
  11. package/dist/adapters/registration/resources.d.ts +7 -0
  12. package/dist/adapters/registration/resources.d.ts.map +1 -0
  13. package/dist/adapters/registration/tools.d.ts +9 -0
  14. package/dist/adapters/registration/tools.d.ts.map +1 -0
  15. package/dist/adapters/sqlite/index.d.ts +9 -0
  16. package/dist/adapters/sqlite/index.d.ts.map +1 -0
  17. package/dist/adapters/sqlite/json-utils.d.ts +100 -0
  18. package/dist/adapters/sqlite/json-utils.d.ts.map +1 -0
  19. package/dist/adapters/sqlite/prompts/analysis.d.ts +23 -0
  20. package/dist/adapters/sqlite/prompts/analysis.d.ts.map +1 -0
  21. package/dist/adapters/sqlite/prompts/index.d.ts +16 -0
  22. package/dist/adapters/sqlite/prompts/index.d.ts.map +1 -0
  23. package/dist/adapters/sqlite/prompts/query.d.ts +19 -0
  24. package/dist/adapters/sqlite/prompts/query.d.ts.map +1 -0
  25. package/dist/adapters/sqlite/prompts/schema.d.ts +20 -0
  26. package/dist/adapters/sqlite/prompts/schema.d.ts.map +1 -0
  27. package/dist/adapters/sqlite/query-executor.d.ts +38 -0
  28. package/dist/adapters/sqlite/query-executor.d.ts.map +1 -0
  29. package/dist/adapters/sqlite/resources.d.ts +13 -0
  30. package/dist/adapters/sqlite/resources.d.ts.map +1 -0
  31. package/dist/adapters/sqlite/schema-manager.d.ts +69 -0
  32. package/dist/adapters/sqlite/schema-manager.d.ts.map +1 -0
  33. package/dist/adapters/sqlite/schemas/admin.d.ts +459 -0
  34. package/dist/adapters/sqlite/schemas/admin.d.ts.map +1 -0
  35. package/dist/adapters/sqlite/schemas/codemode.d.ts +30 -0
  36. package/dist/adapters/sqlite/schemas/codemode.d.ts.map +1 -0
  37. package/dist/adapters/sqlite/schemas/common.d.ts +9 -0
  38. package/dist/adapters/sqlite/schemas/common.d.ts.map +1 -0
  39. package/dist/adapters/sqlite/schemas/core.d.ts +530 -0
  40. package/dist/adapters/sqlite/schemas/core.d.ts.map +1 -0
  41. package/dist/adapters/sqlite/schemas/error-mixin.d.ts +10 -0
  42. package/dist/adapters/sqlite/schemas/error-mixin.d.ts.map +1 -0
  43. package/dist/adapters/sqlite/schemas/fts.d.ts +106 -0
  44. package/dist/adapters/sqlite/schemas/fts.d.ts.map +1 -0
  45. package/dist/adapters/sqlite/schemas/geo.d.ts +135 -0
  46. package/dist/adapters/sqlite/schemas/geo.d.ts.map +1 -0
  47. package/dist/adapters/sqlite/schemas/index.d.ts +23 -0
  48. package/dist/adapters/sqlite/schemas/index.d.ts.map +1 -0
  49. package/dist/adapters/sqlite/schemas/introspection.d.ts +583 -0
  50. package/dist/adapters/sqlite/schemas/introspection.d.ts.map +1 -0
  51. package/dist/adapters/sqlite/schemas/json.d.ts +849 -0
  52. package/dist/adapters/sqlite/schemas/json.d.ts.map +1 -0
  53. package/dist/adapters/sqlite/schemas/migration.d.ts +220 -0
  54. package/dist/adapters/sqlite/schemas/migration.d.ts.map +1 -0
  55. package/dist/adapters/sqlite/schemas/native.d.ts +235 -0
  56. package/dist/adapters/sqlite/schemas/native.d.ts.map +1 -0
  57. package/dist/adapters/sqlite/schemas/server.d.ts +13 -0
  58. package/dist/adapters/sqlite/schemas/server.d.ts.map +1 -0
  59. package/dist/adapters/sqlite/schemas/spatialite.d.ts +114 -0
  60. package/dist/adapters/sqlite/schemas/spatialite.d.ts.map +1 -0
  61. package/dist/adapters/sqlite/schemas/stats.d.ts +780 -0
  62. package/dist/adapters/sqlite/schemas/stats.d.ts.map +1 -0
  63. package/dist/adapters/sqlite/schemas/text.d.ts +570 -0
  64. package/dist/adapters/sqlite/schemas/text.d.ts.map +1 -0
  65. package/dist/adapters/sqlite/schemas/vector.d.ts +252 -0
  66. package/dist/adapters/sqlite/schemas/vector.d.ts.map +1 -0
  67. package/dist/adapters/sqlite/schemas/virtual.d.ts +257 -0
  68. package/dist/adapters/sqlite/schemas/virtual.d.ts.map +1 -0
  69. package/dist/adapters/sqlite/schemas/where.d.ts +20 -0
  70. package/dist/adapters/sqlite/schemas/where.d.ts.map +1 -0
  71. package/dist/adapters/sqlite/sqlite-adapter/lifecycle.d.ts +13 -0
  72. package/dist/adapters/sqlite/sqlite-adapter/lifecycle.d.ts.map +1 -0
  73. package/dist/adapters/sqlite/sqlite-adapter/schema.d.ts +7 -0
  74. package/dist/adapters/sqlite/sqlite-adapter/schema.d.ts.map +1 -0
  75. package/dist/adapters/sqlite/sqlite-adapter.d.ts +138 -0
  76. package/dist/adapters/sqlite/sqlite-adapter.d.ts.map +1 -0
  77. package/dist/adapters/sqlite/tools/admin/backup/analyze.d.ts +7 -0
  78. package/dist/adapters/sqlite/tools/admin/backup/analyze.d.ts.map +1 -0
  79. package/dist/adapters/sqlite/tools/admin/backup/create.d.ts +11 -0
  80. package/dist/adapters/sqlite/tools/admin/backup/create.d.ts.map +1 -0
  81. package/dist/adapters/sqlite/tools/admin/backup/dump.d.ts +7 -0
  82. package/dist/adapters/sqlite/tools/admin/backup/dump.d.ts.map +1 -0
  83. package/dist/adapters/sqlite/tools/admin/backup/index.d.ts +7 -0
  84. package/dist/adapters/sqlite/tools/admin/backup/index.d.ts.map +1 -0
  85. package/dist/adapters/sqlite/tools/admin/backup/integrity.d.ts +7 -0
  86. package/dist/adapters/sqlite/tools/admin/backup/integrity.d.ts.map +1 -0
  87. package/dist/adapters/sqlite/tools/admin/backup/optimize.d.ts +7 -0
  88. package/dist/adapters/sqlite/tools/admin/backup/optimize.d.ts.map +1 -0
  89. package/dist/adapters/sqlite/tools/admin/backup/restore.d.ts +7 -0
  90. package/dist/adapters/sqlite/tools/admin/backup/restore.d.ts.map +1 -0
  91. package/dist/adapters/sqlite/tools/admin/helpers.d.ts +18 -0
  92. package/dist/adapters/sqlite/tools/admin/helpers.d.ts.map +1 -0
  93. package/dist/adapters/sqlite/tools/admin/index.d.ts +10 -0
  94. package/dist/adapters/sqlite/tools/admin/index.d.ts.map +1 -0
  95. package/dist/adapters/sqlite/tools/admin/pragma.d.ts +37 -0
  96. package/dist/adapters/sqlite/tools/admin/pragma.d.ts.map +1 -0
  97. package/dist/adapters/sqlite/tools/admin/reindex.d.ts +10 -0
  98. package/dist/adapters/sqlite/tools/admin/reindex.d.ts.map +1 -0
  99. package/dist/adapters/sqlite/tools/admin/verify.d.ts +13 -0
  100. package/dist/adapters/sqlite/tools/admin/verify.d.ts.map +1 -0
  101. package/dist/adapters/sqlite/tools/admin/wal.d.ts +10 -0
  102. package/dist/adapters/sqlite/tools/admin/wal.d.ts.map +1 -0
  103. package/dist/adapters/sqlite/tools/codemode.d.ts +22 -0
  104. package/dist/adapters/sqlite/tools/codemode.d.ts.map +1 -0
  105. package/dist/adapters/sqlite/tools/column-validation.d.ts +26 -0
  106. package/dist/adapters/sqlite/tools/column-validation.d.ts.map +1 -0
  107. package/dist/adapters/sqlite/tools/core/alter-table.d.ts +11 -0
  108. package/dist/adapters/sqlite/tools/core/alter-table.d.ts.map +1 -0
  109. package/dist/adapters/sqlite/tools/core/constraints.d.ts +10 -0
  110. package/dist/adapters/sqlite/tools/core/constraints.d.ts.map +1 -0
  111. package/dist/adapters/sqlite/tools/core/convenience-helpers.d.ts +20 -0
  112. package/dist/adapters/sqlite/tools/core/convenience-helpers.d.ts.map +1 -0
  113. package/dist/adapters/sqlite/tools/core/convenience-schemas.d.ts +20 -0
  114. package/dist/adapters/sqlite/tools/core/convenience-schemas.d.ts.map +1 -0
  115. package/dist/adapters/sqlite/tools/core/convenience.d.ts +29 -0
  116. package/dist/adapters/sqlite/tools/core/convenience.d.ts.map +1 -0
  117. package/dist/adapters/sqlite/tools/core/datetime.d.ts +11 -0
  118. package/dist/adapters/sqlite/tools/core/datetime.d.ts.map +1 -0
  119. package/dist/adapters/sqlite/tools/core/index.d.ts +14 -0
  120. package/dist/adapters/sqlite/tools/core/index.d.ts.map +1 -0
  121. package/dist/adapters/sqlite/tools/core/indexes.d.ts +20 -0
  122. package/dist/adapters/sqlite/tools/core/indexes.d.ts.map +1 -0
  123. package/dist/adapters/sqlite/tools/core/queries.d.ts +16 -0
  124. package/dist/adapters/sqlite/tools/core/queries.d.ts.map +1 -0
  125. package/dist/adapters/sqlite/tools/core/tables.d.ts +37 -0
  126. package/dist/adapters/sqlite/tools/core/tables.d.ts.map +1 -0
  127. package/dist/adapters/sqlite/tools/core/triggers.d.ts +18 -0
  128. package/dist/adapters/sqlite/tools/core/triggers.d.ts.map +1 -0
  129. package/dist/adapters/sqlite/tools/fts.d.ts +13 -0
  130. package/dist/adapters/sqlite/tools/fts.d.ts.map +1 -0
  131. package/dist/adapters/sqlite/tools/geo.d.ts +14 -0
  132. package/dist/adapters/sqlite/tools/geo.d.ts.map +1 -0
  133. package/dist/adapters/sqlite/tools/index.d.ts +33 -0
  134. package/dist/adapters/sqlite/tools/index.d.ts.map +1 -0
  135. package/dist/adapters/sqlite/tools/introspection/analysis/constraints.d.ts +10 -0
  136. package/dist/adapters/sqlite/tools/introspection/analysis/constraints.d.ts.map +1 -0
  137. package/dist/adapters/sqlite/tools/introspection/analysis/diff.d.ts +11 -0
  138. package/dist/adapters/sqlite/tools/introspection/analysis/diff.d.ts.map +1 -0
  139. package/dist/adapters/sqlite/tools/introspection/analysis/index.d.ts +10 -0
  140. package/dist/adapters/sqlite/tools/introspection/analysis/index.d.ts.map +1 -0
  141. package/dist/adapters/sqlite/tools/introspection/analysis/risks.d.ts +9 -0
  142. package/dist/adapters/sqlite/tools/introspection/analysis/risks.d.ts.map +1 -0
  143. package/dist/adapters/sqlite/tools/introspection/analysis/snapshot.d.ts +40 -0
  144. package/dist/adapters/sqlite/tools/introspection/analysis/snapshot.d.ts.map +1 -0
  145. package/dist/adapters/sqlite/tools/introspection/diagnostics/index.d.ts +9 -0
  146. package/dist/adapters/sqlite/tools/introspection/diagnostics/index.d.ts.map +1 -0
  147. package/dist/adapters/sqlite/tools/introspection/diagnostics/indexes.d.ts +10 -0
  148. package/dist/adapters/sqlite/tools/introspection/diagnostics/indexes.d.ts.map +1 -0
  149. package/dist/adapters/sqlite/tools/introspection/diagnostics/query-plan.d.ts +10 -0
  150. package/dist/adapters/sqlite/tools/introspection/diagnostics/query-plan.d.ts.map +1 -0
  151. package/dist/adapters/sqlite/tools/introspection/diagnostics/storage.d.ts +10 -0
  152. package/dist/adapters/sqlite/tools/introspection/diagnostics/storage.d.ts.map +1 -0
  153. package/dist/adapters/sqlite/tools/introspection/graph/helpers.d.ts +44 -0
  154. package/dist/adapters/sqlite/tools/introspection/graph/helpers.d.ts.map +1 -0
  155. package/dist/adapters/sqlite/tools/introspection/graph/index.d.ts +9 -0
  156. package/dist/adapters/sqlite/tools/introspection/graph/index.d.ts.map +1 -0
  157. package/dist/adapters/sqlite/tools/introspection/graph/tools.d.ts +12 -0
  158. package/dist/adapters/sqlite/tools/introspection/graph/tools.d.ts.map +1 -0
  159. package/dist/adapters/sqlite/tools/introspection/index.d.ts +17 -0
  160. package/dist/adapters/sqlite/tools/introspection/index.d.ts.map +1 -0
  161. package/dist/adapters/sqlite/tools/json-helpers/helpers.d.ts +21 -0
  162. package/dist/adapters/sqlite/tools/json-helpers/helpers.d.ts.map +1 -0
  163. package/dist/adapters/sqlite/tools/json-helpers/index.d.ts +17 -0
  164. package/dist/adapters/sqlite/tools/json-helpers/index.d.ts.map +1 -0
  165. package/dist/adapters/sqlite/tools/json-helpers/read.d.ts +24 -0
  166. package/dist/adapters/sqlite/tools/json-helpers/read.d.ts.map +1 -0
  167. package/dist/adapters/sqlite/tools/json-helpers/write.d.ts +24 -0
  168. package/dist/adapters/sqlite/tools/json-helpers/write.d.ts.map +1 -0
  169. package/dist/adapters/sqlite/tools/json-operations/crud.d.ts +39 -0
  170. package/dist/adapters/sqlite/tools/json-operations/crud.d.ts.map +1 -0
  171. package/dist/adapters/sqlite/tools/json-operations/diff.d.ts +11 -0
  172. package/dist/adapters/sqlite/tools/json-operations/diff.d.ts.map +1 -0
  173. package/dist/adapters/sqlite/tools/json-operations/helpers.d.ts +18 -0
  174. package/dist/adapters/sqlite/tools/json-operations/helpers.d.ts.map +1 -0
  175. package/dist/adapters/sqlite/tools/json-operations/index.d.ts +10 -0
  176. package/dist/adapters/sqlite/tools/json-operations/index.d.ts.map +1 -0
  177. package/dist/adapters/sqlite/tools/json-operations/query.d.ts +24 -0
  178. package/dist/adapters/sqlite/tools/json-operations/query.d.ts.map +1 -0
  179. package/dist/adapters/sqlite/tools/json-operations/security.d.ts +19 -0
  180. package/dist/adapters/sqlite/tools/json-operations/security.d.ts.map +1 -0
  181. package/dist/adapters/sqlite/tools/json-operations/transform.d.ts +24 -0
  182. package/dist/adapters/sqlite/tools/json-operations/transform.d.ts.map +1 -0
  183. package/dist/adapters/sqlite/tools/migration/helpers.d.ts +34 -0
  184. package/dist/adapters/sqlite/tools/migration/helpers.d.ts.map +1 -0
  185. package/dist/adapters/sqlite/tools/migration/index.d.ts +15 -0
  186. package/dist/adapters/sqlite/tools/migration/index.d.ts.map +1 -0
  187. package/dist/adapters/sqlite/tools/migration/tracking/apply.d.ts +4 -0
  188. package/dist/adapters/sqlite/tools/migration/tracking/apply.d.ts.map +1 -0
  189. package/dist/adapters/sqlite/tools/migration/tracking/history.d.ts +4 -0
  190. package/dist/adapters/sqlite/tools/migration/tracking/history.d.ts.map +1 -0
  191. package/dist/adapters/sqlite/tools/migration/tracking/index.d.ts +7 -0
  192. package/dist/adapters/sqlite/tools/migration/tracking/index.d.ts.map +1 -0
  193. package/dist/adapters/sqlite/tools/migration/tracking/init.d.ts +4 -0
  194. package/dist/adapters/sqlite/tools/migration/tracking/init.d.ts.map +1 -0
  195. package/dist/adapters/sqlite/tools/migration/tracking/record.d.ts +4 -0
  196. package/dist/adapters/sqlite/tools/migration/tracking/record.d.ts.map +1 -0
  197. package/dist/adapters/sqlite/tools/migration/tracking/rollback.d.ts +4 -0
  198. package/dist/adapters/sqlite/tools/migration/tracking/rollback.d.ts.map +1 -0
  199. package/dist/adapters/sqlite/tools/migration/tracking/status.d.ts +4 -0
  200. package/dist/adapters/sqlite/tools/migration/tracking/status.d.ts.map +1 -0
  201. package/dist/adapters/sqlite/tools/stats/advanced.d.ts +28 -0
  202. package/dist/adapters/sqlite/tools/stats/advanced.d.ts.map +1 -0
  203. package/dist/adapters/sqlite/tools/stats/anomaly-detection.d.ts +22 -0
  204. package/dist/adapters/sqlite/tools/stats/anomaly-detection.d.ts.map +1 -0
  205. package/dist/adapters/sqlite/tools/stats/basic.d.ts +32 -0
  206. package/dist/adapters/sqlite/tools/stats/basic.d.ts.map +1 -0
  207. package/dist/adapters/sqlite/tools/stats/helpers.d.ts +27 -0
  208. package/dist/adapters/sqlite/tools/stats/helpers.d.ts.map +1 -0
  209. package/dist/adapters/sqlite/tools/stats/index.d.ts +12 -0
  210. package/dist/adapters/sqlite/tools/stats/index.d.ts.map +1 -0
  211. package/dist/adapters/sqlite/tools/stats/inference/hypothesis.d.ts +7 -0
  212. package/dist/adapters/sqlite/tools/stats/inference/hypothesis.d.ts.map +1 -0
  213. package/dist/adapters/sqlite/tools/stats/inference/index.d.ts +4 -0
  214. package/dist/adapters/sqlite/tools/stats/inference/index.d.ts.map +1 -0
  215. package/dist/adapters/sqlite/tools/stats/inference/outlier.d.ts +7 -0
  216. package/dist/adapters/sqlite/tools/stats/inference/outlier.d.ts.map +1 -0
  217. package/dist/adapters/sqlite/tools/stats/inference/regression.d.ts +7 -0
  218. package/dist/adapters/sqlite/tools/stats/inference/regression.d.ts.map +1 -0
  219. package/dist/adapters/sqlite/tools/stats/math-helpers.d.ts +17 -0
  220. package/dist/adapters/sqlite/tools/stats/math-helpers.d.ts.map +1 -0
  221. package/dist/adapters/sqlite/tools/stats/schema-risks.d.ts +15 -0
  222. package/dist/adapters/sqlite/tools/stats/schema-risks.d.ts.map +1 -0
  223. package/dist/adapters/sqlite/tools/text/formatting.d.ts +48 -0
  224. package/dist/adapters/sqlite/tools/text/formatting.d.ts.map +1 -0
  225. package/dist/adapters/sqlite/tools/text/helpers.d.ts +22 -0
  226. package/dist/adapters/sqlite/tools/text/helpers.d.ts.map +1 -0
  227. package/dist/adapters/sqlite/tools/text/index.d.ts +10 -0
  228. package/dist/adapters/sqlite/tools/text/index.d.ts.map +1 -0
  229. package/dist/adapters/sqlite/tools/text/regex.d.ts +21 -0
  230. package/dist/adapters/sqlite/tools/text/regex.d.ts.map +1 -0
  231. package/dist/adapters/sqlite/tools/text/search.d.ts +17 -0
  232. package/dist/adapters/sqlite/tools/text/search.d.ts.map +1 -0
  233. package/dist/adapters/sqlite/tools/text/sentiment.d.ts +13 -0
  234. package/dist/adapters/sqlite/tools/text/sentiment.d.ts.map +1 -0
  235. package/dist/adapters/sqlite/tools/text/validate.d.ts +11 -0
  236. package/dist/adapters/sqlite/tools/text/validate.d.ts.map +1 -0
  237. package/dist/adapters/sqlite/tools/vector/helpers.d.ts +11 -0
  238. package/dist/adapters/sqlite/tools/vector/helpers.d.ts.map +1 -0
  239. package/dist/adapters/sqlite/tools/vector/index.d.ts +14 -0
  240. package/dist/adapters/sqlite/tools/vector/index.d.ts.map +1 -0
  241. package/dist/adapters/sqlite/tools/vector/metadata.d.ts +28 -0
  242. package/dist/adapters/sqlite/tools/vector/metadata.d.ts.map +1 -0
  243. package/dist/adapters/sqlite/tools/vector/search.d.ts +16 -0
  244. package/dist/adapters/sqlite/tools/vector/search.d.ts.map +1 -0
  245. package/dist/adapters/sqlite/tools/vector/storage.d.ts +24 -0
  246. package/dist/adapters/sqlite/tools/vector/storage.d.ts.map +1 -0
  247. package/dist/adapters/sqlite/tools/vector/tools.d.ts +9 -0
  248. package/dist/adapters/sqlite/tools/vector/tools.d.ts.map +1 -0
  249. package/dist/adapters/sqlite/tools/virtual/analysis.d.ts +24 -0
  250. package/dist/adapters/sqlite/tools/virtual/analysis.d.ts.map +1 -0
  251. package/dist/adapters/sqlite/tools/virtual/extensions.d.ts +13 -0
  252. package/dist/adapters/sqlite/tools/virtual/extensions.d.ts.map +1 -0
  253. package/dist/adapters/sqlite/tools/virtual/helpers.d.ts +18 -0
  254. package/dist/adapters/sqlite/tools/virtual/helpers.d.ts.map +1 -0
  255. package/dist/adapters/sqlite/tools/virtual/index.d.ts +10 -0
  256. package/dist/adapters/sqlite/tools/virtual/index.d.ts.map +1 -0
  257. package/dist/adapters/sqlite/tools/virtual/views.d.ts +21 -0
  258. package/dist/adapters/sqlite/tools/virtual/views.d.ts.map +1 -0
  259. package/dist/adapters/sqlite/tools/virtual/vtable/analyze-csv.d.ts +4 -0
  260. package/dist/adapters/sqlite/tools/virtual/vtable/analyze-csv.d.ts.map +1 -0
  261. package/dist/adapters/sqlite/tools/virtual/vtable/csv.d.ts +4 -0
  262. package/dist/adapters/sqlite/tools/virtual/vtable/csv.d.ts.map +1 -0
  263. package/dist/adapters/sqlite/tools/virtual/vtable/drop.d.ts +4 -0
  264. package/dist/adapters/sqlite/tools/virtual/vtable/drop.d.ts.map +1 -0
  265. package/dist/adapters/sqlite/tools/virtual/vtable/index.d.ts +6 -0
  266. package/dist/adapters/sqlite/tools/virtual/vtable/index.d.ts.map +1 -0
  267. package/dist/adapters/sqlite/tools/virtual/vtable/info.d.ts +4 -0
  268. package/dist/adapters/sqlite/tools/virtual/vtable/info.d.ts.map +1 -0
  269. package/dist/adapters/sqlite/tools/virtual/vtable/list.d.ts +4 -0
  270. package/dist/adapters/sqlite/tools/virtual/vtable/list.d.ts.map +1 -0
  271. package/dist/adapters/sqlite/types.d.ts +89 -0
  272. package/dist/adapters/sqlite/types.d.ts.map +1 -0
  273. package/dist/adapters/sqlite-helpers.d.ts +51 -0
  274. package/dist/adapters/sqlite-helpers.d.ts.map +1 -0
  275. package/dist/adapters/sqlite-native/extensions.d.ts +17 -0
  276. package/dist/adapters/sqlite-native/extensions.d.ts.map +1 -0
  277. package/dist/adapters/sqlite-native/index.d.ts +11 -0
  278. package/dist/adapters/sqlite-native/index.d.ts.map +1 -0
  279. package/dist/adapters/sqlite-native/native-query-executor.d.ts +24 -0
  280. package/dist/adapters/sqlite-native/native-query-executor.d.ts.map +1 -0
  281. package/dist/adapters/sqlite-native/native-sqlite-adapter.d.ts +160 -0
  282. package/dist/adapters/sqlite-native/native-sqlite-adapter.d.ts.map +1 -0
  283. package/dist/adapters/sqlite-native/registration/index.d.ts +12 -0
  284. package/dist/adapters/sqlite-native/registration/index.d.ts.map +1 -0
  285. package/dist/adapters/sqlite-native/tools/spatialite/analysis.d.ts +23 -0
  286. package/dist/adapters/sqlite-native/tools/spatialite/analysis.d.ts.map +1 -0
  287. package/dist/adapters/sqlite-native/tools/spatialite/index.d.ts +15 -0
  288. package/dist/adapters/sqlite-native/tools/spatialite/index.d.ts.map +1 -0
  289. package/dist/adapters/sqlite-native/tools/spatialite/loader.d.ts +22 -0
  290. package/dist/adapters/sqlite-native/tools/spatialite/loader.d.ts.map +1 -0
  291. package/dist/adapters/sqlite-native/tools/spatialite/schemas.d.ts +78 -0
  292. package/dist/adapters/sqlite-native/tools/spatialite/schemas.d.ts.map +1 -0
  293. package/dist/adapters/sqlite-native/tools/spatialite/tools.d.ts +30 -0
  294. package/dist/adapters/sqlite-native/tools/spatialite/tools.d.ts.map +1 -0
  295. package/dist/adapters/sqlite-native/tools/transactions.d.ts +12 -0
  296. package/dist/adapters/sqlite-native/tools/transactions.d.ts.map +1 -0
  297. package/dist/adapters/sqlite-native/tools/window.d.ts +7 -0
  298. package/dist/adapters/sqlite-native/tools/window.d.ts.map +1 -0
  299. package/dist/adapters/sqlite-native/transaction-methods.d.ts +36 -0
  300. package/dist/adapters/sqlite-native/transaction-methods.d.ts.map +1 -0
  301. package/dist/audit/backup-manager.d.ts +90 -0
  302. package/dist/audit/backup-manager.d.ts.map +1 -0
  303. package/dist/audit/index.d.ts +11 -0
  304. package/dist/audit/index.d.ts.map +1 -0
  305. package/dist/audit/interceptor.d.ts +54 -0
  306. package/dist/audit/interceptor.d.ts.map +1 -0
  307. package/dist/audit/logger.d.ts +62 -0
  308. package/dist/audit/logger.d.ts.map +1 -0
  309. package/dist/audit/types.d.ts +112 -0
  310. package/dist/audit/types.d.ts.map +1 -0
  311. package/dist/auth/auth-context.d.ts +28 -0
  312. package/dist/auth/auth-context.d.ts.map +1 -0
  313. package/dist/auth/authorization-server-discovery.d.ts +90 -0
  314. package/dist/auth/authorization-server-discovery.d.ts.map +1 -0
  315. package/dist/auth/errors.d.ts +74 -0
  316. package/dist/auth/errors.d.ts.map +1 -0
  317. package/dist/auth/middleware/core.d.ts +22 -0
  318. package/dist/auth/middleware/core.d.ts.map +1 -0
  319. package/dist/auth/middleware/express-auth.d.ts +13 -0
  320. package/dist/auth/middleware/express-auth.d.ts.map +1 -0
  321. package/dist/auth/middleware/express-scopes.d.ts +6 -0
  322. package/dist/auth/middleware/express-scopes.d.ts.map +1 -0
  323. package/dist/auth/middleware/extraction.d.ts +2 -0
  324. package/dist/auth/middleware/extraction.d.ts.map +1 -0
  325. package/dist/auth/middleware/index.d.ts +5 -0
  326. package/dist/auth/middleware/index.d.ts.map +1 -0
  327. package/dist/auth/oauth-resource-server.d.ts +74 -0
  328. package/dist/auth/oauth-resource-server.d.ts.map +1 -0
  329. package/dist/auth/scope-map.d.ts +24 -0
  330. package/dist/auth/scope-map.d.ts.map +1 -0
  331. package/dist/auth/scopes/constants.d.ts +40 -0
  332. package/dist/auth/scopes/constants.d.ts.map +1 -0
  333. package/dist/auth/scopes/display.d.ts +5 -0
  334. package/dist/auth/scopes/display.d.ts.map +1 -0
  335. package/dist/auth/scopes/enforcement.d.ts +27 -0
  336. package/dist/auth/scopes/enforcement.d.ts.map +1 -0
  337. package/dist/auth/scopes/index.d.ts +6 -0
  338. package/dist/auth/scopes/index.d.ts.map +1 -0
  339. package/dist/auth/scopes/mapping.d.ts +39 -0
  340. package/dist/auth/scopes/mapping.d.ts.map +1 -0
  341. package/dist/auth/scopes/validation.d.ts +27 -0
  342. package/dist/auth/scopes/validation.d.ts.map +1 -0
  343. package/dist/auth/token-validator.d.ts +63 -0
  344. package/dist/auth/token-validator.d.ts.map +1 -0
  345. package/dist/auth/transport-agnostic.d.ts +11 -0
  346. package/dist/auth/transport-agnostic.d.ts.map +1 -0
  347. package/dist/auth/types.d.ts +257 -0
  348. package/dist/auth/types.d.ts.map +1 -0
  349. package/dist/{chunk-WBER5YY4.js → chunk-37G4DLL6.js} +1010 -409
  350. package/dist/chunk-E5IESRTK.js +489 -0
  351. package/dist/{chunk-645ZEFLA.js → chunk-L552U3QS.js} +887 -309
  352. package/dist/{chunk-5Y42NPBP.js → chunk-NV34JSQM.js} +4656 -1829
  353. package/dist/{chunk-Z7C2TM4L.js → chunk-W5WQVNVX.js} +169 -57
  354. package/dist/cli.d.ts +7 -0
  355. package/dist/cli.d.ts.map +1 -0
  356. package/dist/cli.js +47 -26
  357. package/dist/codemode/api-constants.d.ts +40 -0
  358. package/dist/codemode/api-constants.d.ts.map +1 -0
  359. package/dist/codemode/api.d.ts +70 -0
  360. package/dist/codemode/api.d.ts.map +1 -0
  361. package/dist/codemode/auto-return.d.ts +25 -0
  362. package/dist/codemode/auto-return.d.ts.map +1 -0
  363. package/dist/codemode/index.d.ts +12 -0
  364. package/dist/codemode/index.d.ts.map +1 -0
  365. package/dist/codemode/sandbox-factory.d.ts +72 -0
  366. package/dist/codemode/sandbox-factory.d.ts.map +1 -0
  367. package/dist/codemode/sandbox.d.ts +54 -0
  368. package/dist/codemode/sandbox.d.ts.map +1 -0
  369. package/dist/codemode/security.d.ts +45 -0
  370. package/dist/codemode/security.d.ts.map +1 -0
  371. package/dist/codemode/types.d.ts +167 -0
  372. package/dist/codemode/types.d.ts.map +1 -0
  373. package/dist/constants/server-instructions.d.ts +22 -0
  374. package/dist/constants/server-instructions.d.ts.map +1 -0
  375. package/dist/filtering/tool-constants.d.ts +45 -0
  376. package/dist/filtering/tool-constants.d.ts.map +1 -0
  377. package/dist/filtering/tool-filter.d.ts +82 -0
  378. package/dist/filtering/tool-filter.d.ts.map +1 -0
  379. package/dist/{http-6KF4ULDI.js → http-HWTUVFIA.js} +498 -391
  380. package/dist/index.d.ts +9 -1065
  381. package/dist/index.d.ts.map +1 -0
  382. package/dist/index.js +4 -6
  383. package/dist/server/mcp-server.d.ts +66 -0
  384. package/dist/server/mcp-server.d.ts.map +1 -0
  385. package/dist/server/registration/audit-tools.d.ts +13 -0
  386. package/dist/server/registration/audit-tools.d.ts.map +1 -0
  387. package/dist/server/registration/built-in-tools.d.ts +8 -0
  388. package/dist/server/registration/built-in-tools.d.ts.map +1 -0
  389. package/dist/server/registration/help-resources.d.ts +7 -0
  390. package/dist/server/registration/help-resources.d.ts.map +1 -0
  391. package/dist/server/registration/index.d.ts +4 -0
  392. package/dist/server/registration/index.d.ts.map +1 -0
  393. package/dist/{sqlite-U5KSYQXK.js → sqlite-TB56Z7G3.js} +61 -17
  394. package/dist/{sqlite-native-JXMCFQBA.js → sqlite-native-IF75BB3O.js} +459 -254
  395. package/dist/transports/http/index.d.ts +8 -0
  396. package/dist/transports/http/index.d.ts.map +1 -0
  397. package/dist/transports/http/middleware.d.ts +25 -0
  398. package/dist/transports/http/middleware.d.ts.map +1 -0
  399. package/dist/transports/http/oauth.d.ts +24 -0
  400. package/dist/transports/http/oauth.d.ts.map +1 -0
  401. package/dist/transports/http/session.d.ts +2 -0
  402. package/dist/transports/http/session.d.ts.map +1 -0
  403. package/dist/transports/http/sessions/index.d.ts +4 -0
  404. package/dist/transports/http/sessions/index.d.ts.map +1 -0
  405. package/dist/transports/http/sessions/legacy-sse.d.ts +6 -0
  406. package/dist/transports/http/sessions/legacy-sse.d.ts.map +1 -0
  407. package/dist/transports/http/sessions/mutex.d.ts +6 -0
  408. package/dist/transports/http/sessions/mutex.d.ts.map +1 -0
  409. package/dist/transports/http/sessions/stateful.d.ts +12 -0
  410. package/dist/transports/http/sessions/stateful.d.ts.map +1 -0
  411. package/dist/transports/http/sessions/stateless.d.ts +6 -0
  412. package/dist/transports/http/sessions/stateless.d.ts.map +1 -0
  413. package/dist/transports/http/transport.d.ts +65 -0
  414. package/dist/transports/http/transport.d.ts.map +1 -0
  415. package/dist/transports/http/type-adapters.d.ts +20 -0
  416. package/dist/transports/http/type-adapters.d.ts.map +1 -0
  417. package/dist/transports/http/types.d.ts +120 -0
  418. package/dist/transports/http/types.d.ts.map +1 -0
  419. package/dist/types/adapter.d.ts +138 -0
  420. package/dist/types/adapter.d.ts.map +1 -0
  421. package/dist/types/auth.d.ts +79 -0
  422. package/dist/types/auth.d.ts.map +1 -0
  423. package/dist/types/database.d.ts +100 -0
  424. package/dist/types/database.d.ts.map +1 -0
  425. package/dist/types/filtering.d.ts +41 -0
  426. package/dist/types/filtering.d.ts.map +1 -0
  427. package/dist/types/index.d.ts +13 -0
  428. package/dist/types/index.d.ts.map +1 -0
  429. package/dist/types/server.d.ts +48 -0
  430. package/dist/types/server.d.ts.map +1 -0
  431. package/dist/utils/annotations.d.ts +62 -0
  432. package/dist/utils/annotations.d.ts.map +1 -0
  433. package/dist/utils/errors/base.d.ts +33 -0
  434. package/dist/utils/errors/base.d.ts.map +1 -0
  435. package/dist/utils/errors/categories.d.ts +41 -0
  436. package/dist/utils/errors/categories.d.ts.map +1 -0
  437. package/dist/utils/errors/classes.d.ts +124 -0
  438. package/dist/utils/errors/classes.d.ts.map +1 -0
  439. package/dist/utils/errors/error-response-fields.d.ts +24 -0
  440. package/dist/utils/errors/error-response-fields.d.ts.map +1 -0
  441. package/dist/utils/errors/format.d.ts +74 -0
  442. package/dist/utils/errors/format.d.ts.map +1 -0
  443. package/dist/utils/errors/index.d.ts +11 -0
  444. package/dist/utils/errors/index.d.ts.map +1 -0
  445. package/dist/utils/errors/suggestions.d.ts +16 -0
  446. package/dist/utils/errors/suggestions.d.ts.map +1 -0
  447. package/dist/utils/icons.d.ts +19 -0
  448. package/dist/utils/icons.d.ts.map +1 -0
  449. package/dist/utils/identifiers.d.ts +121 -0
  450. package/dist/utils/identifiers.d.ts.map +1 -0
  451. package/dist/utils/index.d.ts +9 -0
  452. package/dist/utils/index.d.ts.map +1 -0
  453. package/dist/utils/insights-manager.d.ts +39 -0
  454. package/dist/utils/insights-manager.d.ts.map +1 -0
  455. package/dist/utils/logger/error-codes.d.ts +48 -0
  456. package/dist/utils/logger/error-codes.d.ts.map +1 -0
  457. package/dist/utils/logger/index.d.ts +22 -0
  458. package/dist/utils/logger/index.d.ts.map +1 -0
  459. package/dist/utils/logger/logger.d.ts +94 -0
  460. package/dist/utils/logger/logger.d.ts.map +1 -0
  461. package/dist/utils/logger/module-logger.d.ts +28 -0
  462. package/dist/utils/logger/module-logger.d.ts.map +1 -0
  463. package/dist/utils/logger/types.d.ts +36 -0
  464. package/dist/utils/logger/types.d.ts.map +1 -0
  465. package/dist/utils/progress-utils.d.ts +54 -0
  466. package/dist/utils/progress-utils.d.ts.map +1 -0
  467. package/dist/utils/redaction.d.ts +4 -0
  468. package/dist/utils/redaction.d.ts.map +1 -0
  469. package/dist/utils/resource-annotations.d.ts +36 -0
  470. package/dist/utils/resource-annotations.d.ts.map +1 -0
  471. package/dist/utils/validate-json-path.d.ts +43 -0
  472. package/dist/utils/validate-json-path.d.ts.map +1 -0
  473. package/dist/utils/validate-path.d.ts +37 -0
  474. package/dist/utils/validate-path.d.ts.map +1 -0
  475. package/dist/utils/where-clause.d.ts +42 -0
  476. package/dist/utils/where-clause.d.ts.map +1 -0
  477. package/dist/version.d.ts +10 -0
  478. package/dist/version.d.ts.map +1 -0
  479. package/package.json +26 -13
  480. package/.gitattributes +0 -2
  481. package/.gitleaks.toml +0 -9
  482. package/.trivyignore +0 -8
  483. package/dist/chunk-OKOVZ5QE.js +0 -28
  484. package/dist/chunk-SFJQCNG7.js +0 -131
  485. package/dist/chunk-VIDSICEL.js +0 -85
  486. package/dist/chunk-X3MUUOWM.js +0 -152
  487. package/dist/worker-script.d.ts +0 -2
  488. package/dist/worker-script.js +0 -150
  489. package/logs/.gitkeep +0 -1
  490. package/mcp-config-example.json +0 -83
  491. package/playwright.config.ts +0 -101
  492. package/scripts/generate-server-instructions.ts +0 -111
  493. package/scripts/update-badges.ts +0 -99
  494. package/server.json +0 -54
  495. package/test-server/README.md +0 -115
  496. package/test-server/code-map.md +0 -421
  497. package/test-server/fixtures/sample.csv +0 -6
  498. package/test-server/reset-database.ps1 +0 -415
  499. package/test-server/sample.csv +0 -11
  500. package/test-server/scripts/README.md +0 -27
  501. package/test-server/scripts/test-help-resources.mjs +0 -245
  502. package/test-server/scripts/test-prompts.mjs +0 -251
  503. package/test-server/scripts/test-tool-annotations.mjs +0 -162
  504. package/test-server/test-advanced/README.md +0 -70
  505. package/test-server/test-advanced/test-codemode-advanced-admin.md +0 -174
  506. package/test-server/test-advanced/test-codemode-advanced-core.md +0 -193
  507. package/test-server/test-advanced/test-codemode-advanced-geo.md +0 -157
  508. package/test-server/test-advanced/test-codemode-advanced-introspection.md +0 -171
  509. package/test-server/test-advanced/test-codemode-advanced-json.md +0 -169
  510. package/test-server/test-advanced/test-codemode-advanced-migration.md +0 -160
  511. package/test-server/test-advanced/test-codemode-advanced-stats.md +0 -185
  512. package/test-server/test-advanced/test-codemode-advanced-text.md +0 -183
  513. package/test-server/test-advanced/test-codemode-advanced-transactions.md +0 -136
  514. package/test-server/test-advanced/test-codemode-advanced-vector.md +0 -141
  515. package/test-server/test-codemode/README.md +0 -121
  516. package/test-server/test-codemode/test-codemode-admin.md +0 -223
  517. package/test-server/test-codemode/test-codemode-core.md +0 -286
  518. package/test-server/test-codemode/test-codemode-geo.md +0 -177
  519. package/test-server/test-codemode/test-codemode-introspection.md +0 -190
  520. package/test-server/test-codemode/test-codemode-json.md +0 -237
  521. package/test-server/test-codemode/test-codemode-migration.md +0 -278
  522. package/test-server/test-codemode/test-codemode-sandbox.md +0 -413
  523. package/test-server/test-codemode/test-codemode-stats.md +0 -232
  524. package/test-server/test-codemode/test-codemode-text.md +0 -237
  525. package/test-server/test-codemode/test-codemode-transactions.md +0 -236
  526. package/test-server/test-codemode/test-codemode-vector.md +0 -244
  527. package/test-server/test-codemode/test-codemode-wasm-degradation.md +0 -394
  528. package/test-server/test-database.sql +0 -424
  529. package/test-server/test-preflight.md +0 -53
  530. package/test-server/test-prompts.md +0 -354
  531. package/test-server/test-resources.md +0 -272
  532. package/test-server/test-tool-groups/README.md +0 -100
  533. package/test-server/test-tool-groups/test-admin-core.md +0 -165
  534. package/test-server/test-tool-groups/test-admin-extensions.md +0 -133
  535. package/test-server/test-tool-groups/test-core-data.md +0 -262
  536. package/test-server/test-tool-groups/test-core-schema.md +0 -240
  537. package/test-server/test-tool-groups/test-geo-haversine.md +0 -130
  538. package/test-server/test-tool-groups/test-geo-spatialite.md +0 -110
  539. package/test-server/test-tool-groups/test-introspection-diagnostics.md +0 -123
  540. package/test-server/test-tool-groups/test-introspection-schema.md +0 -133
  541. package/test-server/test-tool-groups/test-json-read.md +0 -219
  542. package/test-server/test-tool-groups/test-json-write.md +0 -157
  543. package/test-server/test-tool-groups/test-migration.md +0 -193
  544. package/test-server/test-tool-groups/test-stats-advanced.md +0 -118
  545. package/test-server/test-tool-groups/test-stats-basic.md +0 -156
  546. package/test-server/test-tool-groups/test-text-advanced.md +0 -169
  547. package/test-server/test-tool-groups/test-text-basic.md +0 -177
  548. package/test-server/test-tool-groups/test-transactions.md +0 -179
  549. package/test-server/test-tool-groups/test-vector-read.md +0 -130
  550. package/test-server/test-tool-groups/test-vector-write.md +0 -115
  551. package/test-server/tool-reference.md +0 -257
  552. package/tsconfig.build.json +0 -6
  553. package/tsconfig.test.json +0 -9
@@ -1,118 +0,0 @@
1
- # db-mcp Tool Group Testing: [stats-advanced]
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), apply these adjustments:
11
- >
12
- > - **Skip window function tools** (items 1-6: `sqlite_window_row_number`, `sqlite_window_rank`, `sqlite_window_lag_lead`, `sqlite_window_running_total`, `sqlite_window_moving_avg`, `sqlite_window_ntile`) — `[NATIVE ONLY]`. These tools are not registered in WASM.
13
- > - **Skip checklist items** 1-6.
14
- > - **Skip Zod items** 7-12.
15
-
16
- **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.
17
-
18
- **Step 2:** Please conduct an exhaustive test of the **stats-advanced** tool group specified in the group-specific checklist below using live MCP server tool calls directly — not scripts/terminal.
19
-
20
- **Step 3:** The agent should update C:\Users\chris\Desktop\db-mcp\UNRELEASED.md with any/all changes/fixes.
21
-
22
- **Note** If temp tables are present from a previous test pass, it's because the database is locked. Ignore them.
23
-
24
- ## Reporting Format
25
-
26
- - ❌ Fail: Tool errors or produces incorrect results (include error message)
27
- - ⚠️ Issue: Unexpected behavior or improvement opportunity
28
- - 📦 Payload: Unnecessarily large response that should be optimized.
29
-
30
- ## Test Database Schema
31
-
32
- | Table | Rows | Columns | JSON Columns |
33
- | ----------------- | ---- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
34
- | test_products | 16 | id, name, description, price, category, created_at | — |
35
- | test_orders | 20 | id, product_id (FK), customer_name, quantity, total_price, order_date, status | — |
36
- | test_jsonb_docs | 6 | id, doc, metadata, tags, created_at | **doc**, **metadata** (nested), **tags** (array) |
37
- | test_articles | 8 | id, title, body, author, category, published_at | — |
38
- | test_users | 9 | id, username, email, phone, bio, created_at | — |
39
- | test_measurements | 200 | id, sensor_id, temperature, humidity, pressure, measured_at | — |
40
- | test_embeddings | 20 | id, content, category, embedding | **embedding** (8-dim float array); category values: database, fitness, food, tech, travel |
41
- | test_locations | 15 | id, name, city, latitude, longitude, type | — |
42
- | test_categories | 17 | id, name, path, level | — |
43
- | test_events | 100 | id, event_type, user_id (INT, 8 values), payload, event_date | **payload** (JSON) |
44
-
45
- ## Testing Requirements
46
-
47
- > [!CAUTION]
48
- > **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**.
49
-
50
- 1. Use existing `test_*` tables for read operations
51
- 2. Report all failures, unexpected behaviors, improvement opportunities, or unnecessarily large payloads
52
- 3. **Error path testing**: For **every** tool, test at least **two** invalid inputs: (a) domain error and (b) Zod validation error (`{}`). Both must return `{success: false, error: "..."}` — NOT a raw MCP error frame.
53
- 4. **Output schema testing**: For **every** tool with an `outputSchema`, confirm valid happy-path calls return structured JSON — NOT a raw MCP `-32602` error.
54
-
55
- ## Structured Error Response Pattern
56
-
57
- ```json
58
- { "success": false, "error": "Human-readable error message" }
59
- ```
60
-
61
- | Type | Source | What you see | Verdict |
62
- | -------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------- | ------------------ |
63
- | **Handler error** ✅ | Handler catches error and returns `{success: false, error: "..."}` | Parseable JSON object with `success` and `error` fields | Correct |
64
- | **MCP error** ❌ | Uncaught throw propagates to MCP framework | Raw text error string, `isError: true` — no `success` field | Bug — report as ❌ |
65
-
66
- ### Zod Validation Errors
67
-
68
- **Zod refinement leak pattern:** `.partial()` does NOT strip `.min(N)` / `.max(N)` refinements. **Fix:** Remove refinements from schema, validate inside handler.
69
-
70
- ### Output Schema Validation Errors
71
-
72
- If valid inputs return raw MCP `-32602` mentioning "output schema", report as ❌.
73
-
74
- ---
75
-
76
- ## Group Focus: stats-advanced
77
-
78
- > **Instructions**: Execute every numbered checklist item with the exact inputs shown. Compare responses against the expected results. Report any deviation.
79
-
80
- ### stats-advanced Group Tools (6)
81
-
82
- 1. sqlite_window_row_number `[NATIVE ONLY]`
83
- 2. sqlite_window_rank `[NATIVE ONLY]`
84
- 3. sqlite_window_lag_lead `[NATIVE ONLY]`
85
- 4. sqlite_window_running_total `[NATIVE ONLY]`
86
- 5. sqlite_window_moving_avg `[NATIVE ONLY]`
87
- 6. sqlite_window_ntile `[NATIVE ONLY]`
88
-
89
- **Checklist:**
90
-
91
- **Window functions `[NATIVE ONLY]`:**
92
-
93
- 1. `sqlite_window_row_number({table: "test_products", orderBy: "price DESC"})` → products ranked by price
94
- 2. `sqlite_window_rank({table: "test_products", orderBy: "price DESC"})` → rank with ties
95
- 3. `sqlite_window_running_total({table: "test_orders", column: "total_price", orderBy: "order_date"})` → cumulative totals
96
- 4. `sqlite_window_moving_avg({table: "test_measurements", column: "temperature", windowSize: 5, orderBy: "measured_at"})` → moving averages
97
- 5. `sqlite_window_lag_lead({table: "test_orders", column: "total_price", direction: "lag", orderBy: "order_date"})` → lag/lead values
98
- 6. `sqlite_window_ntile({table: "test_products", buckets: 4, orderBy: "price"})` → quartile assignments
99
-
100
- **Zod validation sweep** — call each tool with `{}` (empty params). Must return handler error, NOT raw MCP error:
101
-
102
- 🔴 7. `sqlite_window_row_number({})` `[NATIVE ONLY]` → handler error
103
- 🔴 8. `sqlite_window_rank({})` `[NATIVE ONLY]` → handler error
104
- 🔴 9. `sqlite_window_lag_lead({})` `[NATIVE ONLY]` → handler error
105
- 🔴 10. `sqlite_window_running_total({})` `[NATIVE ONLY]` → handler error
106
- 🔴 11. `sqlite_window_moving_avg({})` `[NATIVE ONLY]` → handler error
107
- 🔴 12. `sqlite_window_ntile({})` `[NATIVE ONLY]` → handler error
108
-
109
- ---
110
-
111
- ## Post-Test Procedures
112
-
113
- 1. **Triage findings**: Create implementation plan if issues found
114
- 2. **Scope of fixes**: Handler code, server-instructions, test database, this prompt
115
- 3. **Validate**: Instruct the user to run the test suite (Vitest/Playwright), lint, and typecheck. Do NOT run them yourself.
116
- 4. **Commit**: Stage and commit — do NOT push
117
- 5. **Live re-test**: After server rebuild
118
- 6. **Final summary**: After testing/re-testing
@@ -1,156 +0,0 @@
1
- # db-mcp Tool Group Testing: [stats-basic]
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 16 tools in this basic stats suite 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 **stats-basic** 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**. Report the response size in KB and suggest a concrete optimization.
25
-
26
- ## Test Database Schema
27
-
28
- | Table | Rows | Columns | JSON Columns |
29
- | ----------------- | ---- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
30
- | test_products | 16 | id, name, description, price, category, created_at | — |
31
- | test_orders | 20 | id, product_id (FK), customer_name, quantity, total_price, order_date, status | — |
32
- | test_jsonb_docs | 6 | id, doc, metadata, tags, created_at | **doc**, **metadata** (nested), **tags** (array) |
33
- | test_articles | 8 | id, title, body, author, category, published_at | — |
34
- | test_users | 9 | id, username, email, phone, bio, created_at | — |
35
- | test_measurements | 200 | id, sensor_id, temperature, humidity, pressure, measured_at | — |
36
- | test_embeddings | 20 | id, content, category, embedding | **embedding** (8-dim float array); category values: database, fitness, food, tech, travel |
37
- | test_locations | 15 | id, name, city, latitude, longitude, type | — |
38
- | test_categories | 17 | id, name, path, level | — |
39
- | test_events | 100 | id, event_type, user_id (INT, 8 values), payload, event_date | **payload** (JSON) |
40
-
41
- ## Testing Requirements
42
-
43
- > [!CAUTION]
44
- > **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**.
45
-
46
- 1. Use existing `test_*` tables for read operations
47
- 2. Create temporary tables with `temp_*` prefix for write operations
48
- 3. Report all failures, unexpected behaviors, improvement opportunities, or unnecessarily large payloads
49
- 4. Do not mention what already works well or issues well documented in help resources
50
- 5. **Error path testing**: For **every** tool, test at least **two** invalid inputs: (a) domain error and (b) Zod validation error (`{}`). Both must return `{success: false, error: "..."}` — NOT a raw MCP error frame.
51
- 6. **Output schema testing**: For **every** tool with an `outputSchema`, confirm valid happy-path calls return structured JSON — NOT a raw MCP `-32602` error.
52
- 7. **Deterministic checklist first**: Complete ALL items before freeform exploration.
53
- 8. **Code Over Docs**: Fix the handler code if standards (Structured Errors/Zod) are violated. Do NOT change docs/prompts to accommodate broken code.
54
-
55
- ## Structured Error Response Pattern
56
-
57
- ```json
58
- { "success": false, "error": "Human-readable error message" }
59
- ```
60
-
61
- | Type | Source | What you see | Verdict |
62
- | -------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------- | ------------------ |
63
- | **Handler error** ✅ | Handler catches error and returns `{success: false, error: "..."}` | Parseable JSON object with `success` and `error` fields | Correct |
64
- | **MCP error** ❌ | Uncaught throw propagates to MCP framework | Raw text error string, `isError: true` — no `success` field | Bug — report as ❌ |
65
-
66
- ### Zod Validation Errors
67
-
68
- **Zod refinement leak pattern:** `.partial()` does NOT strip `.min(N)` / `.max(N)` refinements. **Fix:** Remove refinements from schema, validate inside handler.
69
-
70
- ### Output Schema Validation Errors
71
-
72
- If valid inputs return raw MCP `-32602` mentioning "output schema", report as ❌.
73
-
74
- ---
75
-
76
- ## Group Focus: stats-basic
77
-
78
- > **Instructions**: Execute every numbered checklist item with the exact inputs shown. Compare responses against the expected results. Report any deviation.
79
-
80
- ### stats-basic Group Tools (16)
81
-
82
- 1. sqlite_stats_basic
83
- 2. sqlite_stats_count
84
- 3. sqlite_stats_group_by
85
- 4. sqlite_stats_histogram
86
- 5. sqlite_stats_percentile
87
- 6. sqlite_stats_correlation
88
- 7. sqlite_stats_top_n
89
- 8. sqlite_stats_distinct
90
- 9. sqlite_stats_summary
91
- 10. sqlite_stats_frequency
92
- 11. sqlite_stats_outliers
93
- 12. sqlite_stats_regression
94
- 13. sqlite_stats_hypothesis
95
- 14. sqlite_stats_detect_anomalies
96
- 15. sqlite_stats_detect_bloat
97
- 16. sqlite_stats_detect_schema_risks
98
- 17. sqlite_execute_code
99
-
100
- **Checklist:**
101
-
102
- 1. `sqlite_stats_basic({table: "test_measurements", column: "temperature"})` → verify `count: 200`, `min`, `max`, `avg` present
103
- 2. `sqlite_stats_count({table: "test_products"})` → `{count: 16}`
104
- 3. `sqlite_stats_count({table: "test_products", column: "category", distinct: true})` → distinct category count (electronics, accessories, office = 3)
105
- 4. `sqlite_stats_group_by({table: "test_measurements", groupByColumn: "sensor_id", valueColumn: "temperature", stat: "avg"})` → 5 groups (sensor_id 1-5) with average temperatures
106
- 5. `sqlite_stats_histogram({table: "test_measurements", column: "temperature", buckets: 5})` → 5 buckets
107
- 6. `sqlite_stats_percentile({table: "test_measurements", column: "temperature", percentiles: [25, 50, 75, 90]})` → 4 percentile values
108
- 7. `sqlite_stats_correlation({table: "test_measurements", column1: "temperature", column2: "humidity"})` → correlation value between -1 and 1
109
- 8. `sqlite_stats_top_n({table: "test_products", column: "price", n: 3, orderDirection: "desc"})` → top 3 most expensive products
110
- 9. `sqlite_stats_distinct({table: "test_locations", column: "city"})` → distinct city count (6)
111
- 10. `sqlite_stats_summary({table: "test_measurements", columns: ["temperature", "humidity", "pressure"]})` → summaries array with 3 entries
112
- 11. `sqlite_stats_frequency({table: "test_events", column: "event_type"})` → distribution
113
- 12. `sqlite_stats_outliers({table: "test_measurements", column: "temperature"})` → outlier detection result
114
- 13. `sqlite_stats_regression({table: "test_measurements", xColumn: "temperature", yColumn: "humidity", degree: 1})` → regression coefficients
115
- 14. `sqlite_stats_hypothesis({table: "test_measurements", column: "temperature", testType: "ttest_one", expectedMean: 25})` → verify `statistic` and `pValue` present
116
-
117
- **Code mode testing:**
118
-
119
- 15. `sqlite_execute_code({code: "const result = await sqlite.stats.statsBasic({table: 'test_measurements', column: 'temperature'}); return result;"})` → verify `count: 200`, `min`, `max`, `avg` present
120
- 16. `sqlite_execute_code({code: "const result = await sqlite.stats.statsPercentile({table: 'test_measurements', column: 'temperature', percentiles: [50]}); return result;"})` → median value
121
-
122
- **Error path testing:**
123
-
124
- 🔴 17. `sqlite_stats_basic({table: "nonexistent_table_xyz", column: "x"})` → structured error
125
- 🔴 18. `sqlite_stats_correlation({table: "test_products", column1: "name", column2: "description"})` → error about non-numeric columns
126
-
127
- **Zod validation sweep** — call each tool with `{}` (empty params). Must return handler error, NOT raw MCP error:
128
-
129
- 🔴 19. `sqlite_stats_basic({})` → handler error
130
- 🔴 20. `sqlite_stats_count({})` → handler error
131
- 🔴 21. `sqlite_stats_group_by({})` → handler error
132
- 🔴 22. `sqlite_stats_histogram({})` → handler error
133
- 🔴 23. `sqlite_stats_percentile({})` → handler error
134
- 🔴 24. `sqlite_stats_correlation({})` → handler error
135
- 🔴 25. `sqlite_stats_top_n({})` → handler error
136
- 🔴 26. `sqlite_stats_distinct({})` → handler error
137
- 🔴 27. `sqlite_stats_summary({})` → handler error
138
- 🔴 28. `sqlite_stats_frequency({})` → handler error
139
- 🔴 29. `sqlite_stats_outliers({})` → handler error
140
- 🔴 30. `sqlite_stats_regression({})` → handler error
141
- 🔴 31. `sqlite_stats_hypothesis({})` → handler error
142
- 🔴 32. `sqlite_stats_detect_anomalies({})` → handler error
143
- ✅ 33. `sqlite_stats_detect_bloat({})` → success (no required params)
144
- ✅ 34. `sqlite_stats_detect_schema_risks({})` → success (no required params)
145
- 🔴 35. `sqlite_execute_code({})` → handler error
146
-
147
- ---
148
-
149
- ## Post-Test Procedures
150
-
151
- 1. **Triage findings**: Create implementation plan if issues found
152
- 2. **Scope of fixes**: Handler code, server-instructions, test database, this prompt
153
- 3. **Validate**: Instruct the user to run the test suite (Vitest/Playwright), lint, and typecheck. Do NOT run them yourself.
154
- 4. **Commit**: Stage and commit — do NOT push
155
- 5. **Live re-test**: After server rebuild
156
- 6. **Final summary**: After testing/re-testing
@@ -1,169 +0,0 @@
1
- # db-mcp Tool Group Testing: [text-advanced]
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), apply these adjustments:
11
- >
12
- > - **Skip FTS5 tools** (items 5-9: `sqlite_fts_create`, `sqlite_fts_search`, `sqlite_fts_rebuild`, `sqlite_fts_match_info`, `sqlite_fts_headline`) — `[NATIVE ONLY]`. These tools are not registered in WASM and direct calls will fail with "unknown tool".
13
- > - **Skip FTS5 checklist items** 6-11 — all require FTS5 tools.
14
- > - **Skip error items** for FTS5 (item 14).
15
- > - **Skip Zod items** for FTS5 (items 20-24).
16
-
17
- **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.
18
-
19
- **Step 2:** Please conduct an exhaustive test of the **text-advanced** tool group specified in the group-specific checklist below using live MCP server tool calls directly — not scripts/terminal.
20
-
21
- **Step 3:** The agent should update C:\Users\chris\Desktop\db-mcp\UNRELEASED.md with any/all changes/fixes.
22
-
23
- **Note** If temp tables are present from a previous test pass, it's because the database is locked. Ignore them.
24
-
25
- ## Reporting Format
26
-
27
- - ❌ Fail: Tool errors or produces incorrect results (include error message)
28
- - ⚠️ Issue: Unexpected behavior or improvement opportunity
29
- - 📦 Payload: Unnecessarily large response that should be optimized.
30
-
31
- ## Test Database Schema
32
-
33
- The test database (test-server/test.db) contains these tables with JSON-relevant columns:
34
-
35
- | Table | Rows | Columns | JSON Columns |
36
- | ----------------- | ---- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
37
- | test_products | 16 | id, name, description, price, category, created_at | — |
38
- | test_orders | 20 | id, product_id (FK), customer_name, quantity, total_price, order_date, status | — |
39
- | test_jsonb_docs | 6 | id, doc, metadata, tags, created_at | **doc**, **metadata** (nested), **tags** (array) |
40
- | test_articles | 8 | id, title, body, author, category, published_at | — |
41
- | test_users | 9 | id, username, email, phone, bio, created_at | — |
42
- | test_measurements | 200 | id, sensor_id, temperature, humidity, pressure, measured_at | — |
43
- | test_embeddings | 20 | id, content, category, embedding | **embedding** (8-dim float array); category values: database, fitness, food, tech, travel |
44
- | test_locations | 15 | id, name, city, latitude, longitude, type | — |
45
- | test_categories | 17 | id, name, path, level | — |
46
- | test_events | 100 | id, event_type, user_id (INT, 8 values), payload, event_date | **payload** (JSON) |
47
-
48
- ## Testing Requirements
49
-
50
- > [!CAUTION]
51
- > **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.
52
-
53
- 1. Use existing `test_*` tables for read operations.
54
- 2. Create temporary tables with `temp_*` prefix for write operations.
55
- 3. Test each tool with realistic inputs based on the schema above.
56
- 4. Report all failures, unexpected behaviors, improvement opportunities, or unnecessarily large payloads.
57
- 5. **Error path testing**: For **every** tool, test at least **two** invalid inputs: (a) a domain error and (b) a **Zod validation error** (call the tool with `{}` empty params). Both must return a **structured handler error** (`{success: false, error: "..."}`) — NOT a raw MCP error frame.
58
- 6. **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 produce the same `-32602` code as input errors but are only caught with valid inputs.
59
- 7. **Code Over Docs**: Fix the handler code if standards (Structured Errors/Zod) are violated. Do NOT change docs/prompts to accommodate broken code.
60
-
61
- ## Structured Error Response Pattern
62
-
63
- All tools should return errors as structured objects instead of throwing. The expected pattern:
64
-
65
- ```json
66
- { "success": false, "error": "Human-readable error message" }
67
- ```
68
-
69
- ### Handler Error vs MCP Error — How to Distinguish
70
-
71
- | Type | Source | What you see | Verdict |
72
- | -------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | ------------------ |
73
- | **Handler error** ✅ | Handler catches error and returns `{success: false, error: "..."}` | Parseable JSON object with `success` and `error` fields | Correct |
74
- | **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 ❌ |
75
-
76
- ### Zod Validation Errors
77
-
78
- 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.
79
-
80
- **Fix:** Remove ALL `.min(N)` / `.max(N)` refinements from the schema and validate inside the handler instead.
81
-
82
- ### Output Schema Validation Errors
83
-
84
- 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.
85
-
86
- **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", report as ❌ with both the tool name and the missing field(s).
87
-
88
- ### Error Consistency Audit
89
-
90
- 1. **Throw-vs-return**: If a tool throws a raw error instead of returning `{success: false}`, report as ❌.
91
- 2. **Error field name**: All `{success: false}` responses should use `error` as the field name.
92
- 3. **Zod validation leaks**: If calling a tool with missing required field produces a raw MCP `-32602` error instead of a structured response, report as ❌.
93
- 4. **Output schema leaks**: If calling a tool with valid inputs produces a raw MCP `-32602` mentioning "output schema", report as ❌.
94
-
95
- ---
96
-
97
- ## Group Focus: text-advanced
98
-
99
- > **Instructions**: Execute every numbered checklist item with the exact inputs shown. Compare responses against the expected results. Report any deviation.
100
-
101
- > **FTS Testing Notes:** After `sqlite_fts_create`, always call `sqlite_fts_rebuild` before searching. `test_articles` searchable terms: `SQLite`, `database`, `JSON`, `FTS`, `vector`, `API`, `search`, `MCP`.
102
-
103
- ### text-advanced Group Tools (9)
104
-
105
- 1. sqlite_fuzzy_match
106
- 2. sqlite_phonetic_match
107
- 3. sqlite_advanced_search
108
- 4. sqlite_text_sentiment
109
- 5. sqlite_fts_create `[NATIVE ONLY]`
110
- 6. sqlite_fts_search `[NATIVE ONLY]`
111
- 7. sqlite_fts_rebuild `[NATIVE ONLY]`
112
- 8. sqlite_fts_match_info `[NATIVE ONLY]`
113
- 9. sqlite_fts_headline `[NATIVE ONLY]`
114
-
115
- **Checklist:**
116
-
117
- 1. `sqlite_fuzzy_match({table: "test_products", column: "name", search: "Laptp", maxDistance: 3})` → results include `Laptop Pro 15`
118
- 2. `sqlite_fuzzy_match({table: "test_products", column: "name", search: "Laptp", tokenize: false})` → verify behavior without tokenization
119
- 3. `sqlite_phonetic_match({table: "test_products", column: "name", search: "Labtop"})` → should find `Laptop Pro 15` via Soundex (both produce L131)
120
- 4. `sqlite_phonetic_match({table: "test_products", column: "name", search: "Labtop", algorithm: "metaphone"})` → test metaphone algorithm
121
- 5. `sqlite_advanced_search({table: "test_products", column: "name", searchTerm: "keyboard", techniques: ["exact", "fuzzy", "phonetic"]})` → should find `Mechanical Keyboard`
122
- 6. `sqlite_advanced_search({table: "test_products", column: "name", searchTerm: "Labtop", techniques: ["phonetic"]})` → test with single technique
123
-
124
- **FTS5 tools `[NATIVE ONLY]`:**
125
-
126
- 7. `sqlite_fts_create({sourceTable: "test_users", columns: ["username", "bio"], ftsTable: "temp_users_fts"})` → FTS5 virtual table created
127
- 8. `sqlite_fts_rebuild({table: "temp_users_fts"})` → rebuild index before searching
128
- 9. `sqlite_fts_search({table: "temp_users_fts", query: "test*"})` → verify results from test_users data (prefix query needed since no standalone "test" token exists)
129
- 10. Cleanup: `sqlite_drop_table({table: "temp_users_fts"})` (drop the temp FTS table using sqlite_write_query or core drop_table)
130
- 11. `sqlite_fts_search({table: "test_articles_fts", query: "SQLite"})` → at least 1 result (article 1: "Introduction to SQLite")
131
- 12. `sqlite_fts_search({table: "test_articles_fts", query: "MCP protocol"})` → matches article 3: "The Model Context Protocol Explained"
132
- 13. `sqlite_fts_search({table: "test_articles_fts", query: "nonexistent_term_xyz"})` → 0 results
133
- 14. `sqlite_fts_match_info({table: "test_articles_fts", query: "database"})` → match info with scoring data
134
- 15. `sqlite_fts_rebuild({table: "test_articles_fts"})` → success
135
-
136
- **Error path testing:**
137
-
138
- 🔴 16. `sqlite_fuzzy_match({table: "test_users", column: "nonexistent_col", search: "test"})` → structured error with code `COLUMN_NOT_FOUND`
139
- 🔴 17. `sqlite_fts_search({table: "nonexistent_fts_xyz", query: "test"})` `[NATIVE ONLY]` → structured error
140
-
141
- **Zod validation sweep** — call each tool with `{}` (empty params). Must return handler error, NOT raw MCP error:
142
-
143
- 🔴 18. `sqlite_fuzzy_match({})` → handler error
144
- 🔴 19. `sqlite_phonetic_match({})` → handler error
145
- 🔴 20. `sqlite_advanced_search({})` → handler error
146
- 🔴 21. `sqlite_text_sentiment({})` → handler error
147
- 🔴 22. `sqlite_fts_create({})` `[NATIVE ONLY]` → handler error
148
- 🔴 23. `sqlite_fts_search({})` `[NATIVE ONLY]` → handler error
149
- 🔴 24. `sqlite_fts_rebuild({})` `[NATIVE ONLY]` → handler error
150
- 🔴 25. `sqlite_fts_match_info({})` `[NATIVE ONLY]` → handler error
151
- 🔴 26. `sqlite_fts_headline({})` `[NATIVE ONLY]` → handler error
152
-
153
- ---
154
-
155
- ## Post-Test Procedures
156
-
157
- ### Reporting Rules
158
-
159
- - Use ✅ only in inline notes during testing; omit from Final Summary
160
- - Do not mention what already works well or issues already documented in help resources and runtime hints
161
-
162
- ### After Testing
163
-
164
- 1. **Triage findings**: If issues were found, create an implementation plan. If the plan requires no user decisions, proceed directly to implementation
165
- 2. **Scope of fixes** includes corrections to handler code, `src/constants/server-instructions/*.md`, test database, or this prompt
166
- 3. **Validate**: Instruct the user to run the test suite (Vitest/Playwright), lint, and typecheck. Do NOT run them yourself.
167
- 4. **Commit**: Stage and commit — do NOT push
168
- 5. **Live re-test**: Test fixes with direct MCP tool calls after server rebuild
169
- 6. **Final summary**: Provide summary after testing/re-testing confirms fixes
@@ -1,177 +0,0 @@
1
- # db-mcp Tool Group Testing: [text-basic]
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 11 tools in this basic text suite 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 **text-basic** 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.
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.
49
- 2. Test each tool with realistic inputs based on the schema above.
50
- 3. Report all failures, unexpected behaviors, improvement opportunities, or unnecessarily large payloads.
51
- 4. **Error path testing**: For **every** tool, test at least **two** invalid inputs: (a) a domain error and (b) a **Zod validation error** (call the tool with `{}` empty params). Both must return a **structured handler error** (`{success: false, error: "..."}`) — NOT a raw MCP error frame.
52
- 5. **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 produce the same `-32602` code as input errors but are only caught with valid inputs.
53
- 6. **Code Over Docs**: Fix the handler code if standards (Structured Errors/Zod) are violated. Do NOT change docs/prompts to accommodate broken code.
54
-
55
- ## Structured Error Response Pattern
56
-
57
- All tools should return errors as structured objects instead of throwing. The expected pattern:
58
-
59
- ```json
60
- { "success": false, "error": "Human-readable error message" }
61
- ```
62
-
63
- ### Handler Error vs MCP Error — How to Distinguish
64
-
65
- | Type | Source | What you see | Verdict |
66
- | -------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | ------------------ |
67
- | **Handler error** ✅ | Handler catches error and returns `{success: false, error: "..."}` | Parseable JSON object with `success` and `error` fields | Correct |
68
- | **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 ❌ |
69
-
70
- ### Zod Validation Errors
71
-
72
- 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.
73
-
74
- **Fix:** Remove ALL `.min(N)` / `.max(N)` refinements from the schema and validate inside the handler instead.
75
-
76
- ### Wrong-Type Numeric Parameter Coercion
77
-
78
- For every tool with optional numeric parameters (e.g., `limit`), call the tool with `param: "abc"` (string instead of number). The tool must NOT return a raw MCP `-32602` error.
79
-
80
- ### Output Schema Validation Errors
81
-
82
- 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.
83
-
84
- **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", report as ❌ with both the tool name and the missing field(s).
85
-
86
- ### Error Consistency Audit
87
-
88
- 1. **Throw-vs-return**: If a tool throws a raw error instead of returning `{success: false}`, report as ❌.
89
- 2. **Error field name**: All `{success: false}` responses should use `error` as the field name.
90
- 3. **Zod validation leaks**: If calling a tool with missing required field produces a raw MCP `-32602` error instead of a structured response, report as ❌.
91
- 4. **Output schema leaks**: If calling a tool with valid inputs produces a raw MCP `-32602` mentioning "output schema", report as ❌.
92
-
93
- ---
94
-
95
- ## Group Focus: text-basic
96
-
97
- > **Instructions**: Execute every numbered checklist item with the exact inputs shown. Compare responses against the expected results. Report any deviation.
98
-
99
- ### text-basic Group Tools (11)
100
-
101
- 1. sqlite_regex_extract
102
- 2. sqlite_regex_match
103
- 3. sqlite_text_split
104
- 4. sqlite_text_concat
105
- 5. sqlite_text_replace
106
- 6. sqlite_text_trim
107
- 7. sqlite_text_case
108
- 8. sqlite_text_substring
109
- 9. sqlite_text_validate
110
- 10. sqlite_text_normalize
111
- 11. sqlite_execute_code
112
-
113
- **Test data reference:**
114
-
115
- - `test_users` (9 rows): Emails include `@example.com`, `@company.org`, `@gmail.com`, etc. One user (`testuser`) has `test.user@gmail.com`. Phone formats: `+1-555-0101`, `+44-20-7123-4567`, `+82-2-1234-5678`
116
- - `test_products` row 16: `name = 'Café Décor Light'` — has accented characters for `strip_accents` testing
117
-
118
- **Checklist:**
119
-
120
- 1. `sqlite_regex_match({table: "test_users", column: "email", pattern: "@gmail\\.com$"})` → at least 1 result (`test.user@gmail.com`)
121
- 2. `sqlite_regex_extract({table: "test_users", column: "email", pattern: "@([^.]+)\\.", groupIndex: 1})` → extract domain parts (example, company, startup, etc.)
122
- 3. `sqlite_text_validate({table: "test_users", column: "email", pattern: "email"})` → all 9 rows should be valid emails
123
- 4. `sqlite_text_validate({table: "test_users", column: "phone", pattern: "phone"})` → report valid/invalid counts (one user has NULL phone)
124
- 5. `sqlite_text_case({table: "test_users", column: "username", mode: "upper"})` → all usernames uppercased
125
- 6. `sqlite_text_normalize({table: "test_products", column: "name", mode: "strip_accents"})` → `Café Décor Light` becomes `Cafe Decor Light`
126
- 7. `sqlite_text_split({table: "test_users", column: "email", delimiter: "@"})` → each email split into local + domain parts
127
- 8. `sqlite_text_concat({table: "test_users", columns: ["username", "email"], separator: " - "})` → concatenated strings
128
- 9. `sqlite_text_replace({table: "test_users", column: "email", searchPattern: "@example.com", replaceWith: "@test.org", whereClause: "email LIKE '%@example.com'"})` → 1 row affected (write operation — revert with `searchPattern: "@test.org", replaceWith: "@example.com", whereClause: "email LIKE '%@test.org'"` afterward)
129
- 10. `sqlite_text_trim({table: "test_users", column: "bio"})` → trimmed bios
130
- 11. `sqlite_text_substring({table: "test_users", column: "username", start: 1, length: 4})` → first 4 chars of each username
131
-
132
- **Code mode testing:**
133
-
134
- 12. `sqlite_execute_code({code: "const result = await sqlite.text.regexMatch({table: 'test_users', column: 'email', pattern: '@gmail\\\\.com$'}); return result;"})` → at least 1 result
135
-
136
- **Error path testing:**
137
-
138
- 🔴 13. `sqlite_regex_match({table: "nonexistent_table_xyz", column: "x", pattern: "."})` → structured error
139
-
140
- **Zod validation sweep** — call each tool with `{}` (empty params). Must return handler error, NOT raw MCP error:
141
-
142
- 🔴 14. `sqlite_regex_extract({})` → handler error
143
- 🔴 15. `sqlite_regex_match({})` → handler error
144
- 🔴 16. `sqlite_text_split({})` → handler error
145
- 🔴 17. `sqlite_text_concat({})` → handler error
146
- 🔴 18. `sqlite_text_replace({})` → handler error
147
- 🔴 19. `sqlite_text_trim({})` → handler error
148
- 🔴 20. `sqlite_text_case({})` → handler error
149
- 🔴 21. `sqlite_text_substring({})` → handler error
150
- 🔴 22. `sqlite_text_normalize({})` → handler error
151
- 🔴 23. `sqlite_text_validate({})` → handler error
152
- 🔴 24. `sqlite_execute_code({})` → handler error
153
-
154
- ---
155
-
156
- ## Post-Test Procedures
157
-
158
- ### Reporting Rules
159
-
160
- - Use ✅ only in inline notes during testing; omit from Final Summary
161
- - Do not mention what already works well or issues already documented in help resources and runtime hints
162
-
163
- ### After Testing
164
-
165
- 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
166
- 2. **Scope of fixes** includes corrections to any of:
167
- - Handler code
168
- - `src/constants/server-instructions/*.md` (per-group help files) — run `npm run generate:instructions` after editing to regenerate `server-instructions.ts`
169
- - Test database (`test-server/test.db`)
170
- - This prompt
171
-
172
- ### After Implementation
173
-
174
- 3. **Validate**: Instruct the user to run the test suite (Vitest/Playwright), lint, and typecheck. Do NOT run them yourself.
175
- 4. **Commit**: Stage and commit all changes — do NOT push
176
- 5. **Live re-test**: Test fixes with direct MCP tool calls. I will have already rebuilt and restarted the server.
177
- 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.