tdsql-mcp 1.3.2__tar.gz → 1.3.4__tar.gz

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 (56) hide show
  1. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/PKG-INFO +1 -1
  2. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/pyproject.toml +1 -1
  3. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/guidelines.md +54 -0
  4. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/sql-basics.md +61 -9
  5. tdsql_mcp-1.3.2/8888 +0 -0
  6. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/.env.example +0 -0
  7. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/.gitignore +0 -0
  8. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/CLAUDE.md +0 -0
  9. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/README.md +0 -0
  10. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/docs/architecture.md +0 -0
  11. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/requirements.txt +0 -0
  12. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/README.md +0 -0
  13. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/SKILL.md +0 -0
  14. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/aggregate-functions.md +0 -0
  15. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/ai-text-analytics.md +0 -0
  16. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/association-analysis.md +0 -0
  17. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/authorization-objects.md +0 -0
  18. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/bit-byte-functions.md +0 -0
  19. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/byom-model-loading.md +0 -0
  20. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/byom-scoring.md +0 -0
  21. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/catalog-views.md +0 -0
  22. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/conditional.md +0 -0
  23. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/data-cleaning.md +0 -0
  24. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/data-exploration.md +0 -0
  25. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/data-prep.md +0 -0
  26. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/data-types-casting.md +0 -0
  27. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/date-time.md +0 -0
  28. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/embeddings.md +0 -0
  29. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/fit-transform-pattern.md +0 -0
  30. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/geospatial.md +0 -0
  31. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/hypothesis-testing.md +0 -0
  32. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/index.md +0 -0
  33. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/json-functions.md +0 -0
  34. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/llm-providers.md +0 -0
  35. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/ml-functions.md +0 -0
  36. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/ml-patterns.md +0 -0
  37. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/model-evaluation.md +0 -0
  38. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/numeric-functions.md +0 -0
  39. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/path-analysis.md +0 -0
  40. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/query-tuning.md +0 -0
  41. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/string-functions.md +0 -0
  42. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/text-analytics.md +0 -0
  43. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/uaf-concepts.md +0 -0
  44. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/uaf-data-prep.md +0 -0
  45. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/uaf-diagnostics.md +0 -0
  46. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/uaf-dsp.md +0 -0
  47. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/uaf-estimation.md +0 -0
  48. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/uaf-forecasting.md +0 -0
  49. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/uaf-formula-rules.md +0 -0
  50. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/uaf-utility.md +0 -0
  51. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/utility-functions.md +0 -0
  52. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/vector-search.md +0 -0
  53. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/skills/teradata-sql-analytics/syntax/window-functions.md +0 -0
  54. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/src/tdsql_mcp/__init__.py +0 -0
  55. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/src/tdsql_mcp/server.py +0 -0
  56. {tdsql_mcp-1.3.2 → tdsql_mcp-1.3.4}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tdsql-mcp
3
- Version: 1.3.2
3
+ Version: 1.3.4
4
4
  Summary: MCP server for Teradata Vantage — SQL execution and native analytics function reference for AI agents
5
5
  Project-URL: Homepage, https://github.com/ksturgeon-td/tdsql-mcp
6
6
  Project-URL: Repository, https://github.com/ksturgeon-td/tdsql-mcp
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "tdsql-mcp"
7
- version = "1.3.2"
7
+ version = "1.3.4"
8
8
  description = "MCP server for Teradata Vantage — SQL execution and native analytics function reference for AI agents"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -195,6 +195,31 @@ Native functions distribute across all AMPs. The result set returned to the agen
195
195
  | External TF-IDF | `TD_TFIDF` | `text-analytics` |
196
196
  | External word embeddings | `TD_WordEmbeddings` | `text-analytics` |
197
197
 
