@lightdash-tools/mcp 0.6.0 → 0.7.0

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 (271) hide show
  1. package/README.md +133 -58
  2. package/dist/audit/audit.d.ts +5 -0
  3. package/dist/{audit.js → audit/audit.js} +1 -2
  4. package/dist/audit/tool-audit-context.d.ts +6 -0
  5. package/dist/audit/tool-audit-context.js +12 -0
  6. package/dist/audit/tool-audit-context.test.d.ts +1 -0
  7. package/dist/audit/tool-audit-context.test.js +19 -0
  8. package/dist/auth/auth-mode.d.ts +4 -0
  9. package/dist/auth/auth-mode.js +6 -0
  10. package/dist/auth/bearer.d.ts +3 -0
  11. package/dist/auth/bearer.js +13 -0
  12. package/dist/auth/lightdash-oauth-upstream-contract.d.ts +22 -0
  13. package/dist/auth/lightdash-oauth-upstream-contract.js +36 -0
  14. package/dist/auth/lightdash-oauth-upstream-contract.test.d.ts +1 -0
  15. package/dist/auth/lightdash-oauth-upstream-contract.test.js +56 -0
  16. package/dist/auth/oauth-broker/as-metadata.d.ts +14 -0
  17. package/dist/auth/oauth-broker/as-metadata.js +20 -0
  18. package/dist/auth/oauth-broker/lightdash-token.d.ts +20 -0
  19. package/dist/auth/oauth-broker/lightdash-token.js +76 -0
  20. package/dist/auth/oauth-broker/pending-store.d.ts +76 -0
  21. package/dist/auth/oauth-broker/pending-store.js +124 -0
  22. package/dist/auth/oauth-broker/pkce.d.ts +2 -0
  23. package/dist/auth/oauth-broker/pkce.js +17 -0
  24. package/dist/auth/oauth-broker/routes.d.ts +9 -0
  25. package/dist/auth/oauth-broker/routes.js +447 -0
  26. package/dist/auth/oauth-broker/routes.test.d.ts +1 -0
  27. package/dist/auth/oauth-broker/routes.test.js +237 -0
  28. package/dist/auth/providers/bearer-context-provider.d.ts +24 -0
  29. package/dist/auth/providers/bearer-context-provider.js +52 -0
  30. package/dist/auth/providers/env-context-provider.d.ts +13 -0
  31. package/dist/auth/providers/env-context-provider.js +19 -0
  32. package/dist/auth/resource-server/lightdash-oauth-middleware.d.ts +23 -0
  33. package/dist/auth/resource-server/lightdash-oauth-middleware.js +115 -0
  34. package/dist/auth/resource-server/lightdash-oauth-middleware.test.d.ts +1 -0
  35. package/dist/auth/resource-server/lightdash-oauth-middleware.test.js +202 -0
  36. package/dist/auth/resource-server/lightdash-token-validation.d.ts +14 -0
  37. package/dist/auth/resource-server/lightdash-token-validation.js +82 -0
  38. package/dist/auth/resource-server/lightdash-token-validation.test.d.ts +1 -0
  39. package/dist/auth/resource-server/lightdash-token-validation.test.js +177 -0
  40. package/dist/auth/resource-server/oauth-protected-resource.d.ts +25 -0
  41. package/dist/auth/resource-server/oauth-protected-resource.js +67 -0
  42. package/dist/auth/resource-server/shared-key-middleware.d.ts +13 -0
  43. package/dist/auth/resource-server/shared-key-middleware.js +24 -0
  44. package/dist/auth/resource-server/token-scopes.d.ts +15 -0
  45. package/dist/auth/resource-server/token-scopes.js +76 -0
  46. package/dist/auth/resource-server/token-scopes.test.d.ts +1 -0
  47. package/dist/auth/resource-server/token-scopes.test.js +51 -0
  48. package/dist/auth/resource-server/token-validation-cache.d.ts +15 -0
  49. package/dist/auth/resource-server/token-validation-cache.js +44 -0
  50. package/dist/auth/resource-server/token-validation-cache.test.d.ts +1 -0
  51. package/dist/auth/resource-server/token-validation-cache.test.js +41 -0
  52. package/dist/auth/resource-server/token-validation-error.d.ts +6 -0
  53. package/dist/auth/resource-server/token-validation-error.js +13 -0
  54. package/dist/auth/resource-server/www-authenticate.d.ts +8 -0
  55. package/dist/auth/resource-server/www-authenticate.js +24 -0
  56. package/dist/auth/resource-server/www-authenticate.test.d.ts +1 -0
  57. package/dist/auth/resource-server/www-authenticate.test.js +64 -0
  58. package/dist/auth/token-hash.d.ts +2 -0
  59. package/dist/auth/token-hash.js +8 -0
  60. package/dist/bin.d.ts +0 -4
  61. package/dist/bin.js +41 -33
  62. package/dist/config/env.d.ts +50 -0
  63. package/dist/config/env.js +53 -0
  64. package/dist/config/load-mcp-config.d.ts +30 -0
  65. package/dist/config/load-mcp-config.js +282 -0
  66. package/dist/config/load-mcp-config.test.d.ts +1 -0
  67. package/dist/config/load-mcp-config.test.js +195 -0
  68. package/dist/config/normalize-url.d.ts +13 -0
  69. package/dist/config/normalize-url.js +52 -0
  70. package/dist/config/normalize-url.test.d.ts +1 -0
  71. package/dist/config/normalize-url.test.js +41 -0
  72. package/dist/config/public-url.d.ts +3 -0
  73. package/dist/config/public-url.js +10 -0
  74. package/dist/config/runtime.d.ts +15 -0
  75. package/dist/config/runtime.js +48 -0
  76. package/dist/config/runtime.test.d.ts +1 -0
  77. package/dist/config/runtime.test.js +69 -0
  78. package/dist/config/test-mcp-http-config.d.ts +3 -0
  79. package/dist/config/test-mcp-http-config.js +7 -0
  80. package/dist/governance/project-pin.d.ts +14 -0
  81. package/dist/governance/project-pin.js +44 -0
  82. package/dist/governance/project-pin.test.d.ts +1 -0
  83. package/dist/governance/project-pin.test.js +35 -0
  84. package/dist/http.d.ts +1 -2
  85. package/dist/http.integration.test.d.ts +1 -0
  86. package/dist/http.integration.test.js +688 -0
  87. package/dist/http.js +3 -170
  88. package/dist/http.test.d.ts +4 -0
  89. package/dist/http.test.js +131 -0
  90. package/dist/index.d.ts +2 -0
  91. package/dist/index.integration.test.js +73 -30
  92. package/dist/index.js +28 -27
  93. package/dist/index.test.js +3 -3
  94. package/dist/logging/structured.d.ts +27 -0
  95. package/dist/logging/structured.js +32 -0
  96. package/dist/logging/structured.test.d.ts +1 -0
  97. package/dist/logging/structured.test.js +33 -0
  98. package/dist/personas/index.d.ts +19 -0
  99. package/dist/personas/index.js +57 -0
  100. package/dist/personas/index.test.d.ts +1 -0
  101. package/dist/personas/index.test.js +58 -0
  102. package/dist/personas/organization-audit/v1/index.d.ts +8 -0
  103. package/dist/personas/organization-audit/v1/index.js +42 -0
  104. package/dist/personas/organization-audit/v1/prompts.d.ts +5 -0
  105. package/dist/personas/organization-audit/v1/prompts.js +111 -0
  106. package/dist/personas/organization-audit/v1/prompts.test.d.ts +4 -0
  107. package/dist/personas/organization-audit/v1/prompts.test.js +25 -0
  108. package/dist/personas/organization-audit/v1/resources/playbook.d.ts +11 -0
  109. package/dist/personas/organization-audit/v1/resources/playbook.js +40 -0
  110. package/dist/personas/organization-audit/v1/resources/playbook.md +52 -0
  111. package/dist/personas/semantic-layer/v1/index.d.ts +8 -0
  112. package/dist/personas/semantic-layer/v1/index.js +32 -0
  113. package/dist/personas/semantic-layer/v1/prompts.d.ts +5 -0
  114. package/dist/personas/semantic-layer/v1/prompts.js +107 -0
  115. package/dist/personas/semantic-layer/v1/resources/playbook.d.ts +12 -0
  116. package/dist/personas/semantic-layer/v1/resources/playbook.js +42 -0
  117. package/dist/personas/semantic-layer/v1/resources/playbook.md +153 -0
  118. package/dist/personas/types.d.ts +19 -0
  119. package/dist/personas/types.js +5 -0
  120. package/dist/protocol-contract.test.d.ts +1 -0
  121. package/dist/protocol-contract.test.js +42 -0
  122. package/dist/server/capabilities.d.ts +15 -0
  123. package/dist/server/capabilities.js +19 -0
  124. package/dist/server/capabilities.test.d.ts +1 -0
  125. package/dist/server/capabilities.test.js +39 -0
  126. package/dist/server/errors.test.d.ts +1 -0
  127. package/dist/server/errors.test.js +53 -0
  128. package/dist/server/request-context.d.ts +13 -0
  129. package/dist/server/request-context.js +2 -0
  130. package/dist/server/server.d.ts +4 -0
  131. package/dist/server/server.js +17 -0
  132. package/dist/server/server.test.d.ts +1 -0
  133. package/dist/server/server.test.js +15 -0
  134. package/dist/server/version.d.ts +1 -0
  135. package/dist/server/version.js +7 -0
  136. package/dist/server/version.test.d.ts +1 -0
  137. package/dist/server/version.test.js +9 -0
  138. package/dist/stdio.process.test.d.ts +1 -0
  139. package/dist/stdio.process.test.js +126 -0
  140. package/dist/tools/index.d.ts +2 -4
  141. package/dist/tools/index.js +4 -30
  142. package/dist/tools/index.test.d.ts +1 -0
  143. package/dist/tools/index.test.js +72 -0
  144. package/dist/tools/lib/api-errors.d.ts +9 -0
  145. package/dist/tools/lib/api-errors.js +22 -0
  146. package/dist/tools/lib/api-shape.d.ts +16 -0
  147. package/dist/tools/lib/api-shape.js +47 -0
  148. package/dist/tools/lib/assert-safe.d.ts +13 -0
  149. package/dist/tools/lib/assert-safe.js +21 -0
  150. package/dist/tools/lib/assert-safe.test.d.ts +4 -0
  151. package/dist/tools/lib/assert-safe.test.js +32 -0
  152. package/dist/tools/lib/concurrency.d.ts +4 -0
  153. package/dist/tools/lib/concurrency.js +24 -0
  154. package/dist/tools/lib/contracts.d.ts +34 -0
  155. package/dist/tools/lib/contracts.js +30 -0
  156. package/dist/tools/lib/redaction.d.ts +107 -0
  157. package/dist/tools/lib/redaction.js +299 -0
  158. package/dist/tools/lib/redaction.test.d.ts +4 -0
  159. package/dist/tools/lib/redaction.test.js +216 -0
  160. package/dist/tools/lib/register-org-audit.d.ts +9 -0
  161. package/dist/tools/lib/register-org-audit.js +20 -0
  162. package/dist/tools/lib/schema-fields.d.ts +9 -0
  163. package/dist/tools/lib/schema-fields.js +19 -0
  164. package/dist/tools/organization/binding.d.ts +14 -0
  165. package/dist/tools/organization/binding.js +31 -0
  166. package/dist/tools/organization/invariants.test.d.ts +4 -0
  167. package/dist/tools/organization/invariants.test.js +28 -0
  168. package/dist/tools/organization/inventory.d.ts +10 -0
  169. package/dist/tools/organization/inventory.js +189 -0
  170. package/dist/tools/organization/roles.d.ts +10 -0
  171. package/dist/tools/organization/roles.js +213 -0
  172. package/dist/tools/project/content.d.ts +9 -0
  173. package/dist/tools/project/content.js +192 -0
  174. package/dist/tools/project/projects.d.ts +7 -0
  175. package/dist/tools/project/projects.js +42 -0
  176. package/dist/tools/project/projects.test.d.ts +1 -0
  177. package/dist/tools/project/projects.test.js +117 -0
  178. package/dist/tools/project/schedulers.d.ts +7 -0
  179. package/dist/tools/project/schedulers.js +115 -0
  180. package/dist/tools/registry.d.ts +104 -0
  181. package/dist/tools/registry.js +59 -0
  182. package/dist/tools/semantic/explore-helpers.d.ts +56 -0
  183. package/dist/tools/semantic/explore-helpers.js +115 -0
  184. package/dist/tools/semantic/explore-helpers.test.d.ts +1 -0
  185. package/dist/tools/semantic/explore-helpers.test.js +170 -0
  186. package/dist/tools/semantic/explores.d.ts +9 -0
  187. package/dist/tools/semantic/explores.js +80 -0
  188. package/dist/tools/semantic/metrics.d.ts +7 -0
  189. package/dist/tools/semantic/metrics.js +53 -0
  190. package/dist/tools/semantic/query.d.ts +6 -0
  191. package/dist/tools/semantic/query.js +42 -0
  192. package/dist/tools/semantic/schema-fields.d.ts +3 -0
  193. package/dist/tools/semantic/schema-fields.js +7 -0
  194. package/dist/tools/shared.d.ts +26 -13
  195. package/dist/tools/shared.js +112 -157
  196. package/dist/tools/shared.test.js +132 -183
  197. package/dist/tools/space/access.d.ts +66 -0
  198. package/dist/tools/space/access.js +322 -0
  199. package/dist/tools/space/access.test.d.ts +4 -0
  200. package/dist/tools/space/access.test.js +90 -0
  201. package/dist/transports/http-body.d.ts +5 -0
  202. package/dist/transports/http-body.js +50 -0
  203. package/dist/transports/http-request-utils.d.ts +2 -0
  204. package/dist/transports/http-request-utils.js +13 -0
  205. package/dist/transports/http-response.d.ts +6 -0
  206. package/dist/transports/http-response.js +56 -0
  207. package/dist/transports/session-store.d.ts +40 -0
  208. package/dist/transports/session-store.js +88 -0
  209. package/dist/transports/session-store.test.d.ts +1 -0
  210. package/dist/transports/session-store.test.js +111 -0
  211. package/dist/transports/streamable-http.d.ts +9 -0
  212. package/dist/transports/streamable-http.js +454 -0
  213. package/dist/transports/streamable-http.test.d.ts +1 -0
  214. package/dist/transports/streamable-http.test.js +95 -0
  215. package/package.json +25 -10
  216. package/dist/audit.d.ts +0 -6
  217. package/dist/config.d.ts +0 -47
  218. package/dist/config.js +0 -82
  219. package/dist/tools/ai-agents.d.ts +0 -6
  220. package/dist/tools/ai-agents.js +0 -388
  221. package/dist/tools/charts.d.ts +0 -6
  222. package/dist/tools/charts.js +0 -55
  223. package/dist/tools/content.d.ts +0 -6
  224. package/dist/tools/content.js +0 -37
  225. package/dist/tools/dashboards.d.ts +0 -6
  226. package/dist/tools/dashboards.js +0 -28
  227. package/dist/tools/explores.d.ts +0 -6
  228. package/dist/tools/explores.js +0 -65
  229. package/dist/tools/groups.d.ts +0 -6
  230. package/dist/tools/groups.js +0 -121
  231. package/dist/tools/metrics.d.ts +0 -6
  232. package/dist/tools/metrics.js +0 -45
  233. package/dist/tools/projects.d.ts +0 -6
  234. package/dist/tools/projects.js +0 -58
  235. package/dist/tools/query.d.ts +0 -6
  236. package/dist/tools/query.js +0 -34
  237. package/dist/tools/schedulers.d.ts +0 -6
  238. package/dist/tools/schedulers.js +0 -45
  239. package/dist/tools/spaces.d.ts +0 -6
  240. package/dist/tools/spaces.js +0 -128
  241. package/dist/tools/tags.d.ts +0 -6
  242. package/dist/tools/tags.js +0 -28
  243. package/dist/tools/users.d.ts +0 -6
  244. package/dist/tools/users.js +0 -50
  245. package/src/audit.ts +0 -6
  246. package/src/bin.ts +0 -58
  247. package/src/config.ts +0 -83
  248. package/src/errors.ts +0 -27
  249. package/src/http.ts +0 -187
  250. package/src/index.integration.test.ts +0 -57
  251. package/src/index.test.ts +0 -8
  252. package/src/index.ts +0 -31
  253. package/src/tools/ai-agents.ts +0 -759
  254. package/src/tools/charts.ts +0 -85
  255. package/src/tools/content.ts +0 -44
  256. package/src/tools/dashboards.ts +0 -25
  257. package/src/tools/explores.ts +0 -98
  258. package/src/tools/groups.ts +0 -180
  259. package/src/tools/index.ts +0 -35
  260. package/src/tools/metrics.ts +0 -42
  261. package/src/tools/projects.ts +0 -74
  262. package/src/tools/query.ts +0 -47
  263. package/src/tools/schedulers.ts +0 -42
  264. package/src/tools/shared.test.ts +0 -365
  265. package/src/tools/shared.ts +0 -274
  266. package/src/tools/spaces.ts +0 -217
  267. package/src/tools/tags.ts +0 -25
  268. package/src/tools/users.ts +0 -64
  269. package/tsconfig.json +0 -13
  270. /package/dist/{errors.d.ts → server/errors.d.ts} +0 -0
  271. /package/dist/{errors.js → server/errors.js} +0 -0
