@owox/backend 0.36.0 → 0.38.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.
- package/dist/src/common/search/search.facade.d.ts +1 -0
- package/dist/src/data-marts/controllers/spec/data-mart.api.js +5 -5
- package/dist/src/data-marts/data-destination-types/ee/email/services/email-credentials-validator.js +1 -3
- package/dist/src/data-marts/data-destination-types/ee/google-chat/services/google-chat-credentials-validator.js +1 -3
- package/dist/src/data-marts/data-destination-types/google-sheets/services/google-sheets-credentials-validator.js +1 -3
- package/dist/src/data-marts/data-destination-types/google-sheets/services/google-sheets-report-writer.d.ts +1 -0
- package/dist/src/data-marts/data-destination-types/google-sheets/services/google-sheets-report-writer.js +13 -1
- package/dist/src/data-marts/data-destination-types/interfaces/data-destination-credentials-validator.interface.d.ts +2 -0
- package/dist/src/data-marts/data-destination-types/interfaces/data-destination-credentials-validator.interface.js +7 -0
- package/dist/src/data-marts/data-destination-types/looker-studio-connector/services/looker-studio-connector-credentials-validator.js +1 -3
- package/dist/src/data-marts/data-marts.module.js +4 -0
- package/dist/src/data-marts/data-storage-types/athena/adapters/athena-api.adapter.js +2 -1
- package/dist/src/data-marts/data-storage-types/athena/adapters/s3-api.adapter.js +5 -3
- package/dist/src/data-marts/data-storage-types/athena/services/athena-access.validator.js +2 -4
- package/dist/src/data-marts/data-storage-types/athena/utils/athena-output-location.util.d.ts +5 -0
- package/dist/src/data-marts/data-storage-types/athena/utils/athena-output-location.util.js +13 -0
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-access.validator.js +2 -4
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-resource-location.util.d.ts +3 -0
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-resource-location.util.js +18 -0
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-sharded-tables.util.d.ts +1 -0
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-sharded-tables.util.js +4 -1
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-storage-resource-browser.service.js +12 -5
- package/dist/src/data-marts/data-storage-types/databricks/services/databricks-access.validator.js +2 -4
- package/dist/src/data-marts/data-storage-types/interfaces/data-storage-access-validator.interface.d.ts +3 -0
- package/dist/src/data-marts/data-storage-types/interfaces/data-storage-access-validator.interface.js +7 -0
- package/dist/src/data-marts/data-storage-types/interfaces/storage-resource-browser.interface.d.ts +2 -0
- package/dist/src/data-marts/data-storage-types/redshift/services/redshift-access.validator.js +2 -6
- package/dist/src/data-marts/data-storage-types/snowflake/services/snowflake-access.validator.js +2 -4
- package/dist/src/data-marts/dto/domain/create-data-mart.command.d.ts +3 -3
- package/dist/src/data-marts/dto/domain/data-mart-list-item.dto.d.ts +3 -3
- package/dist/src/data-marts/dto/domain/data-mart.dto.d.ts +3 -3
- package/dist/src/data-marts/dto/domain/list-data-marts.command.d.ts +2 -1
- package/dist/src/data-marts/dto/domain/list-data-marts.command.js +3 -1
- package/dist/src/data-marts/dto/domain/model-canvas.dto.d.ts +2 -2
- package/dist/src/data-marts/dto/domain/update-data-mart-icon.command.d.ts +3 -3
- package/dist/src/data-marts/dto/presentation/create-data-mart-request-api.dto.d.ts +2 -2
- package/dist/src/data-marts/dto/presentation/create-data-mart-request-api.dto.js +6 -3
- package/dist/src/data-marts/dto/presentation/custom-connector-response.dto.js +1 -1
- package/dist/src/data-marts/dto/presentation/data-mart-list-item-response-api.dto.d.ts +2 -2
- package/dist/src/data-marts/dto/presentation/data-mart-list-item-response-api.dto.js +3 -2
- package/dist/src/data-marts/dto/presentation/data-mart-response-api.dto.d.ts +2 -2
- package/dist/src/data-marts/dto/presentation/data-mart-response-api.dto.js +3 -2
- package/dist/src/data-marts/dto/presentation/list-data-marts-query-api.dto.js +1 -1
- package/dist/src/data-marts/dto/presentation/model-canvas-response-api.dto.d.ts +2 -2
- package/dist/src/data-marts/dto/presentation/model-canvas-response-api.dto.js +3 -2
- package/dist/src/data-marts/dto/presentation/sql-dry-run-request-api.dto.js +3 -0
- package/dist/src/data-marts/dto/presentation/storage-resources/list-storage-resources-response.dto.d.ts +2 -0
- package/dist/src/data-marts/dto/presentation/storage-resources/list-storage-resources-response.dto.js +17 -0
- package/dist/src/data-marts/dto/presentation/update-data-mart-icon-api.dto.d.ts +2 -2
- package/dist/src/data-marts/dto/presentation/update-data-mart-icon-api.dto.js +6 -3
- package/dist/src/data-marts/entities/data-mart.entity.d.ts +2 -2
- package/dist/src/data-marts/enums/data-mart-icon.enum.d.ts +6 -0
- package/dist/src/data-marts/enums/data-mart-icon.enum.js +6 -1
- package/dist/src/data-marts/errors/google-sheets-api-call.error.d.ts +6 -0
- package/dist/src/data-marts/errors/google-sheets-api-call.error.js +34 -0
- package/dist/src/data-marts/facades/mcp-contexts.facade.d.ts +13 -0
- package/dist/src/data-marts/facades/mcp-contexts.facade.impl.d.ts +9 -0
- package/dist/src/data-marts/facades/mcp-contexts.facade.impl.js +35 -0
- package/dist/src/data-marts/facades/mcp-contexts.facade.js +5 -0
- package/dist/src/data-marts/facades/mcp-data-marts.facade.d.ts +9 -0
- package/dist/src/data-marts/facades/mcp-data-marts.facade.impl.js +4 -1
- package/dist/src/data-marts/mappers/context.mapper.d.ts +4 -0
- package/dist/src/data-marts/mappers/context.mapper.js +12 -0
- package/dist/src/data-marts/search/engine/advanced-search.service.js +1 -0
- package/dist/src/data-marts/search/engine/in-memory-paginated.search.js +17 -1
- package/dist/src/data-marts/search/engine/vector-search.port.d.ts +1 -0
- package/dist/src/data-marts/services/connector/connector-definition.service.js +4 -2
- package/dist/src/data-marts/services/connector/connector-test.service.d.ts +1 -0
- package/dist/src/data-marts/services/connector/connector-test.service.js +11 -6
- package/dist/src/data-marts/services/connector/declarative-manifest-schemas.js +2 -2
- package/dist/src/data-marts/services/context/context-access.service.js +2 -2
- package/dist/src/data-marts/services/context/context.service.d.ts +2 -0
- package/dist/src/data-marts/services/context/context.service.js +21 -0
- package/dist/src/data-marts/services/data-mart.service.d.ts +1 -0
- package/dist/src/data-marts/services/data-mart.service.js +3 -0
- package/dist/src/data-marts/services/member-ownership-warnings.service.js +1 -1
- package/dist/src/data-marts/services/report-access.service.js +1 -1
- package/dist/src/data-marts/use-cases/list-data-marts.service.js +1 -0
- package/dist/src/data-marts/use-cases/preview-data-mart.service.js +4 -2
- package/dist/src/data-marts/use-cases/stream-http-data.service.d.ts +0 -1
- package/dist/src/data-marts/use-cases/stream-http-data.service.js +2 -6
- package/dist/src/data-marts/use-cases/update-availability.service.js +2 -2
- package/dist/src/data-marts/use-cases/update-data-mart-definition.service.js +1 -1
- package/dist/src/data-marts/use-cases/update-data-mart-owners.service.js +1 -1
- package/dist/src/data-marts/use-cases/update-data-storage.service.js +9 -9
- package/dist/src/data-marts/utils/field-errors.utils.d.ts +9 -0
- package/dist/src/data-marts/utils/field-errors.utils.js +51 -0
- package/dist/src/ee/mcp/instructions/mcp-system-instructions.d.ts +1 -1
- package/dist/src/ee/mcp/instructions/mcp-system-instructions.js +6 -3
- package/dist/src/ee/mcp/sdk/mcp-output-schema.d.ts +3 -0
- package/dist/src/ee/mcp/sdk/mcp-output-schema.js +53 -0
- package/dist/src/ee/mcp/sdk/mcp-schema-refresh.d.ts +8 -0
- package/dist/src/ee/mcp/sdk/mcp-schema-refresh.js +44 -0
- package/dist/src/ee/mcp/sdk/mcp-sdk-server.factory.d.ts +8 -1
- package/dist/src/ee/mcp/sdk/mcp-sdk-server.factory.js +35 -4
- package/dist/src/ee/mcp/tools/add-report.tool.d.ts +1 -1
- package/dist/src/ee/mcp/tools/add-report.tool.js +2 -2
- package/dist/src/ee/mcp/tools/context-input.d.ts +6 -0
- package/dist/src/ee/mcp/tools/context-input.js +13 -0
- package/dist/src/ee/mcp/tools/create-report-run-schedule.tool.js +1 -1
- package/dist/src/ee/mcp/tools/data-mart-catalog.tool.d.ts +10 -2
- package/dist/src/ee/mcp/tools/data-mart-catalog.tool.js +17 -5
- package/dist/src/ee/mcp/tools/data-mart-details.tool.d.ts +5 -1
- package/dist/src/ee/mcp/tools/data-mart-details.tool.js +4 -1
- package/dist/src/ee/mcp/tools/get-report-output-schema.tool.js +6 -6
- package/dist/src/ee/mcp/tools/list-contexts.tool.d.ts +131 -0
- package/dist/src/ee/mcp/tools/list-contexts.tool.js +50 -0
- package/dist/src/ee/mcp/tools/mcp-getting-started.util.js +2 -2
- package/dist/src/ee/mcp/tools/mcp-tool.providers.js +2 -0
- package/dist/src/ee/mcp/tools/query-data-mart.tool.js +1 -1
- package/dist/src/ee/mcp/tools/run-report.tool.js +1 -1
- package/dist/src/ee/mcp/tools/search-data-marts.tool.d.ts +10 -2
- package/dist/src/ee/mcp/tools/search-data-marts.tool.js +17 -3
- package/dist/src/ee/mcp/tools/update-report-run-schedule.tool.d.ts +1 -1
- package/dist/src/ee/mcp/tools/update-report-run-schedule.tool.js +3 -3
- package/dist/src/ee/mcp/tools/update-report.tool.js +1 -1
- package/dist/src/ee/mcp/transport/mcp-http-entry.service.js +1 -1
- package/dist/src/idp/decorators/auth.decorator.js +1 -1
- package/dist/src/idp/guards/idp.guard.js +1 -1
- package/dist/src/idp/oauth/oauth-project-selection.service.js +1 -1
- package/dist/src/migrations/1790830000000-widen-sql-dry-run-trigger-sql-column.d.ts +6 -0
- package/dist/src/migrations/1790830000000-widen-sql-dry-run-trigger-sql-column.js +21 -0
- package/dist/src/plugin-host/controllers/plugin-gallery.controller.d.ts +5 -1
- package/dist/src/plugin-host/controllers/plugin-gallery.controller.js +25 -1
- package/dist/src/plugin-host/dto/domain/find-plugin-by-repository.command.d.ts +6 -0
- package/dist/src/plugin-host/dto/domain/find-plugin-by-repository.command.js +13 -0
- package/dist/src/plugin-host/dto/presentation/plugin-lookup-api.dto.d.ts +3 -0
- package/dist/src/plugin-host/dto/presentation/plugin-lookup-api.dto.js +22 -0
- package/dist/src/plugin-host/mappers/plugin-presentation.mapper.d.ts +6 -0
- package/dist/src/plugin-host/mappers/plugin-presentation.mapper.js +7 -0
- package/dist/src/plugin-host/plugin-host.module.js +2 -0
- package/dist/src/plugin-host/services/plugin-publication.service.d.ts +2 -0
- package/dist/src/plugin-host/services/plugin-publication.service.js +36 -16
- package/dist/src/plugin-host/use-cases/find-plugin-by-repository.service.d.ts +9 -0
- package/dist/src/plugin-host/use-cases/find-plugin-by-repository.service.js +35 -0
- package/dist/src/plugin-host/use-cases/list-installations.service.d.ts +3 -1
- package/dist/src/plugin-host/use-cases/list-installations.service.js +14 -3
- package/dist/src/plugin-host/utils/github-repo-locator.util.js +1 -1
- package/package.json +4 -4
|
@@ -8,23 +8,30 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var McpSdkServerFactory_1;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.McpSdkServerFactory = void 0;
|
|
13
14
|
const common_1 = require("@nestjs/common");
|
|
14
15
|
const server_1 = require("@modelcontextprotocol/server");
|
|
16
|
+
const internal_helpers_1 = require("@owox/internal-helpers");
|
|
15
17
|
const mcp_config_1 = require("../config/mcp.config");
|
|
16
18
|
const mcp_call_instrumentation_1 = require("../observability/mcp-call-instrumentation");
|
|
17
19
|
const mcp_tool_registry_1 = require("../tools/mcp-tool.registry");
|
|
18
|
-
|
|
20
|
+
const mcp_output_schema_1 = require("./mcp-output-schema");
|
|
21
|
+
const mcp_schema_refresh_1 = require("./mcp-schema-refresh");
|
|
22
|
+
let McpSdkServerFactory = McpSdkServerFactory_1 = class McpSdkServerFactory {
|
|
19
23
|
config;
|
|
20
24
|
toolRegistry;
|
|
21
25
|
instrumentation;
|
|
26
|
+
logger = new common_1.Logger(McpSdkServerFactory_1.name);
|
|
27
|
+
schemaRefresh = new mcp_schema_refresh_1.McpSchemaRefresh();
|
|
28
|
+
outputSchemas = new WeakMap();
|
|
22
29
|
constructor(config, toolRegistry, instrumentation) {
|
|
23
30
|
this.config = config;
|
|
24
31
|
this.toolRegistry = toolRegistry;
|
|
25
32
|
this.instrumentation = instrumentation;
|
|
26
33
|
}
|
|
27
|
-
create(mcpContext, instructions) {
|
|
34
|
+
create(mcpContext, instructions, refreshOptions) {
|
|
28
35
|
const serverInfo = {
|
|
29
36
|
name: this.config.serverName,
|
|
30
37
|
version: this.config.serverVersion,
|
|
@@ -36,17 +43,41 @@ let McpSdkServerFactory = class McpSdkServerFactory {
|
|
|
36
43
|
for (const tool of this.toolRegistry.getTools()) {
|
|
37
44
|
const wrapped = this.instrumentation.wrap(tool.name, async (input, ctx) => {
|
|
38
45
|
this.assertScopes(mcpContext, tool.requiredScopes);
|
|
46
|
+
const notify = refreshOptions?.era === 'modern'
|
|
47
|
+
? refreshOptions.notifyToolsChanged
|
|
48
|
+
: ctx?.mcpReq?.notify
|
|
49
|
+
? () => ctx.mcpReq.notify({ method: 'notifications/tools/list_changed' })
|
|
50
|
+
: undefined;
|
|
51
|
+
if (notify) {
|
|
52
|
+
try {
|
|
53
|
+
await this.schemaRefresh.notifyIfDue(mcpContext, notify, refreshOptions?.era === 'modern');
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
this.logger.warn('MCP schema refresh notification failed', {
|
|
57
|
+
toolName: tool.name,
|
|
58
|
+
message: (0, internal_helpers_1.castError)(error).message,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
39
62
|
return tool.handler(input, mcpContext, ctx?.mcpReq?.signal);
|
|
40
63
|
});
|
|
41
64
|
sdkToolRegistrar.registerTool(tool.name, {
|
|
42
65
|
description: tool.description,
|
|
43
66
|
inputSchema: tool.zodSchema,
|
|
44
|
-
...(tool.outputSchema ? { outputSchema: tool.outputSchema } : {}),
|
|
67
|
+
...(tool.outputSchema ? { outputSchema: this.outputSchema(tool.outputSchema) } : {}),
|
|
45
68
|
...(tool.annotations ? { annotations: tool.annotations } : {}),
|
|
46
69
|
}, wrapped);
|
|
47
70
|
}
|
|
48
71
|
return server;
|
|
49
72
|
}
|
|
73
|
+
outputSchema(shape) {
|
|
74
|
+
const cached = this.outputSchemas.get(shape);
|
|
75
|
+
if (cached)
|
|
76
|
+
return cached;
|
|
77
|
+
const schema = (0, mcp_output_schema_1.makeMcpOutputSchema)(shape);
|
|
78
|
+
this.outputSchemas.set(shape, schema);
|
|
79
|
+
return schema;
|
|
80
|
+
}
|
|
50
81
|
assertScopes(context, requiredScopes) {
|
|
51
82
|
for (const scope of requiredScopes) {
|
|
52
83
|
if (!context.scopes.includes(scope)) {
|
|
@@ -56,7 +87,7 @@ let McpSdkServerFactory = class McpSdkServerFactory {
|
|
|
56
87
|
}
|
|
57
88
|
};
|
|
58
89
|
exports.McpSdkServerFactory = McpSdkServerFactory;
|
|
59
|
-
exports.McpSdkServerFactory = McpSdkServerFactory = __decorate([
|
|
90
|
+
exports.McpSdkServerFactory = McpSdkServerFactory = McpSdkServerFactory_1 = __decorate([
|
|
60
91
|
(0, common_1.Injectable)(),
|
|
61
92
|
__metadata("design:paramtypes", [mcp_config_1.McpConfigService,
|
|
62
93
|
mcp_tool_registry_1.McpToolRegistry,
|
|
@@ -69,7 +69,7 @@ export declare class AddReportTool implements McpToolDefinition<AddReportInput>
|
|
|
69
69
|
private readonly reports;
|
|
70
70
|
private readonly publicOriginService;
|
|
71
71
|
readonly name = "add_report";
|
|
72
|
-
readonly description = "Create
|
|
72
|
+
readonly description = "Create an OWOX report that exports a data mart to an existing destination (create one with add_destination if the project has none \u2014 check list_destinations first). Use when the user wants a refreshable export or delivery to Google Sheets, email, Slack, Microsoft Teams, Google Chat, or Looker Studio. Create one report per user request, then change it with update_report when the user asks to add a filter, sort, aggregation, or rename it \u2014 do not create another report for the same data: the tool refuses a report whose fields duplicate one you already created on this data mart and destination (error_code similar_report_exists). For push destinations, the new report runs immediately by default: this starts one billed Report Run and delivers data, then initial_run returns the run_id to poll with get_report_run_status. Set run_immediately=false only when the user explicitly wants to create configuration without delivering data, such as before adding a schedule. Every destination type accepts the same optional output controls as query_data_mart \u2014 filters, slices, aggregations, date_buckets, sort \u2014 applied on each run: when the user asks to export numbers they saw in a query, copy those parameters verbatim from that query so the report matches what they saw. Google Sheets: a new Google Sheet is created automatically (an external Google Drive side effect) with its file and sheet named after `name`, and linked to the report; pass spreadsheet_id to add the report as a sheet of an existing spreadsheet instead, so several related exports share one document. Looker Studio is pull-based, never runs through this tool, and accepts no name; omit run_immediately or set it false. Email, Slack, Microsoft Teams, Google Chat: requires message; the default initial run sends it to the configured recipients or channels.";
|
|
73
73
|
readonly zodSchema: {
|
|
74
74
|
data_mart_id: z.ZodString;
|
|
75
75
|
destination_id: z.ZodString;
|
|
@@ -136,7 +136,7 @@ let AddReportTool = class AddReportTool {
|
|
|
136
136
|
reports;
|
|
137
137
|
publicOriginService;
|
|
138
138
|
name = 'add_report';
|
|
139
|
-
description = 'Create
|
|
139
|
+
description = 'Create an OWOX report that exports a data mart to an existing destination (create one with add_destination if the project has none — check list_destinations first). Use when the user wants a refreshable export or delivery to Google Sheets, email, Slack, Microsoft Teams, Google Chat, or Looker Studio. Create one report per user request, then change it with update_report when the user asks to add a filter, sort, aggregation, or rename it — do not create another report for the same data: the tool refuses a report whose fields duplicate one you already created on this data mart and destination (error_code similar_report_exists). For push destinations, the new report runs immediately by default: this starts one billed Report Run and delivers data, then initial_run returns the run_id to poll with get_report_run_status. Set run_immediately=false only when the user explicitly wants to create configuration without delivering data, such as before adding a schedule. Every destination type accepts the same optional output controls as query_data_mart — filters, slices, aggregations, date_buckets, sort — applied on each run: when the user asks to export numbers they saw in a query, copy those parameters verbatim from that query so the report matches what they saw. Google Sheets: a new Google Sheet is created automatically (an external Google Drive side effect) with its file and sheet named after `name`, and linked to the report; pass spreadsheet_id to add the report as a sheet of an existing spreadsheet instead, so several related exports share one document. Looker Studio is pull-based, never runs through this tool, and accepts no name; omit run_immediately or set it false. Email, Slack, Microsoft Teams, Google Chat: requires message; the default initial run sends it to the configured recipients or channels.';
|
|
140
140
|
zodSchema = exports.addReportInputSchema.shape;
|
|
141
141
|
outputSchema = {
|
|
142
142
|
report_id: zod_v4_1.z.string(),
|
|
@@ -168,7 +168,7 @@ let AddReportTool = class AddReportTool {
|
|
|
168
168
|
annotations = {
|
|
169
169
|
title: 'Add Report',
|
|
170
170
|
readOnlyHint: false,
|
|
171
|
-
destructiveHint:
|
|
171
|
+
destructiveHint: true,
|
|
172
172
|
openWorldHint: true,
|
|
173
173
|
};
|
|
174
174
|
requiredScopes = ['mcp:write'];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod-v4';
|
|
2
|
+
export declare const contextIdsSchema: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
|
|
3
|
+
export declare const makeContextSummariesSchema: () => z.ZodArray<z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
}, z.core.$strip>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeContextSummariesSchema = exports.contextIdsSchema = void 0;
|
|
4
|
+
const zod_v4_1 = require("zod-v4");
|
|
5
|
+
exports.contextIdsSchema = zod_v4_1.z
|
|
6
|
+
.array(zod_v4_1.z.string().trim().min(1))
|
|
7
|
+
.max(100)
|
|
8
|
+
.optional()
|
|
9
|
+
.transform(ids => (ids?.length ? [...new Set(ids)] : undefined))
|
|
10
|
+
.describe('Optional context IDs from list_contexts in the connected project. Match any selected context. Omit or pass [] for no filter; existing resource access controls always apply.');
|
|
11
|
+
const makeContextSummariesSchema = () => zod_v4_1.z.array(zod_v4_1.z.object({ id: zod_v4_1.z.string(), name: zod_v4_1.z.string() }));
|
|
12
|
+
exports.makeContextSummariesSchema = makeContextSummariesSchema;
|
|
13
|
+
//# sourceMappingURL=context-input.js.map
|
|
@@ -48,7 +48,7 @@ let CreateReportRunScheduleTool = class CreateReportRunScheduleTool {
|
|
|
48
48
|
title: 'Create Report Run Schedule',
|
|
49
49
|
readOnlyHint: false,
|
|
50
50
|
destructiveHint: false,
|
|
51
|
-
openWorldHint:
|
|
51
|
+
openWorldHint: true,
|
|
52
52
|
};
|
|
53
53
|
requiredScopes = ['mcp:read', 'mcp:write'];
|
|
54
54
|
constructor(facade, publicOriginService) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type McpContextsFacade } from '../../../data-marts/facades/mcp-contexts.facade';
|
|
1
2
|
import { z } from 'zod-v4';
|
|
2
3
|
import type { McpScope } from '@owox/idp-protocol';
|
|
3
4
|
import { PublicOriginService } from '../../../common/config/public-origin.service';
|
|
@@ -6,6 +7,7 @@ import { type McpDataMartsFacade } from '../../../data-marts/facades/mcp-data-ma
|
|
|
6
7
|
import type { McpAuthContext } from '../auth/mcp-auth-context';
|
|
7
8
|
import { type McpToolDefinition, type McpToolResult } from './mcp-tool.definition';
|
|
8
9
|
declare const inputSchema: z.ZodObject<{
|
|
10
|
+
context_ids: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
|
|
9
11
|
status: z.ZodOptional<z.ZodEnum<{
|
|
10
12
|
draft: "draft";
|
|
11
13
|
published: "published";
|
|
@@ -16,9 +18,11 @@ export declare class ListDataMartsTool implements McpToolDefinition<ListDataMart
|
|
|
16
18
|
private readonly dataMarts;
|
|
17
19
|
private readonly publicOriginService;
|
|
18
20
|
private readonly projectContext;
|
|
21
|
+
private readonly contexts;
|
|
19
22
|
readonly name = "list_data_marts";
|
|
20
|
-
readonly description = "List data marts available to the current OWOX project member. Defaults to published data marts; use status=draft only to browse draft metadata, because other MCP data-mart tools accept published data marts only. Use only when the user explicitly asks to list or browse data marts; for a concrete analytical question use get_relevant_data_marts_by_prompt instead, and for open-ended orientation use summarize_data_catalog.";
|
|
23
|
+
readonly description = "List data marts available to the current OWOX project member. Defaults to published data marts; use status=draft only to browse draft metadata, because other MCP data-mart tools accept published data marts only. Use only when the user explicitly asks to list or browse data marts; for a concrete analytical question use get_relevant_data_marts_by_prompt instead, and for open-ended orientation use summarize_data_catalog. Use get_project_context \u2192 list_contexts to discover business goals, then pass context_ids to restrict discovery to any selected context; omission preserves project-wide discovery within your existing access. Responses include all attached context IDs and names.";
|
|
21
24
|
readonly zodSchema: {
|
|
25
|
+
context_ids: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
|
|
22
26
|
status: z.ZodOptional<z.ZodEnum<{
|
|
23
27
|
draft: "draft";
|
|
24
28
|
published: "published";
|
|
@@ -33,6 +37,10 @@ export declare class ListDataMartsTool implements McpToolDefinition<ListDataMart
|
|
|
33
37
|
id: z.ZodString;
|
|
34
38
|
title: z.ZodString;
|
|
35
39
|
description: z.ZodString;
|
|
40
|
+
contexts: z.ZodArray<z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
}, z.core.$strip>>;
|
|
36
44
|
url: z.ZodString;
|
|
37
45
|
status: z.ZodString;
|
|
38
46
|
updated_at: z.ZodString;
|
|
@@ -62,7 +70,7 @@ export declare class ListDataMartsTool implements McpToolDefinition<ListDataMart
|
|
|
62
70
|
openWorldHint: boolean;
|
|
63
71
|
};
|
|
64
72
|
readonly requiredScopes: McpScope[];
|
|
65
|
-
constructor(dataMarts: McpDataMartsFacade, publicOriginService: PublicOriginService, projectContext: McpProjectContextFacade);
|
|
73
|
+
constructor(dataMarts: McpDataMartsFacade, publicOriginService: PublicOriginService, projectContext: McpProjectContextFacade, contexts: McpContextsFacade);
|
|
66
74
|
parseInput(input: unknown): ListDataMartsInput;
|
|
67
75
|
handler(input: ListDataMartsInput, context: McpAuthContext): Promise<McpToolResult>;
|
|
68
76
|
private gettingStartedFor;
|
|
@@ -13,6 +13,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.ListDataMartsTool = void 0;
|
|
16
|
+
const context_input_1 = require("./context-input");
|
|
17
|
+
const mcp_contexts_facade_1 = require("../../../data-marts/facades/mcp-contexts.facade");
|
|
16
18
|
const common_1 = require("@nestjs/common");
|
|
17
19
|
const zod_v4_1 = require("zod-v4");
|
|
18
20
|
const public_origin_service_1 = require("../../../common/config/public-origin.service");
|
|
@@ -25,6 +27,7 @@ const mcp_project_summary_util_1 = require("./mcp-project-summary.util");
|
|
|
25
27
|
const mcp_public_url_util_1 = require("./mcp-public-url.util");
|
|
26
28
|
const inputSchema = zod_v4_1.z
|
|
27
29
|
.object({
|
|
30
|
+
context_ids: context_input_1.contextIdsSchema,
|
|
28
31
|
status: zod_v4_1.z
|
|
29
32
|
.enum(['published', 'draft'])
|
|
30
33
|
.optional()
|
|
@@ -35,8 +38,9 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
35
38
|
dataMarts;
|
|
36
39
|
publicOriginService;
|
|
37
40
|
projectContext;
|
|
41
|
+
contexts;
|
|
38
42
|
name = 'list_data_marts';
|
|
39
|
-
description = 'List data marts available to the current OWOX project member. Defaults to published data marts; use status=draft only to browse draft metadata, because other MCP data-mart tools accept published data marts only. Use only when the user explicitly asks to list or browse data marts; for a concrete analytical question use get_relevant_data_marts_by_prompt instead, and for open-ended orientation use summarize_data_catalog.';
|
|
43
|
+
description = 'List data marts available to the current OWOX project member. Defaults to published data marts; use status=draft only to browse draft metadata, because other MCP data-mart tools accept published data marts only. Use only when the user explicitly asks to list or browse data marts; for a concrete analytical question use get_relevant_data_marts_by_prompt instead, and for open-ended orientation use summarize_data_catalog. Use get_project_context → list_contexts to discover business goals, then pass context_ids to restrict discovery to any selected context; omission preserves project-wide discovery within your existing access. Responses include all attached context IDs and names.';
|
|
40
44
|
zodSchema = inputSchema.shape;
|
|
41
45
|
outputSchema = {
|
|
42
46
|
project: zod_v4_1.z.object({ id: zod_v4_1.z.string(), title: zod_v4_1.z.string() }).optional(),
|
|
@@ -44,6 +48,7 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
44
48
|
id: zod_v4_1.z.string(),
|
|
45
49
|
title: zod_v4_1.z.string(),
|
|
46
50
|
description: zod_v4_1.z.string(),
|
|
51
|
+
contexts: (0, context_input_1.makeContextSummariesSchema)(),
|
|
47
52
|
url: zod_v4_1.z.string(),
|
|
48
53
|
status: zod_v4_1.z.string(),
|
|
49
54
|
updated_at: zod_v4_1.z.string(),
|
|
@@ -59,16 +64,19 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
59
64
|
openWorldHint: false,
|
|
60
65
|
};
|
|
61
66
|
requiredScopes = ['mcp:read'];
|
|
62
|
-
constructor(dataMarts, publicOriginService, projectContext) {
|
|
67
|
+
constructor(dataMarts, publicOriginService, projectContext, contexts) {
|
|
63
68
|
this.dataMarts = dataMarts;
|
|
64
69
|
this.publicOriginService = publicOriginService;
|
|
65
70
|
this.projectContext = projectContext;
|
|
71
|
+
this.contexts = contexts;
|
|
66
72
|
}
|
|
67
73
|
parseInput(input) {
|
|
68
74
|
return inputSchema.parse(input);
|
|
69
75
|
}
|
|
70
76
|
async handler(input, context) {
|
|
71
77
|
const parsed = this.parseInput(input);
|
|
78
|
+
if (parsed.context_ids)
|
|
79
|
+
await this.contexts.validateContextIds(context.projectId, parsed.context_ids);
|
|
72
80
|
const status = parsed.status ?? 'published';
|
|
73
81
|
const [result, projectContext] = await Promise.all([
|
|
74
82
|
this.dataMarts.listDataMarts({
|
|
@@ -76,6 +84,7 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
76
84
|
userId: context.userId,
|
|
77
85
|
roles: context.roles,
|
|
78
86
|
status,
|
|
87
|
+
...(parsed.context_ids ? { contextIds: parsed.context_ids } : {}),
|
|
79
88
|
}),
|
|
80
89
|
(0, mcp_project_summary_util_1.tryGetMcpProjectSummary)(this.projectContext, context),
|
|
81
90
|
]);
|
|
@@ -83,6 +92,7 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
83
92
|
const gettingStarted = await this.gettingStartedFor(result.dataMarts.length, status, {
|
|
84
93
|
publicOrigin,
|
|
85
94
|
context,
|
|
95
|
+
filtered: !!parsed.context_ids,
|
|
86
96
|
});
|
|
87
97
|
const structuredContent = {
|
|
88
98
|
...(projectContext ? { project: projectContext } : {}),
|
|
@@ -92,17 +102,18 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
92
102
|
description: dataMart.description ?? '',
|
|
93
103
|
url: (0, mcp_public_url_util_1.joinPublicOrigin)(publicOrigin, (0, data_mart_ui_path_1.buildDataMartUiPath)(context.projectId, dataMart.id)),
|
|
94
104
|
status: dataMart.status,
|
|
105
|
+
contexts: dataMart.contexts ?? [],
|
|
95
106
|
updated_at: dataMart.updatedAt,
|
|
96
107
|
})),
|
|
97
108
|
...(gettingStarted ? { getting_started: gettingStarted } : {}),
|
|
98
109
|
};
|
|
99
110
|
return (0, mcp_tool_definition_1.jsonToolResult)(structuredContent);
|
|
100
111
|
}
|
|
101
|
-
async gettingStartedFor(listedCount, status, { publicOrigin, context }) {
|
|
112
|
+
async gettingStartedFor(listedCount, status, { publicOrigin, context, filtered, }) {
|
|
102
113
|
if (listedCount > 0)
|
|
103
114
|
return undefined;
|
|
104
115
|
const deps = { dataMarts: this.dataMarts, publicOrigin };
|
|
105
|
-
return status === 'published'
|
|
116
|
+
return status === 'published' && !filtered
|
|
106
117
|
? (0, mcp_getting_started_util_1.buildGettingStarted)(deps, context)
|
|
107
118
|
: (0, mcp_getting_started_util_1.resolveGettingStarted)(deps, context);
|
|
108
119
|
}
|
|
@@ -112,6 +123,7 @@ exports.ListDataMartsTool = ListDataMartsTool = __decorate([
|
|
|
112
123
|
(0, common_1.Injectable)(),
|
|
113
124
|
__param(0, (0, common_1.Inject)(mcp_data_marts_facade_1.MCP_DATA_MARTS_FACADE)),
|
|
114
125
|
__param(2, (0, common_1.Inject)(mcp_project_context_facade_1.MCP_PROJECT_CONTEXT_FACADE)),
|
|
115
|
-
|
|
126
|
+
__param(3, (0, common_1.Inject)(mcp_contexts_facade_1.MCP_CONTEXTS_FACADE)),
|
|
127
|
+
__metadata("design:paramtypes", [Object, public_origin_service_1.PublicOriginService, Object, Object])
|
|
116
128
|
], ListDataMartsTool);
|
|
117
129
|
//# sourceMappingURL=data-mart-catalog.tool.js.map
|
|
@@ -16,7 +16,7 @@ export declare class GetDataMartDetailsTool implements McpToolDefinition<GetData
|
|
|
16
16
|
private readonly dataMarts;
|
|
17
17
|
private readonly publicOriginService;
|
|
18
18
|
readonly name = "get_data_mart_details_by_id";
|
|
19
|
-
readonly description = "Get available details for a specific published OWOX Data Mart by data_mart_id, including its URL, native output fields, and (only on explicit request) joined_fields contributed by blended/joined data marts. Use detail_level=native by default: it avoids exposing irrelevant joined fields and keeps the response fast. Request detail_level=with_joined_fields only when the question truly needs a joined Data Mart. Use displayName for user-facing wording and copy name verbatim into query_data_mart. Each controllable field carries its type \"category\", and every field carries the effective \"allowedAggregations\" query_data_mart may apply to it; \"operators_by_category\" maps each category to the filter/slice operators its fields accept \u2014 build queries from these instead of guessing. An empty allowedAggregations on a field whose \"calculated\" level is \"metric\" means the value is ALREADY computed, not that the field is unusable: select it by name in query_data_mart instead of recomputing it from other fields, and read the \"usage\" note carried on that field \u2014 it may also warn that a join distorts the number. Array fields are the exception: when mode is REPEATED or type or sliceType is ARRAY, the field omits category and has empty allowedAggregations. It may appear in fields, but never in filters, slices, sort, aggregations, or date_buckets. This tool is optional in
|
|
19
|
+
readonly description = "Get available details for a specific published OWOX Data Mart by data_mart_id, including its URL, attached context IDs and names, native output fields, and (only on explicit request) joined_fields contributed by blended/joined data marts. Use detail_level=native by default: it avoids exposing irrelevant joined fields and keeps the response fast. Request detail_level=with_joined_fields only when the question truly needs a joined Data Mart. Use displayName for user-facing wording and copy name verbatim into query_data_mart. Each controllable field carries its type \"category\", and every field carries the effective \"allowedAggregations\" query_data_mart may apply to it; \"operators_by_category\" maps each category to the filter/slice operators its fields accept \u2014 build queries from these instead of guessing. An empty allowedAggregations on a field whose \"calculated\" level is \"metric\" means the value is ALREADY computed, not that the field is unusable: select it by name in query_data_mart instead of recomputing it from other fields, and read the \"usage\" note carried on that field \u2014 it may also warn that a join distorts the number. Array fields are the exception: when mode is REPEATED or type or sliceType is ARRAY, the field omits category and has empty allowedAggregations. It may appear in fields, but never in filters, slices, sort, aggregations, or date_buckets. Follow get_project_context \u2192 list_contexts \u2192 context-filtered Data Mart discovery. This tool is optional in that flow: get_relevant_data_marts_by_prompt finds relevant Data Marts, and this tool adds field-level metadata for a selected Data Mart. It does not return data owners, data freshness, sample values, or actual data rows.";
|
|
20
20
|
readonly zodSchema: {
|
|
21
21
|
data_mart_id: z.ZodString;
|
|
22
22
|
detail_level: z.ZodOptional<z.ZodEnum<{
|
|
@@ -25,6 +25,10 @@ export declare class GetDataMartDetailsTool implements McpToolDefinition<GetData
|
|
|
25
25
|
}>>;
|
|
26
26
|
};
|
|
27
27
|
readonly outputSchema: {
|
|
28
|
+
contexts: z.ZodArray<z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>;
|
|
28
32
|
id: z.ZodString;
|
|
29
33
|
name: z.ZodString;
|
|
30
34
|
url: z.ZodString;
|
|
@@ -13,6 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.GetDataMartDetailsTool = void 0;
|
|
16
|
+
const context_input_1 = require("./context-input");
|
|
16
17
|
const common_1 = require("@nestjs/common");
|
|
17
18
|
const zod_v4_1 = require("zod-v4");
|
|
18
19
|
const mcp_data_marts_facade_1 = require("../../../data-marts/facades/mcp-data-marts.facade");
|
|
@@ -129,9 +130,10 @@ let GetDataMartDetailsTool = class GetDataMartDetailsTool {
|
|
|
129
130
|
dataMarts;
|
|
130
131
|
publicOriginService;
|
|
131
132
|
name = 'get_data_mart_details_by_id';
|
|
132
|
-
description = 'Get available details for a specific published OWOX Data Mart by data_mart_id, including its URL, native output fields, and (only on explicit request) joined_fields contributed by blended/joined data marts. Use detail_level=native by default: it avoids exposing irrelevant joined fields and keeps the response fast. Request detail_level=with_joined_fields only when the question truly needs a joined Data Mart. Use displayName for user-facing wording and copy name verbatim into query_data_mart. Each controllable field carries its type "category", and every field carries the effective "allowedAggregations" query_data_mart may apply to it; "operators_by_category" maps each category to the filter/slice operators its fields accept — build queries from these instead of guessing. An empty allowedAggregations on a field whose "calculated" level is "metric" means the value is ALREADY computed, not that the field is unusable: select it by name in query_data_mart instead of recomputing it from other fields, and read the "usage" note carried on that field — it may also warn that a join distorts the number. Array fields are the exception: when mode is REPEATED or type or sliceType is ARRAY, the field omits category and has empty allowedAggregations. It may appear in fields, but never in filters, slices, sort, aggregations, or date_buckets. This tool is optional in
|
|
133
|
+
description = 'Get available details for a specific published OWOX Data Mart by data_mart_id, including its URL, attached context IDs and names, native output fields, and (only on explicit request) joined_fields contributed by blended/joined data marts. Use detail_level=native by default: it avoids exposing irrelevant joined fields and keeps the response fast. Request detail_level=with_joined_fields only when the question truly needs a joined Data Mart. Use displayName for user-facing wording and copy name verbatim into query_data_mart. Each controllable field carries its type "category", and every field carries the effective "allowedAggregations" query_data_mart may apply to it; "operators_by_category" maps each category to the filter/slice operators its fields accept — build queries from these instead of guessing. An empty allowedAggregations on a field whose "calculated" level is "metric" means the value is ALREADY computed, not that the field is unusable: select it by name in query_data_mart instead of recomputing it from other fields, and read the "usage" note carried on that field — it may also warn that a join distorts the number. Array fields are the exception: when mode is REPEATED or type or sliceType is ARRAY, the field omits category and has empty allowedAggregations. It may appear in fields, but never in filters, slices, sort, aggregations, or date_buckets. Follow get_project_context → list_contexts → context-filtered Data Mart discovery. This tool is optional in that flow: get_relevant_data_marts_by_prompt finds relevant Data Marts, and this tool adds field-level metadata for a selected Data Mart. It does not return data owners, data freshness, sample values, or actual data rows.';
|
|
133
134
|
zodSchema = inputSchema.shape;
|
|
134
135
|
outputSchema = {
|
|
136
|
+
contexts: (0, context_input_1.makeContextSummariesSchema)(),
|
|
135
137
|
id: zod_v4_1.z.string().describe('Data mart identifier.'),
|
|
136
138
|
name: zod_v4_1.z.string().describe('Data mart display name.'),
|
|
137
139
|
url: zod_v4_1.z.string().describe('Open this Data Mart in OWOX.'),
|
|
@@ -190,6 +192,7 @@ let GetDataMartDetailsTool = class GetDataMartDetailsTool {
|
|
|
190
192
|
operatorsByCategory[category] = (0, field_type_matrix_1.mcpOperatorsForCategory)(category);
|
|
191
193
|
}
|
|
192
194
|
const structuredContent = {
|
|
195
|
+
contexts: result.contexts ?? [],
|
|
193
196
|
id: result.id,
|
|
194
197
|
name: result.name,
|
|
195
198
|
url: (0, mcp_public_url_util_1.joinPublicOrigin)(this.publicOriginService.getPublicOrigin(), (0, data_mart_ui_path_1.buildDataMartUiPath)(context.projectId, result.id)),
|
|
@@ -26,10 +26,10 @@ let GetReportOutputSchemaTool = class GetReportOutputSchemaTool {
|
|
|
26
26
|
'`revenue | SUM`, Unique Count, calculated fields), which appear in no data mart schema. ' +
|
|
27
27
|
'Answers from the stored schema and the report config, so it reads no report data — the ' +
|
|
28
28
|
"columns are as of the Data Mart's last schema actualization, so one added warehouse-side and " +
|
|
29
|
-
'not yet actualized is missing until a run or a data read picks it up.
|
|
30
|
-
'
|
|
31
|
-
|
|
32
|
-
'
|
|
29
|
+
'not yet actualized is missing until a run or a data read picks it up. For a report that ' +
|
|
30
|
+
'joins other data marts, resolving the join may refresh SQL-defined source views in the ' +
|
|
31
|
+
'warehouse. This changes warehouse state and can incur warehouse costs even though the tool ' +
|
|
32
|
+
'does not return report data rows.';
|
|
33
33
|
zodSchema = inputSchema.shape;
|
|
34
34
|
outputSchema = {
|
|
35
35
|
report_id: zod_v4_1.z.string(),
|
|
@@ -50,9 +50,9 @@ let GetReportOutputSchemaTool = class GetReportOutputSchemaTool {
|
|
|
50
50
|
};
|
|
51
51
|
annotations = {
|
|
52
52
|
title: 'Get Report Output Schema',
|
|
53
|
-
readOnlyHint:
|
|
53
|
+
readOnlyHint: false,
|
|
54
54
|
destructiveHint: false,
|
|
55
|
-
openWorldHint:
|
|
55
|
+
openWorldHint: true,
|
|
56
56
|
};
|
|
57
57
|
requiredScopes = ['mcp:read'];
|
|
58
58
|
constructor(reports) {
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { z } from 'zod-v4';
|
|
2
|
+
import type { McpScope } from '@owox/idp-protocol';
|
|
3
|
+
import { type McpContextsFacade } from '../../../data-marts/facades/mcp-contexts.facade';
|
|
4
|
+
import type { McpAuthContext } from '../auth/mcp-auth-context';
|
|
5
|
+
import { type McpToolDefinition } from './mcp-tool.definition';
|
|
6
|
+
export declare class ListContextsTool implements McpToolDefinition<Record<string, never>> {
|
|
7
|
+
private readonly contexts;
|
|
8
|
+
readonly name = "list_contexts";
|
|
9
|
+
readonly description = "List business contexts in the connected OWOX project, including IDs, names and complete descriptions (null when missing). Discovery flow: get_project_context \u2192 list_contexts \u2192 list_data_marts or get_relevant_data_marts_by_prompt with context_ids \u2192 get_data_mart_details_by_id. Read descriptions for business goals and Markdown links to specific Data Marts. Listing a context or following a reference never grants access to its resources; all Data Mart tools enforce existing access controls.";
|
|
10
|
+
readonly zodSchema: {};
|
|
11
|
+
readonly outputSchema: {
|
|
12
|
+
contexts: z.ZodArray<z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
description: z.ZodNullable<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
};
|
|
18
|
+
readonly annotations: {
|
|
19
|
+
title: string;
|
|
20
|
+
readOnlyHint: boolean;
|
|
21
|
+
destructiveHint: boolean;
|
|
22
|
+
openWorldHint: boolean;
|
|
23
|
+
};
|
|
24
|
+
readonly requiredScopes: McpScope[];
|
|
25
|
+
private readonly inputSchema;
|
|
26
|
+
constructor(contexts: McpContextsFacade);
|
|
27
|
+
handler(input: Record<string, never>, context: McpAuthContext): Promise<{
|
|
28
|
+
[x: string]: unknown;
|
|
29
|
+
content: ({
|
|
30
|
+
type: "text";
|
|
31
|
+
text: string;
|
|
32
|
+
annotations?: {
|
|
33
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
34
|
+
priority?: number | undefined;
|
|
35
|
+
lastModified?: string | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
_meta?: {
|
|
38
|
+
[x: string]: unknown;
|
|
39
|
+
} | undefined;
|
|
40
|
+
} | {
|
|
41
|
+
type: "image";
|
|
42
|
+
data: string;
|
|
43
|
+
mimeType: string;
|
|
44
|
+
annotations?: {
|
|
45
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
46
|
+
priority?: number | undefined;
|
|
47
|
+
lastModified?: string | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
_meta?: {
|
|
50
|
+
[x: string]: unknown;
|
|
51
|
+
} | undefined;
|
|
52
|
+
} | {
|
|
53
|
+
type: "audio";
|
|
54
|
+
data: string;
|
|
55
|
+
mimeType: string;
|
|
56
|
+
annotations?: {
|
|
57
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
58
|
+
priority?: number | undefined;
|
|
59
|
+
lastModified?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
_meta?: {
|
|
62
|
+
[x: string]: unknown;
|
|
63
|
+
} | undefined;
|
|
64
|
+
} | {
|
|
65
|
+
uri: string;
|
|
66
|
+
name: string;
|
|
67
|
+
type: "resource_link";
|
|
68
|
+
description?: string | undefined;
|
|
69
|
+
mimeType?: string | undefined;
|
|
70
|
+
size?: number | undefined;
|
|
71
|
+
annotations?: {
|
|
72
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
73
|
+
priority?: number | undefined;
|
|
74
|
+
lastModified?: string | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
_meta?: {
|
|
77
|
+
[x: string]: unknown;
|
|
78
|
+
} | undefined;
|
|
79
|
+
icons?: {
|
|
80
|
+
src: string;
|
|
81
|
+
mimeType?: string | undefined;
|
|
82
|
+
sizes?: string[] | undefined;
|
|
83
|
+
theme?: "light" | "dark" | undefined;
|
|
84
|
+
}[] | undefined;
|
|
85
|
+
title?: string | undefined;
|
|
86
|
+
} | {
|
|
87
|
+
type: "resource";
|
|
88
|
+
resource: {
|
|
89
|
+
uri: string;
|
|
90
|
+
text: string;
|
|
91
|
+
mimeType?: string | undefined;
|
|
92
|
+
_meta?: {
|
|
93
|
+
[x: string]: unknown;
|
|
94
|
+
} | undefined;
|
|
95
|
+
} | {
|
|
96
|
+
uri: string;
|
|
97
|
+
blob: string;
|
|
98
|
+
mimeType?: string | undefined;
|
|
99
|
+
_meta?: {
|
|
100
|
+
[x: string]: unknown;
|
|
101
|
+
} | undefined;
|
|
102
|
+
};
|
|
103
|
+
annotations?: {
|
|
104
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
105
|
+
priority?: number | undefined;
|
|
106
|
+
lastModified?: string | undefined;
|
|
107
|
+
} | undefined;
|
|
108
|
+
_meta?: {
|
|
109
|
+
[x: string]: unknown;
|
|
110
|
+
} | undefined;
|
|
111
|
+
})[];
|
|
112
|
+
_meta?: {
|
|
113
|
+
[x: string]: unknown;
|
|
114
|
+
"io.modelcontextprotocol/serverInfo"?: {
|
|
115
|
+
version: string;
|
|
116
|
+
name: string;
|
|
117
|
+
websiteUrl?: string | undefined;
|
|
118
|
+
description?: string | undefined;
|
|
119
|
+
icons?: {
|
|
120
|
+
src: string;
|
|
121
|
+
mimeType?: string | undefined;
|
|
122
|
+
sizes?: string[] | undefined;
|
|
123
|
+
theme?: "light" | "dark" | undefined;
|
|
124
|
+
}[] | undefined;
|
|
125
|
+
title?: string | undefined;
|
|
126
|
+
} | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
structuredContent?: unknown;
|
|
129
|
+
isError?: boolean | undefined;
|
|
130
|
+
}>;
|
|
131
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ListContextsTool = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const zod_v4_1 = require("zod-v4");
|
|
18
|
+
const mcp_contexts_facade_1 = require("../../../data-marts/facades/mcp-contexts.facade");
|
|
19
|
+
const mcp_tool_definition_1 = require("./mcp-tool.definition");
|
|
20
|
+
let ListContextsTool = class ListContextsTool {
|
|
21
|
+
contexts;
|
|
22
|
+
name = 'list_contexts';
|
|
23
|
+
description = 'List business contexts in the connected OWOX project, including IDs, names and complete descriptions (null when missing). Discovery flow: get_project_context → list_contexts → list_data_marts or get_relevant_data_marts_by_prompt with context_ids → get_data_mart_details_by_id. Read descriptions for business goals and Markdown links to specific Data Marts. Listing a context or following a reference never grants access to its resources; all Data Mart tools enforce existing access controls.';
|
|
24
|
+
zodSchema = {};
|
|
25
|
+
outputSchema = {
|
|
26
|
+
contexts: zod_v4_1.z.array(zod_v4_1.z.object({ id: zod_v4_1.z.string(), name: zod_v4_1.z.string(), description: zod_v4_1.z.string().nullable() })),
|
|
27
|
+
};
|
|
28
|
+
annotations = {
|
|
29
|
+
title: 'List Project Contexts',
|
|
30
|
+
readOnlyHint: true,
|
|
31
|
+
destructiveHint: false,
|
|
32
|
+
openWorldHint: false,
|
|
33
|
+
};
|
|
34
|
+
requiredScopes = ['mcp:read'];
|
|
35
|
+
inputSchema = zod_v4_1.z.object({}).strict();
|
|
36
|
+
constructor(contexts) {
|
|
37
|
+
this.contexts = contexts;
|
|
38
|
+
}
|
|
39
|
+
async handler(input, context) {
|
|
40
|
+
this.inputSchema.parse(input);
|
|
41
|
+
return (0, mcp_tool_definition_1.jsonToolResult)({ contexts: await this.contexts.listContexts(context.projectId) });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.ListContextsTool = ListContextsTool;
|
|
45
|
+
exports.ListContextsTool = ListContextsTool = __decorate([
|
|
46
|
+
(0, common_1.Injectable)(),
|
|
47
|
+
__param(0, (0, common_1.Inject)(mcp_contexts_facade_1.MCP_CONTEXTS_FACADE)),
|
|
48
|
+
__metadata("design:paramtypes", [Object])
|
|
49
|
+
], ListContextsTool);
|
|
50
|
+
//# sourceMappingURL=list-contexts.tool.js.map
|
|
@@ -96,11 +96,11 @@ function buildInstructions(canCreate, draftCount) {
|
|
|
96
96
|
if (draftCount > 0) {
|
|
97
97
|
parts.push(`The user can see ${draftCount} draft Data Mart(s) listed in draft_data_marts; name them with their url. Drafts are not available through MCP until they are ${canCreate
|
|
98
98
|
? 'opened in the OWOX Data Marts web app, finished, and published.'
|
|
99
|
-
: 'published by a Project Admin or a
|
|
99
|
+
: 'published by a Project Admin or a Data Owner.'}`);
|
|
100
100
|
}
|
|
101
101
|
parts.push(canCreate
|
|
102
102
|
? 'The user can create Data Marts. Walk them through the steps: 1) open create_data_mart_url in the OWOX Data Marts web app; 2) connect a data source or define the Data Mart from SQL, a table, or a view on a connected storage; 3) save and publish it. Share create_data_mart_url and the matching guide from guides.'
|
|
103
|
-
: 'The user role (Business User) cannot create Data Marts. Advise them to ask a Project Admin or a
|
|
103
|
+
: 'The user role (Business User) cannot create Data Marts. Advise them to ask a Project Admin or a Data Owner of this project to create and publish a Data Mart and share it with them for reporting. Share data_marts_url and guides.core_concepts so they can pass them on.', 'Once a published Data Mart is available, the user can simply ask again. Do not retry discovery tools with different wording, and do not call query_data_mart or any report or schedule tool until then.');
|
|
104
104
|
return parts.join(' ');
|
|
105
105
|
}
|
|
106
106
|
//# sourceMappingURL=mcp-getting-started.util.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MCP_TOOL_DEFINITIONS_PROVIDER = exports.MCP_TOOL_PROVIDER_CLASSES = void 0;
|
|
4
|
+
const list_contexts_tool_1 = require("./list-contexts.tool");
|
|
4
5
|
const create_report_run_schedule_tool_1 = require("./create-report-run-schedule.tool");
|
|
5
6
|
const add_report_tool_1 = require("./add-report.tool");
|
|
6
7
|
const data_mart_catalog_tool_1 = require("./data-mart-catalog.tool");
|
|
@@ -23,6 +24,7 @@ const update_report_run_schedule_tool_1 = require("./update-report-run-schedule.
|
|
|
23
24
|
const update_report_tool_1 = require("./update-report.tool");
|
|
24
25
|
const add_destination_tool_1 = require("./add-destination.tool");
|
|
25
26
|
exports.MCP_TOOL_PROVIDER_CLASSES = [
|
|
27
|
+
list_contexts_tool_1.ListContextsTool,
|
|
26
28
|
summarize_data_catalog_tool_1.SummarizeDataCatalogTool,
|
|
27
29
|
data_mart_catalog_tool_1.ListDataMartsTool,
|
|
28
30
|
search_data_marts_tool_1.SearchDataMartsTool,
|
|
@@ -155,7 +155,7 @@ If truncated is true, not all matching rows were returned: narrow the query (few
|
|
|
155
155
|
readOnlyHint: false,
|
|
156
156
|
destructiveHint: false,
|
|
157
157
|
idempotentHint: false,
|
|
158
|
-
openWorldHint:
|
|
158
|
+
openWorldHint: true,
|
|
159
159
|
};
|
|
160
160
|
requiredScopes = ['mcp:read', 'mcp:write'];
|
|
161
161
|
constructor(dataMarts, cls, publicOriginService) {
|