198
+ ### LLM-Powered Text Analytics (AI_* Functions)
199
+
200
+ > **Prerequisites:** Requires an authorization object and LLM provider configuration before use. See `authorization-objects` and `llm-providers` topics. All functions use `TD_SYSFNLIB.<FunctionName>(ON ...)` — do **not** add a `PARTITION BY` clause.
201
+
202
+ | Instead of this | Use this (native function) | Topic |
203
+ |-----------------|---------------------------|-------|
204
+ | External/post-hoc sentiment scoring | `AI_AnalyzeSentiment` | `ai-text-analytics` |
205
+ | Per-row LLM API calls with question + context data | `AI_AskLLM` (two-table: InputTable + ContextTable, co-partitioned by key) | `ai-text-analytics` |
206
+ | External language detection | `AI_DetectLanguage` | `ai-text-analytics` |
207
+ | External key phrase extraction | `AI_ExtractKeyPhrases` | `ai-text-analytics` |
208
+ | External PII masking | `AI_MaskPII` (detects PII + returns `Masked_Phrase` with `*` replacement) | `ai-text-analytics` |
209
+ | External NER (general named entities — people, places, orgs, dates) | `AI_RecognizeEntities` | `ai-text-analytics` |
210
+ | External PII entity detection (structured metadata, no masking) | `AI_RecognizePIIEntities` | `ai-text-analytics` |
211
+ | External text classification with custom label set | `AI_TextClassifier` — supports single-label and multi-label | `ai-text-analytics` |
212
+ | External summarization | `AI_TextSummarize` — supports 1–5 compression levels | `ai-text-analytics` |
213
+ | External translation | `AI_TextTranslate` | `ai-text-analytics` |
214
+
215
+ **NER/PII function selection:**
216
+
217
+ | Need | Function |
218
+ |------|----------|
219
+ | General named entities (people, places, orgs, dates) | `AI_RecognizeEntities` |
220
+ | PII detection + masked text output | `AI_MaskPII` |
221
+ | PII detection + structured metadata only (no masking) | `AI_RecognizePIIEntities` |
222
+
198
223
  ### Vector Search
199
224
 
200
225
  | Instead of this | Use this (native function) | Topic |
@@ -211,6 +236,18 @@ Native functions distribute across all AMPs. The result set returned to the agen
211
236
 
212
237
  **Finding the embedding model for an existing corpus:** Query `TD_SYSAI.TD_CollectionsV` or `TD_SYSAI.TD_VectorStores` to discover the model name, provider, and embedding size used to build a corpus. The query pipeline must use the exact same model — mismatched embeddings produce meaningless scores. See `vector-search` topic, "Discovering Existing Vector Stores" section.
213
238
 
239
+ ### Embeddings
240
+
241
+ | Scenario | Use this | Topic |
242
+ |----------|---------|-------|
243
+ | REST-based embedding API (Azure, AWS Bedrock, GCP, NVIDIA NIM, LiteLLM) | `AI_TextEmbeddings` with `OutputFormat('VECTOR')` | `embeddings` |
244
+ | In-database inference — no external API (air-gapped or latency-sensitive) | `ONNXEmbeddings` — model stored as BLOB in Vantage; requires tokenizer table | `embeddings`, `byom-model-loading` |
245
+ | Classical word/document embeddings (GloVe-style) | `TD_WordEmbeddings` | `text-analytics` |
246
+ | Store embeddings for reuse | CTAS with `VECTOR` column, then `TD_VectorNormalize(Approach('UNITVECTOR'))` at storage time | `embeddings`, `vector-search` |
247
+ | Build fast approximate search index | `TD_HNSW` on normalized VECTOR column | `vector-search` |
248
+
249
+ > **Always use `OutputFormat('VECTOR')`** when embeddings will be stored, normalized, or used with `TD_VectorDistance` / `TD_HNSW` / `TD_HNSWPredict`. The `VECTOR` type integrates directly with all vector search functions. See `data-types-casting` for VECTOR sizing (bytes, not dimensions).
250
+
214
251
  ### JSON Data
215
252
 
216
253
  | Operation | Use this | Topic |
@@ -236,6 +273,23 @@ Native functions distribute across all AMPs. The result set returned to the agen
236
273
  | Vantage ARRAY → JSON | `ARRAY_TO_JSON(arr_col)` | `json-functions` |
237
274
  | ST_Geometry ↔ GeoJSON | `GeoJSONFromGeom(geom)` / `GeomFromGeoJSON(json, srid)` | `json-functions` |
238
275
 