@@ -1,388 +0,0 @@
1
- "use strict";
2
- /**
3
- * MCP tools: AI agents (admin + project-scoped), threads, and evaluations.
4
- */
5
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
- return new (P || (P = Promise))(function (resolve, reject) {
8
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
- step((generator = generator.apply(thisArg, _arguments || [])).next());
12
- });
13
- };
14
- var __rest = (this && this.__rest) || function (s, e) {
15
- var t = {};
16
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
17
- t[p] = s[p];
18
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
19
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
20
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
21
- t[p[i]] = s[p[i]];
22
- }
23
- return t;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.registerAiAgentTools = registerAiAgentTools;
27
- const zod_1 = require("zod");
28
- const shared_js_1 = require("./shared.js");
29
- function registerAiAgentTools(server, client) {
30
- // ─── Admin: agents ───────────────────────────────────────────────────────────
31
- (0, shared_js_1.registerToolSafe)(server, 'list_admin_agents', {
32
- title: 'List AI agents (admin)',
33
- description: 'List all AI agents across the organization (admin view)',
34
- inputSchema: {},
35
- annotations: shared_js_1.READ_ONLY_DEFAULT,
36
- }, (0, shared_js_1.wrapTool)(client, (c) => () => __awaiter(this, void 0, void 0, function* () {
37
- const result = yield c.v1.aiAgents.listAdminAgents();
38
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
39
- })));
40
- // ─── Admin: threads ──────────────────────────────────────────────────────────
41
- (0, shared_js_1.registerToolSafe)(server, 'list_admin_agent_threads', {
42
- title: 'List AI agent threads (admin)',
43
- description: 'List AI agent conversation threads across the organization with optional filters',
44
- inputSchema: {
45
- page: zod_1.z.number().optional().describe('Page number (1-based)'),
46
- pageSize: zod_1.z.number().optional().describe('Number of results per page'),
47
- agentUuids: zod_1.z.array(zod_1.z.string()).optional().describe('Filter by agent UUIDs'),
48
- projectUuids: zod_1.z.array(zod_1.z.string()).optional().describe('Filter by project UUIDs'),
49
- humanScore: zod_1.z
50
- .number()
51
- .optional()
52
- .describe('Filter by human score: -1 (negative), 0 (neutral), 1 (positive)'),
53
- dateFrom: zod_1.z.string().optional().describe('Start date filter (YYYY-MM-DD)'),
54
- dateTo: zod_1.z.string().optional().describe('End date filter (YYYY-MM-DD)'),
55
- sortField: zod_1.z.enum(['createdAt', 'title']).optional().describe('Sort field'),
56
- sortDirection: zod_1.z.enum(['asc', 'desc']).optional().describe('Sort direction'),
57
- },
58
- annotations: shared_js_1.READ_ONLY_DEFAULT,
59
- }, (0, shared_js_1.wrapTool)(client, (c) => (params) => __awaiter(this, void 0, void 0, function* () {
60
- const result = yield c.v1.aiAgents.getAdminThreads(params);
61
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
62
- })));
63
- // ─── Admin: settings ─────────────────────────────────────────────────────────
64
- (0, shared_js_1.registerToolSafe)(server, 'get_ai_organization_settings', {
65
- title: 'Get AI organization settings',
66
- description: 'Get the AI settings for the current organization (admin)',
67
- inputSchema: {},
68
- annotations: shared_js_1.READ_ONLY_DEFAULT,
69
- }, (0, shared_js_1.wrapTool)(client, (c) => () => __awaiter(this, void 0, void 0, function* () {
70
- const result = yield c.v1.aiAgents.getAiOrganizationSettings();
71
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
72
- })));
73
- (0, shared_js_1.registerToolSafe)(server, 'update_ai_organization_settings', {
74
- title: 'Update AI organization settings',
75
- description: 'Update the AI settings for the current organization (admin)',
76
- inputSchema: {
77
- aiAgentsVisible: zod_1.z
78
- .boolean()
79
- .optional()
80
- .describe('Whether AI agents feature is visible to users'),
81
- },
82
- annotations: shared_js_1.WRITE_IDEMPOTENT,
83
- }, (0, shared_js_1.wrapTool)(client, (c) => (params) => __awaiter(this, void 0, void 0, function* () {
84
- const result = yield c.v1.aiAgents.updateAiOrganizationSettings(params);
85
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
86
- })));
87
- // ─── Project-scoped: agent CRUD ──────────────────────────────────────────────
88
- (0, shared_js_1.registerToolSafe)(server, 'list_project_agents', {
89
- title: 'List agents in a project',
90
- description: 'List all AI agents configured for a specific project',
91
- inputSchema: {
92
- projectUuid: zod_1.z.string().describe('Project UUID'),
93
- },
94
- annotations: shared_js_1.READ_ONLY_DEFAULT,
95
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid }) {
96
- const result = yield c.v1.aiAgents.listAgents(projectUuid);
97
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
98
- })));
99
- (0, shared_js_1.registerToolSafe)(server, 'get_project_agent', {
100
- title: 'Get agent',
101
- description: 'Get details of a specific AI agent in a project',
102
- inputSchema: {
103
- projectUuid: zod_1.z.string().describe('Project UUID'),
104
- agentUuid: zod_1.z.string().describe('Agent UUID'),
105
- },
106
- annotations: shared_js_1.READ_ONLY_DEFAULT,
107
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid }) {
108
- const result = yield c.v1.aiAgents.getAgent(projectUuid, agentUuid);
109
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
110
- })));
111
- (0, shared_js_1.registerToolSafe)(server, 'create_project_agent', {
112
- title: 'Create agent',
113
- description: 'Create a new AI agent in a project',
114
- inputSchema: {
115
- projectUuid: zod_1.z.string().describe('Project UUID'),
116
- name: zod_1.z.string().describe('Agent name'),
117
- description: zod_1.z.string().optional().describe('Agent description'),
118
- instruction: zod_1.z.string().optional().describe('System instruction for the agent'),
119
- },
120
- annotations: shared_js_1.WRITE_IDEMPOTENT,
121
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, name, description, instruction, }) {
122
- const body = Object.assign(Object.assign({ name,
123
- projectUuid }, (description != null ? { description } : {})), (instruction != null ? { instruction } : {}));
124
- const result = yield c.v1.aiAgents.createAgent(projectUuid, body);
125
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
126
- })));
127
- (0, shared_js_1.registerToolSafe)(server, 'update_project_agent', {
128
- title: 'Update agent',
129
- description: 'Update an existing AI agent',
130
- inputSchema: {
131
- projectUuid: zod_1.z.string().describe('Project UUID'),
132
- agentUuid: zod_1.z.string().describe('Agent UUID'),
133
- name: zod_1.z.string().optional().describe('New name'),
134
- description: zod_1.z.string().optional().describe('New description'),
135
- instruction: zod_1.z.string().optional().describe('New system instruction'),
136
- },
137
- annotations: shared_js_1.WRITE_IDEMPOTENT,
138
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, void 0, void 0, function* () {
139
- var { projectUuid, agentUuid } = _a, body = __rest(_a, ["projectUuid", "agentUuid"]);
140
- const result = yield c.v1.aiAgents.updateAgent(projectUuid, agentUuid, body);
141
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
142
- })));
143
- (0, shared_js_1.registerToolSafe)(server, 'delete_project_agent', {
144
- title: 'Delete agent',
145
- description: 'Delete an AI agent from a project',
146
- inputSchema: {
147
- projectUuid: zod_1.z.string().describe('Project UUID'),
148
- agentUuid: zod_1.z.string().describe('Agent UUID'),
149
- },
150
- annotations: shared_js_1.WRITE_DESTRUCTIVE,
151
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid }) {
152
- yield c.v1.aiAgents.deleteAgent(projectUuid, agentUuid);
153
- return {
154
- content: [{ type: 'text', text: `Agent ${agentUuid} deleted successfully` }],
155
- };
156
- })));
157
- // ─── Project-scoped: threads ─────────────────────────────────────────────────
158
- (0, shared_js_1.registerToolSafe)(server, 'list_agent_threads', {
159
- title: 'List agent threads',
160
- description: 'List all conversation threads for an agent',
161
- inputSchema: {
162
- projectUuid: zod_1.z.string().describe('Project UUID'),
163
- agentUuid: zod_1.z.string().describe('Agent UUID'),
164
- },
165
- annotations: shared_js_1.READ_ONLY_DEFAULT,
166
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid }) {
167
- const result = yield c.v1.aiAgents.listAgentThreads(projectUuid, agentUuid);
168
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
169
- })));
170
- (0, shared_js_1.registerToolSafe)(server, 'get_agent_thread', {
171
- title: 'Get agent thread',
172
- description: 'Get a conversation thread with all its messages',
173
- inputSchema: {
174
- projectUuid: zod_1.z.string().describe('Project UUID'),
175
- agentUuid: zod_1.z.string().describe('Agent UUID'),
176
- threadUuid: zod_1.z.string().describe('Thread UUID'),
177
- },
178
- annotations: shared_js_1.READ_ONLY_DEFAULT,
179
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid, threadUuid, }) {
180
- const result = yield c.v1.aiAgents.getAgentThread(projectUuid, agentUuid, threadUuid);
181
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
182
- })));
183
- (0, shared_js_1.registerToolSafe)(server, 'generate_agent_message', {
184
- title: 'Generate agent message',
185
- description: 'Start a new conversation thread and generate the first agent response for a given prompt',
186
- inputSchema: {
187
- projectUuid: zod_1.z.string().describe('Project UUID'),
188
- agentUuid: zod_1.z.string().describe('Agent UUID'),
189
- prompt: zod_1.z.string().describe('User prompt to send to the agent'),
190
- },
191
- annotations: shared_js_1.WRITE_IDEMPOTENT,
192
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid, prompt, }) {
193
- const thread = yield c.v1.aiAgents.createAgentThread(projectUuid, agentUuid);
194
- const result = yield c.v1.aiAgents.generateAgentThreadResponse(projectUuid, agentUuid, thread.uuid, { prompt });
195
- return {
196
- content: [
197
- {
198
- type: 'text',
199
- text: JSON.stringify(Object.assign({ threadUuid: thread.uuid }, result), null, 2),
200
- },
201
- ],
202
- };
203
- })));
204
- (0, shared_js_1.registerToolSafe)(server, 'continue_agent_thread', {
205
- title: 'Continue agent thread',
206
- description: 'Continue an existing conversation thread with a new prompt',
207
- inputSchema: {
208
- projectUuid: zod_1.z.string().describe('Project UUID'),
209
- agentUuid: zod_1.z.string().describe('Agent UUID'),
210
- threadUuid: zod_1.z.string().describe('Thread UUID to continue'),
211
- prompt: zod_1.z.string().describe('Follow-up prompt'),
212
- },
213
- annotations: shared_js_1.WRITE_IDEMPOTENT,
214
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid, threadUuid, prompt, }) {
215
- const result = yield c.v1.aiAgents.generateAgentThreadResponse(projectUuid, agentUuid, threadUuid, { prompt });
216
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
217
- })));
218
- // ─── Project-scoped: evaluations ─────────────────────────────────────────────
219
- (0, shared_js_1.registerToolSafe)(server, 'list_agent_evaluations', {
220
- title: 'List agent evaluations',
221
- description: 'List all evaluations for an agent',
222
- inputSchema: {
223
- projectUuid: zod_1.z.string().describe('Project UUID'),
224
- agentUuid: zod_1.z.string().describe('Agent UUID'),
225
- },
226
- annotations: shared_js_1.READ_ONLY_DEFAULT,
227
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid }) {
228
- const result = yield c.v1.aiAgents.listEvaluations(projectUuid, agentUuid);
229
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
230
- })));
231
- (0, shared_js_1.registerToolSafe)(server, 'get_agent_evaluation', {
232
- title: 'Get agent evaluation',
233
- description: 'Get a full evaluation including its test prompts',
234
- inputSchema: {
235
- projectUuid: zod_1.z.string().describe('Project UUID'),
236
- agentUuid: zod_1.z.string().describe('Agent UUID'),
237
- evalUuid: zod_1.z.string().describe('Evaluation UUID'),
238
- },
239
- annotations: shared_js_1.READ_ONLY_DEFAULT,
240
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid, evalUuid, }) {
241
- const result = yield c.v1.aiAgents.getEvaluation(projectUuid, agentUuid, evalUuid);
242
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
243
- })));
244
- (0, shared_js_1.registerToolSafe)(server, 'create_agent_evaluation', {
245
- title: 'Create agent evaluation',
246
- description: 'Create a new evaluation test suite for an agent with a title and optional prompts',
247
- inputSchema: {
248
- projectUuid: zod_1.z.string().describe('Project UUID'),
249
- agentUuid: zod_1.z.string().describe('Agent UUID'),
250
- title: zod_1.z.string().describe('Evaluation title'),
251
- description: zod_1.z.string().optional().describe('Evaluation description'),
252
- prompts: zod_1.z
253
- .array(zod_1.z.union([
254
- zod_1.z.object({
255
- prompt: zod_1.z.string().describe('Test prompt text'),
256
- expectedResponse: zod_1.z.string().nullable().describe('Expected response (optional)'),
257
- }),
258
- zod_1.z.object({
259
- threadUuid: zod_1.z.string().describe('Existing thread UUID'),
260
- promptUuid: zod_1.z.string().describe('Existing prompt UUID within the thread'),
261
- expectedResponse: zod_1.z.string().nullable().describe('Expected response (optional)'),
262
- }),
263
- ]))
264
- .optional()
265
- .describe('Test prompts for the evaluation'),
266
- },
267
- annotations: shared_js_1.WRITE_IDEMPOTENT,
268
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid, title, description, prompts, }) {
269
- const body = Object.assign({ title, prompts: prompts !== null && prompts !== void 0 ? prompts : [] }, (description != null ? { description } : {}));
270
- const result = yield c.v1.aiAgents.createEvaluation(projectUuid, agentUuid, body);
271
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
272
- })));
273
- (0, shared_js_1.registerToolSafe)(server, 'update_agent_evaluation', {
274
- title: 'Update agent evaluation',
275
- description: 'Update an evaluation title, description, or replace its prompts',
276
- inputSchema: {
277
- projectUuid: zod_1.z.string().describe('Project UUID'),
278
- agentUuid: zod_1.z.string().describe('Agent UUID'),
279
- evalUuid: zod_1.z.string().describe('Evaluation UUID'),
280
- title: zod_1.z.string().optional().describe('New title'),
281
- description: zod_1.z.string().optional().describe('New description'),
282
- prompts: zod_1.z
283
- .array(zod_1.z.union([
284
- zod_1.z.object({
285
- prompt: zod_1.z.string().describe('Test prompt text'),
286
- expectedResponse: zod_1.z.string().nullable().describe('Expected response (optional)'),
287
- }),
288
- zod_1.z.object({
289
- threadUuid: zod_1.z.string().describe('Existing thread UUID'),
290
- promptUuid: zod_1.z.string().describe('Existing prompt UUID within the thread'),
291
- expectedResponse: zod_1.z.string().nullable().describe('Expected response (optional)'),
292
- }),
293
- ]))
294
- .optional()
295
- .describe('Replacement prompt list (omit to leave unchanged)'),
296
- },
297
- annotations: shared_js_1.WRITE_IDEMPOTENT,
298
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, void 0, void 0, function* () {
299
- var { projectUuid, agentUuid, evalUuid } = _a, body = __rest(_a, ["projectUuid", "agentUuid", "evalUuid"]);
300
- const result = yield c.v1.aiAgents.updateEvaluation(projectUuid, agentUuid, evalUuid, body);
301
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
302
- })));
303
- (0, shared_js_1.registerToolSafe)(server, 'append_agent_evaluation_prompts', {
304
- title: 'Append evaluation prompts',
305
- description: 'Append additional prompts to an existing evaluation without replacing existing ones',
306
- inputSchema: {
307
- projectUuid: zod_1.z.string().describe('Project UUID'),
308
- agentUuid: zod_1.z.string().describe('Agent UUID'),
309
- evalUuid: zod_1.z.string().describe('Evaluation UUID'),
310
- prompts: zod_1.z
311
- .array(zod_1.z.union([
312
- zod_1.z.object({
313
- prompt: zod_1.z.string().describe('Test prompt text'),
314
- expectedResponse: zod_1.z.string().nullable().describe('Expected response (optional)'),
315
- }),
316
- zod_1.z.object({
317
- threadUuid: zod_1.z.string().describe('Existing thread UUID'),
318
- promptUuid: zod_1.z.string().describe('Existing prompt UUID within the thread'),
319
- expectedResponse: zod_1.z.string().nullable().describe('Expected response (optional)'),
320
- }),
321
- ]))
322
- .describe('Prompts to append'),
323
- },
324
- annotations: shared_js_1.WRITE_IDEMPOTENT,
325
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid, evalUuid, prompts, }) {
326
- yield c.v1.aiAgents.appendToEvaluation(projectUuid, agentUuid, evalUuid, { prompts });
327
- return {
328
- content: [
329
- { type: 'text', text: `Prompts appended to evaluation ${evalUuid} successfully` },
330
- ],
331
- };
332
- })));
333
- (0, shared_js_1.registerToolSafe)(server, 'run_agent_evaluation', {
334
- title: 'Run agent evaluation',
335
- description: 'Trigger a new evaluation run for an agent. Returns the run UUID and status.',
336
- inputSchema: {
337
- projectUuid: zod_1.z.string().describe('Project UUID'),
338
- agentUuid: zod_1.z.string().describe('Agent UUID'),
339
- evalUuid: zod_1.z.string().describe('Evaluation UUID to run'),
340
- },
341
- annotations: shared_js_1.WRITE_IDEMPOTENT,
342
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid, evalUuid, }) {
343
- const result = yield c.v1.aiAgents.runEvaluation(projectUuid, agentUuid, evalUuid);
344
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
345
- })));
346
- (0, shared_js_1.registerToolSafe)(server, 'list_agent_evaluation_runs', {
347
- title: 'List evaluation runs',
348
- description: 'List all runs for an evaluation with their status and pass/fail counts',
349
- inputSchema: {
350
- projectUuid: zod_1.z.string().describe('Project UUID'),
351
- agentUuid: zod_1.z.string().describe('Agent UUID'),
352
- evalUuid: zod_1.z.string().describe('Evaluation UUID'),
353
- },
354
- annotations: shared_js_1.READ_ONLY_DEFAULT,
355
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid, evalUuid, }) {
356
- const result = yield c.v1.aiAgents.listEvaluationRuns(projectUuid, agentUuid, evalUuid);
357
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
358
- })));
359
- (0, shared_js_1.registerToolSafe)(server, 'get_agent_evaluation_run_results', {
360
- title: 'Get evaluation run results',
361
- description: 'Get detailed per-prompt results for a specific evaluation run, including pass/fail and assessments',
362
- inputSchema: {
363
- projectUuid: zod_1.z.string().describe('Project UUID'),
364
- agentUuid: zod_1.z.string().describe('Agent UUID'),
365
- evalUuid: zod_1.z.string().describe('Evaluation UUID'),
366
- runUuid: zod_1.z.string().describe('Run UUID'),
367
- },
368
- annotations: shared_js_1.READ_ONLY_DEFAULT,
369
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid, evalUuid, runUuid, }) {
370
- const result = yield c.v1.aiAgents.getEvaluationRunResults(projectUuid, agentUuid, evalUuid, runUuid);
371
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
372
- })));
373
- (0, shared_js_1.registerToolSafe)(server, 'delete_agent_evaluation', {
374
- title: 'Delete agent evaluation',
375
- description: 'Delete an evaluation and all its runs',
376
- inputSchema: {
377
- projectUuid: zod_1.z.string().describe('Project UUID'),
378
- agentUuid: zod_1.z.string().describe('Agent UUID'),
379
- evalUuid: zod_1.z.string().describe('Evaluation UUID'),
380
- },
381
- annotations: shared_js_1.WRITE_DESTRUCTIVE,
382
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, agentUuid, evalUuid, }) {
383
- yield c.v1.aiAgents.deleteEvaluation(projectUuid, agentUuid, evalUuid);
384
- return {
385
- content: [{ type: 'text', text: `Evaluation ${evalUuid} deleted successfully` }],
386
- };
387
- })));
388
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * MCP tools: charts (list, charts-as-code list and upsert).
3
- */
4
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
- import type { LightdashClient } from '@lightdash-tools/client';
6
- export declare function registerChartTools(server: McpServer, client: LightdashClient): void;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- /**
3
- * MCP tools: charts (list, charts-as-code list and upsert).
4
- */
5
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
- return new (P || (P = Promise))(function (resolve, reject) {
8
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
- step((generator = generator.apply(thisArg, _arguments || [])).next());
12
- });
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.registerChartTools = registerChartTools;
16
- const zod_1 = require("zod");
17
- const shared_js_1 = require("./shared.js");
18
- function registerChartTools(server, client) {
19
- (0, shared_js_1.registerToolSafe)(server, 'list_charts', {
20
- title: 'List charts',
21
- description: 'List charts in a project',
22
- inputSchema: { projectUuid: zod_1.z.string().describe('Project UUID') },
23
- annotations: shared_js_1.READ_ONLY_DEFAULT,
24
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid }) {
25
- const charts = yield c.v1.charts.listCharts(projectUuid);
26
- return { content: [{ type: 'text', text: JSON.stringify(charts, null, 2) }] };
27
- })));
28
- (0, shared_js_1.registerToolSafe)(server, 'list_charts_as_code', {
29
- title: 'List charts as code',
30
- description: 'Get charts in code representation for a project (for charts-as-code workflows)',
31
- inputSchema: {
32
- projectUuid: zod_1.z.string().describe('Project UUID'),
33
- ids: zod_1.z.array(zod_1.z.string()).optional().describe('Optional chart IDs (slugs) to filter'),
34
- },
35
- annotations: shared_js_1.READ_ONLY_DEFAULT,
36
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, ids }) {
37
- const result = yield c.v1.charts.getChartsAsCode(projectUuid, { ids });
38
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
39
- })));
40
- (0, shared_js_1.registerToolSafe)(server, 'upsert_chart_as_code', {
41
- title: 'Upsert chart as code',
42
- description: 'Create or update a chart from its code representation (by slug)',
43
- inputSchema: {
44
- projectUuid: zod_1.z.string().describe('Project UUID'),
45
- slug: zod_1.z.string().describe('Chart slug'),
46
- chart: zod_1.z
47
- .record(zod_1.z.string(), zod_1.z.unknown())
48
- .describe('Chart-as-code payload (name, metricQuery, chartConfig, etc.)'),
49
- },
50
- annotations: shared_js_1.WRITE_IDEMPOTENT,
51
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, slug, chart, }) {
52
- const result = yield c.v1.charts.upsertChartAsCode(projectUuid, slug, chart);
53
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
54
- })));
55
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * MCP tools: content (search).
3
- */
4
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
- import type { LightdashClient } from '@lightdash-tools/client';
6
- export declare function registerContentTools(server: McpServer, client: LightdashClient): void;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- /**
3
- * MCP tools: content (search).
4
- */
5
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
- return new (P || (P = Promise))(function (resolve, reject) {
8
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
- step((generator = generator.apply(thisArg, _arguments || [])).next());
12
- });
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.registerContentTools = registerContentTools;
16
- const zod_1 = require("zod");
17
- const shared_js_1 = require("./shared.js");
18
- function registerContentTools(server, client) {
19
- (0, shared_js_1.registerToolSafe)(server, 'search_content', {
20
- title: 'Search content',
21
- description: 'Search for charts, dashboards, and spaces across projects',
22
- inputSchema: {
23
- search: zod_1.z.string().describe('Search query'),
24
- projectUuids: zod_1.z.array(zod_1.z.string()).optional().describe('Optional project UUIDs to filter'),
25
- contentTypes: zod_1.z
26
- .array(zod_1.z.enum(['chart', 'dashboard', 'space']))
27
- .optional()
28
- .describe('Optional content types to filter'),
29
- page: zod_1.z.number().optional().describe('Page number'),
30
- pageSize: zod_1.z.number().optional().describe('Page size'),
31
- },
32
- annotations: shared_js_1.READ_ONLY_DEFAULT,
33
- }, (0, shared_js_1.wrapTool)(client, (c) => (params) => __awaiter(this, void 0, void 0, function* () {
34
- const result = yield c.v2.content.searchContent(params);
35
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
36
- })));
37
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * MCP tools: dashboards (list).
3
- */
4
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
- import type { LightdashClient } from '@lightdash-tools/client';
6
- export declare function registerDashboardTools(server: McpServer, client: LightdashClient): void;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- /**
3
- * MCP tools: dashboards (list).
4
- */
5
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
- return new (P || (P = Promise))(function (resolve, reject) {
8
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
- step((generator = generator.apply(thisArg, _arguments || [])).next());
12
- });
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.registerDashboardTools = registerDashboardTools;
16
- const zod_1 = require("zod");
17
- const shared_js_1 = require("./shared.js");
18
- function registerDashboardTools(server, client) {
19
- (0, shared_js_1.registerToolSafe)(server, 'list_dashboards', {
20
- title: 'List dashboards',
21
- description: 'List dashboards in a project',
22
- inputSchema: { projectUuid: zod_1.z.string().describe('Project UUID') },
23
- annotations: shared_js_1.READ_ONLY_DEFAULT,
24
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid }) {
25
- const dashboards = yield c.v1.dashboards.listDashboards(projectUuid);
26
- return { content: [{ type: 'text', text: JSON.stringify(dashboards, null, 2) }] };
27
- })));
28
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * MCP tools: explores (list, get).
3
- */
4
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
- import type { LightdashClient } from '@lightdash-tools/client';
6
- export declare function registerExploresTools(server: McpServer, client: LightdashClient): void;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- /**
3
- * MCP tools: explores (list, get).
4
- */
5
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
- return new (P || (P = Promise))(function (resolve, reject) {
8
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
- step((generator = generator.apply(thisArg, _arguments || [])).next());
12
- });
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.registerExploresTools = registerExploresTools;
16
- const zod_1 = require("zod");
17
- const shared_js_1 = require("./shared.js");
18
- function registerExploresTools(server, client) {
19
- (0, shared_js_1.registerToolSafe)(server, 'list_explores', {
20
- title: 'List explores',
21
- description: 'List all explores in a project',
22
- inputSchema: { projectUuid: zod_1.z.string().describe('Project UUID') },
23
- annotations: shared_js_1.READ_ONLY_DEFAULT,
24
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid }) {
25
- const explores = yield c.v1.explores.listExplores(projectUuid);
26
- return { content: [{ type: 'text', text: JSON.stringify(explores, null, 2) }] };
27
- })));
28
- (0, shared_js_1.registerToolSafe)(server, 'get_explore', {
29
- title: 'Get explore',
30
- description: 'Get an explore by project UUID and explore ID (includes tables, dimensions, and metrics)',
31
- inputSchema: {
32
- projectUuid: zod_1.z.string().describe('Project UUID'),
33
- exploreId: zod_1.z.string().describe('Explore ID'),
34
- },
35
- annotations: shared_js_1.READ_ONLY_DEFAULT,
36
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, exploreId }) {
37
- const explore = yield c.v1.explores.getExplore(projectUuid, exploreId);
38
- return { content: [{ type: 'text', text: JSON.stringify(explore, null, 2) }] };
39
- })));
40
- (0, shared_js_1.registerToolSafe)(server, 'list_dimensions', {
41
- title: 'List dimensions',
42
- description: 'List all dimensions for a specific explore',
43
- inputSchema: {
44
- projectUuid: zod_1.z.string().describe('Project UUID'),
45
- exploreId: zod_1.z.string().describe('Explore ID'),
46
- },
47
- annotations: shared_js_1.READ_ONLY_DEFAULT,
48
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, exploreId }) {
49
- const result = yield c.v1.explores.listDimensions(projectUuid, exploreId);
50
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
51
- })));
52
- (0, shared_js_1.registerToolSafe)(server, 'get_field_lineage', {
53
- title: 'Get field lineage',
54
- description: 'Get upstream lineage for a specific field in an explore',
55
- inputSchema: {
56
- projectUuid: zod_1.z.string().describe('Project UUID'),
57
- exploreId: zod_1.z.string().describe('Explore ID'),
58
- fieldId: zod_1.z.string().describe('Field ID'),
59
- },
60
- annotations: shared_js_1.READ_ONLY_DEFAULT,
61
- }, (0, shared_js_1.wrapTool)(client, (c) => (_a) => __awaiter(this, [_a], void 0, function* ({ projectUuid, exploreId, fieldId, }) {
62
- const result = yield c.v1.explores.getFieldLineage(projectUuid, exploreId, fieldId);
63
- return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
64
- })));
65
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * MCP tools: groups (list, get).
3
- */
4
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
- import type { LightdashClient } from '@lightdash-tools/client';
6
- export declare function registerGroupTools(server: McpServer, client: LightdashClient): void;