276
+ ### BYOM — Bring Your Own Model
277
+
278
+ Apply externally trained models to in-database data without moving data out of Teradata. All scoring functions share the same two-table pattern: `InputTable` + `ModelTable DIMENSION`. See `byom-model-loading` topic for model ingestion; see `byom-scoring` for full syntax.
279
+
280
+ | Instead of this | Use this (native function) | Topic |
281
+ |-----------------|---------------------------|-------|
282
+ | Running PMML model inference externally | `PMMLPredict` | `byom-scoring` |
283
+ | Running H2O MOJO or Driverless AI model externally | `H2OPredict` (supports contributions, stage probabilities, leaf node assignments) | `byom-scoring` |
284
+ | Running ONNX tabular model externally | `ONNXPredict` (use `ShowModelInputFieldsMap('true')` to inspect tensor mapping) | `byom-scoring` |
285
+ | Running Dataiku Thin JAR externally | `DataikuPredict` (model_id = fully qualified Java class name) | `byom-scoring` |
286
+ | Running DataRobot Scoring Code externally | `DataRobotPredict` (cast DATE/TIMESTAMP to VARCHAR before scoring) | `byom-scoring` |
287
+ | Running MLeap model externally | `MLeapPredict` | `byom-scoring` |
288
+ | In-database text generation / seq-to-seq (translation, summarization) | `ONNXSeq2Seq` — ONNX transformer, no external API | `byom-scoring` |
289
+ | In-database text classification (transformer) | `ONNXClassification` — supports softmax, argmax, custom output column mapping | `byom-scoring` |
290
+
291
+ > **Architecture distinction:** `ONNXSeq2Seq` and `ONNXClassification` run Hugging Face ONNX transformer models entirely in-database. For REST-based LLM text tasks (sentiment, PII, translation, summarization), use the `AI_*` functions in `ai-text-analytics` instead.
292
+
239
293
  ### Statistical Testing
240
294
 
241
295
  | Instead of this | Use this (native function) | Topic |
@@ -140,15 +140,70 @@ CREATE USER myuser AS
140
140
  -- Semicolons: required in BTEQ; optional in most client tools
141
141
  ```
142
142
 
143
- ## Reserved Words as Column Names in Table Operator Clauses
143
+ ## Reserved Words and Identifier Quoting
144
144
 
145
- When a column name is a Teradata reserved word (e.g. `type`, `date`, `time`, `value`, `name`, `format`, `title`), it must be double-quoted. In regular SQL projections this looks normal:
145
+ Quote any identifier (column, table, alias) that conflicts with a reserved word using **double quotes**:
146
146
 
147
147
  ```sql
148
- SELECT "type", "date" FROM db.my_table;
148
+ SELECT id, "type", "format" FROM db.events;
149
+
150
+ CREATE TABLE db.events (
151
+ id INTEGER,
152
+ "type" VARCHAR(30), -- reserved word — must quote
153
+ label VARCHAR(100)
154
+ ) PRIMARY INDEX (id);
149
155
  ```
150
156
 
151
- In table operator string arguments (`ACCUMULATE`, `IDColumn`, `TargetColumns`, `Accumulate`, etc.), the double-quotes must be embedded **inside** the single-quoted string:
157
+ > **Quoted identifiers are case-sensitive.** Use consistent casing `"type"` and `"TYPE"` are different identifiers.
158
+
159
+ ### Teradata-Specific Reserved Words — Common Identifier Conflicts
160
+
161
+ The ANSI SQL reserved words are well-known. The words below are **Teradata-only** — not in the ANSI SQL-99 standard — so agents may not recognize them as reserved. Always quote these when using them as column, table, or alias names.
162
+
163
+ **Words that frequently appear as column or table names:**
164
+
165
+ | Reserved word | Commonly appears as | TD since |
166
+ |--------------|---------------------|----------|
167
+ | `TYPE` | transaction type, event type, record type | V2R3 |
168
+ | `FORMAT` | file format, output format, date format | V2R3 |
169
+ | `TITLE` | document title; also controls the TD column display header | V2R3 |
170
+ | `MODE` | processing mode, run mode, lock mode | V2R3 |
171
+ | `ACCOUNT` | account_id, account-related tables | V2R3 |
172
+ | `LOG` | log tables, audit logs, log level | V2R3 |
173
+ | `LOCK` | lock status, concurrency tables | V2R3 |
174
+ | `HASH` | hash keys, checksums, deduplication columns | V2R3 |
175
+ | `REQUEST` | request_id, API and service event tables | V2R3 |
176
+ | `STATISTICS` | monitoring tables, collected stats columns | V2R3 |
177
+ | `JOURNAL` | financial journals, transaction audit logs | V2R3 |
178
+ | `CLUSTER` | cluster_id, partition or segment label | V2R3 |
179
+ | `NAMED` | TD column alias syntax (`expr (NAMED alias)`) — risky as a column name | V2R3 |
180
+ | `ENABLED` / `DISABLED` | feature flag columns, configuration status | V2R3 |
181
+ | `CLASS` | object class, classification, CSS class | V2R5 |
182
+ | `PROFILE` | user profiles, configuration profiles | V2R5 |
183
+ | `SUMMARY` | summary text columns, reporting tables | V2R5 |
184
+ | `THRESHOLD` | alert thresholds, monitoring limit columns | V2R5 |
185
+ | `TRACE` | trace_id, debug or telemetry columns | V2R5 |
186
+
187
+ **Teradata SQL extension keywords — these are clause keywords, not identifiers:**
188
+
189
+ | Keyword | Purpose |
190
+ |---------|---------|
191
+ | `QUALIFY` | Filters window function results — like WHERE for OVER clauses; not in ANSI SQL |
192
+ | `SAMPLE` | Random row sampling: `SELECT * FROM t SAMPLE 100` or `SAMPLE .05` |
193
+ | `VOLATILE` | Session-scoped temp table: `CREATE VOLATILE TABLE ...` |
194
+ | `LOCKING` | Lock modifier: `LOCKING TABLE t FOR ACCESS SELECT ...` |
195
+ | `REPLACE` | TD DDL: `REPLACE VIEW` — not `CREATE OR REPLACE` |
196
+ | `EXPLAIN` | Execution plan: `EXPLAIN SELECT ...` |
197
+ | `FALLBACK` | Table-level data protection option at `CREATE TABLE` time |
198
+ | `MULTISET` | Table type allowing duplicate rows: `CREATE MULTISET TABLE ...` |
199
+ | `MACRO` | Stored parameterized query: `CREATE MACRO ...` |
200
+ | `COLLECT` | Statistics collection: `COLLECT STATISTICS ON db.t COLUMN (col)` |
201
+ | `BT` / `ET` | Begin Transaction / End Transaction |
202
+ | `SEL` | Teradata shorthand for `SELECT` |
203
+
204
+ ### Reserved Words in Table Operator String Arguments
205
+
206
+ In table operator clauses that take column names as **string arguments** (`Accumulate`, `IDColumn`, `TargetColumns`, `ResponseColumn`, etc.), double-quotes must be embedded **inside** the single-quoted string:
152
207
 
153
208
  ```sql
154
209
  -- WRONG: 'type' is a reserved word — Teradata will reject or misparse this
@@ -158,19 +213,16 @@ USING IDColumn('id') Accumulate('type', 'value')
158
213
  USING IDColumn('id') Accumulate('"type"', '"value"')
159
214
  ```
160
215
 
161
- This applies to **any** table operator clause that takes column names as string arguments:
216
+ This applies to any table operator clause that takes column names as string arguments:
162
217
 
163
218
  ```sql
164
- -- All of these follow the same rule
165
219
  IDColumn('"type"')
166
220
  TargetColumns('"value"', '"date"', 'non_reserved_col')
167
221
  Accumulate('"type"', 'amount', '"date"')
168
222
  ResponseColumn('"value"')
169
223
  ```
170
224
 
171
- **When in doubt, quote it.** Double-quoting a non-reserved word in a string argument is harmless; leaving a reserved word unquoted will cause a parse error.
172
-
173
- Common Teradata reserved words that appear as column names: `type`, `date`, `time`, `timestamp`, `value`, `name`, `format`, `title`, `level`, `mode`, `status`, `class`, `key`, `index`, `year`, `month`, `day`, `hour`, `minute`, `second`.
225
+ **When in doubt, quote it.** Double-quoting a non-reserved word inside a string argument is harmless; leaving a reserved word unquoted will cause a parse error.
174
226
 
175
227
  ## Teradata Operator Differences
176
228
 
tdsql_mcp-1.3.2/8888 DELETED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes