@servicelabsco/slabs-access-manager 1.0.64 → 1.0.66
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/access/controllers/dashboard.report.controller.js +3 -1
- package/dist/access/controllers/dashboard.report.controller.js.map +1 -1
- package/dist/access/controllers/index.d.ts +2 -0
- package/dist/access/controllers/index.js +2 -0
- package/dist/access/controllers/index.js.map +1 -1
- package/dist/access/controllers/listing.controller.d.ts +19 -0
- package/dist/access/controllers/listing.controller.js +44 -0
- package/dist/access/controllers/listing.controller.js.map +1 -1
- package/dist/access/controllers/mcp.reports.controller.d.ts +18 -0
- package/dist/access/controllers/mcp.reports.controller.js +67 -0
- package/dist/access/controllers/mcp.reports.controller.js.map +1 -0
- package/dist/access/controllers/whoami.controller.d.ts +22 -0
- package/dist/access/controllers/whoami.controller.js +48 -0
- package/dist/access/controllers/whoami.controller.js.map +1 -0
- package/dist/access/es6.classes.d.ts +6 -2
- package/dist/access/es6.classes.js +7 -1
- package/dist/access/es6.classes.js.map +1 -1
- package/dist/access/libraries/create.user.business.secret.d.ts +7 -1
- package/dist/access/libraries/create.user.business.secret.js +38 -1
- package/dist/access/libraries/create.user.business.secret.js.map +1 -1
- package/dist/access/libraries/index.d.ts +1 -0
- package/dist/access/libraries/index.js +1 -0
- package/dist/access/libraries/index.js.map +1 -1
- package/dist/access/libraries/process.listing.page.query.d.ts +11 -0
- package/dist/access/libraries/process.listing.page.query.js +24 -0
- package/dist/access/libraries/process.listing.page.query.js.map +1 -0
- package/dist/access/middlewares/idempotency.middleware.d.ts +5 -0
- package/dist/access/middlewares/idempotency.middleware.js +46 -0
- package/dist/access/middlewares/idempotency.middleware.js.map +1 -0
- package/dist/access/middlewares/index.d.ts +2 -0
- package/dist/access/middlewares/index.js +2 -0
- package/dist/access/middlewares/index.js.map +1 -1
- package/dist/access/middlewares/mcp.rate.limit.middleware.d.ts +6 -0
- package/dist/access/middlewares/mcp.rate.limit.middleware.js +50 -0
- package/dist/access/middlewares/mcp.rate.limit.middleware.js.map +1 -0
- package/dist/access/services/access.business.service.d.ts +1 -0
- package/dist/access/services/access.business.service.js +12 -0
- package/dist/access/services/access.business.service.js.map +1 -1
- package/dist/access/services/access.report.service.d.ts +5 -0
- package/dist/access/services/access.report.service.js +19 -0
- package/dist/access/services/access.report.service.js.map +1 -1
- package/dist/access/services/credential.resolve.service.d.ts +1 -0
- package/dist/access/services/credential.resolve.service.js +3 -0
- package/dist/access/services/credential.resolve.service.js.map +1 -1
- package/dist/access/services/listing.service.d.ts +2 -0
- package/dist/access/services/listing.service.js +26 -1
- package/dist/access/services/listing.service.js.map +1 -1
- package/dist/access/services/oauth.as.service.js +10 -8
- package/dist/access/services/oauth.as.service.js.map +1 -1
- package/dist/app.module.js +4 -0
- package/dist/app.module.js.map +1 -1
- package/dist/mcp/auth/index.d.ts +1 -0
- package/dist/mcp/auth/index.js +1 -0
- package/dist/mcp/auth/index.js.map +1 -1
- package/dist/mcp/auth/mcp.idempotency.store.d.ts +11 -0
- package/dist/mcp/auth/mcp.idempotency.store.js +70 -0
- package/dist/mcp/auth/mcp.idempotency.store.js.map +1 -0
- package/dist/mcp/catalog/assert.valid.catalog.d.ts +7 -0
- package/dist/mcp/catalog/assert.valid.catalog.js +41 -0
- package/dist/mcp/catalog/assert.valid.catalog.js.map +1 -0
- package/dist/mcp/catalog/index.d.ts +2 -0
- package/dist/mcp/catalog/index.js +19 -0
- package/dist/mcp/catalog/index.js.map +1 -0
- package/dist/mcp/catalog/mcp.catalog.gate.d.ts +5 -0
- package/dist/mcp/catalog/mcp.catalog.gate.js +38 -0
- package/dist/mcp/catalog/mcp.catalog.gate.js.map +1 -0
- package/dist/mcp/client/slabs.api.client.js +1 -0
- package/dist/mcp/client/slabs.api.client.js.map +1 -1
- package/dist/mcp/es6.classes.d.ts +3 -3
- package/dist/mcp/es6.classes.js +2 -2
- package/dist/mcp/es6.classes.js.map +1 -1
- package/dist/mcp/http/admin.mcp.controller.js +2 -1
- package/dist/mcp/http/admin.mcp.controller.js.map +1 -1
- package/dist/mcp/http/business.mcp.controller.d.ts +6 -1
- package/dist/mcp/http/business.mcp.controller.js +59 -3
- package/dist/mcp/http/business.mcp.controller.js.map +1 -1
- package/dist/mcp/http/mcp.http.module.js +3 -1
- package/dist/mcp/http/mcp.http.module.js.map +1 -1
- package/dist/mcp/http/prm.controller.d.ts +8 -0
- package/dist/mcp/http/prm.controller.js +13 -0
- package/dist/mcp/http/prm.controller.js.map +1 -1
- package/dist/mcp/http/unauthorized.mcp.response.d.ts +1 -0
- package/dist/mcp/http/unauthorized.mcp.response.js +6 -3
- package/dist/mcp/http/unauthorized.mcp.response.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/interfaces/mcp.tool.interface.d.ts +1 -0
- package/dist/mcp/interfaces/slabs.api.request.interface.d.ts +1 -0
- package/dist/mcp/mcp.constants.d.ts +13 -0
- package/dist/mcp/mcp.constants.js +43 -0
- package/dist/mcp/mcp.constants.js.map +1 -0
- package/dist/mcp/mcp.module.d.ts +9 -0
- package/dist/mcp/mcp.module.js +29 -3
- package/dist/mcp/mcp.module.js.map +1 -1
- package/dist/mcp/tools/ap.tool.registry.d.ts +7 -0
- package/dist/mcp/tools/ap.tool.registry.js +71 -0
- package/dist/mcp/tools/ap.tool.registry.js.map +1 -0
- package/dist/mcp/tools/ar.tool.registry.d.ts +7 -0
- package/dist/mcp/tools/ar.tool.registry.js +71 -0
- package/dist/mcp/tools/ar.tool.registry.js.map +1 -0
- package/dist/mcp/tools/catalog.slugs.d.ts +10 -0
- package/dist/mcp/tools/catalog.slugs.js +17 -0
- package/dist/mcp/tools/catalog.slugs.js.map +1 -0
- package/dist/mcp/tools/delete.listing.preference.tool.d.ts +1 -0
- package/dist/mcp/tools/delete.listing.preference.tool.js +2 -1
- package/dist/mcp/tools/delete.listing.preference.tool.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +9 -1
- package/dist/mcp/tools/index.js +9 -1
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/listing.describe.tool.d.ts +18 -0
- package/dist/mcp/tools/{get.listing.tool.js → listing.describe.tool.js} +8 -8
- package/dist/mcp/tools/listing.describe.tool.js.map +1 -0
- package/dist/mcp/tools/listing.query.tool.d.ts +32 -0
- package/dist/mcp/tools/listing.query.tool.js +36 -0
- package/dist/mcp/tools/listing.query.tool.js.map +1 -0
- package/dist/mcp/tools/listings.list.tool.d.ts +18 -0
- package/dist/mcp/tools/listings.list.tool.js +24 -0
- package/dist/mcp/tools/listings.list.tool.js.map +1 -0
- package/dist/mcp/tools/mcp.tool.d.ts +4 -0
- package/dist/mcp/tools/mcp.tool.js +55 -2
- package/dist/mcp/tools/mcp.tool.js.map +1 -1
- package/dist/mcp/tools/reports.list.tool.d.ts +18 -0
- package/dist/mcp/tools/reports.list.tool.js +25 -0
- package/dist/mcp/tools/reports.list.tool.js.map +1 -0
- package/dist/mcp/tools/reports.run.tool.d.ts +26 -0
- package/dist/mcp/tools/reports.run.tool.js +29 -0
- package/dist/mcp/tools/reports.run.tool.js.map +1 -0
- package/dist/mcp/tools/save.listing.preference.tool.d.ts +2 -0
- package/dist/mcp/tools/save.listing.preference.tool.js +4 -1
- package/dist/mcp/tools/save.listing.preference.tool.js.map +1 -1
- package/dist/mcp/tools/tool.registry.js +20 -2
- package/dist/mcp/tools/tool.registry.js.map +1 -1
- package/dist/mcp/tools/whoami.tool.d.ts +10 -0
- package/dist/mcp/tools/whoami.tool.js +19 -0
- package/dist/mcp/tools/whoami.tool.js.map +1 -0
- package/package.json +1 -1
- package/dist/mcp/tools/get.listing.tool.d.ts +0 -17
- package/dist/mcp/tools/get.listing.tool.js.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ListingDescribeTool = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const mcp_tool_1 = require("./mcp.tool");
|
|
6
6
|
const inputSchema = {
|
|
7
7
|
slug: zod_1.z.string().min(3).max(100).describe('Listing page identifier/slug, e.g. "orders" or "business-users".'),
|
|
8
8
|
};
|
|
9
|
-
class
|
|
9
|
+
class ListingDescribeTool extends mcp_tool_1.McpTool {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
|
-
this.name = '
|
|
13
|
-
this.title = '
|
|
14
|
-
this.description = 'Fetch
|
|
15
|
-
"Use this to discover a listing's columns and existing preferences before creating or updating one.";
|
|
12
|
+
this.name = 'listing_describe';
|
|
13
|
+
this.title = 'Describe listing page';
|
|
14
|
+
this.description = 'Fetch columns, filters, sort, and visible preferences for a listing page by slug. Returns { definition, preferences, detail }. Call this before listing_query to know which filters and columns exist.';
|
|
16
15
|
this.inputSchema = inputSchema;
|
|
17
16
|
this.readOnly = true;
|
|
17
|
+
this.requiredScopes = ['reporting:read'];
|
|
18
18
|
}
|
|
19
19
|
execute(args) {
|
|
20
20
|
return this.run(() => this.client.request({ method: 'GET', path: `v1/b/listing-page/${encodeURIComponent(args.slug)}` }));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
exports.
|
|
24
|
-
//# sourceMappingURL=
|
|
23
|
+
exports.ListingDescribeTool = ListingDescribeTool;
|
|
24
|
+
//# sourceMappingURL=listing.describe.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listing.describe.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/listing.describe.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,yCAAqC;AAErC,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,kEAAkE,CAAC;CAChH,CAAC;AAQF,MAAa,mBAAoB,SAAQ,kBAA6B;IAAtE;;QACa,SAAI,GAAG,kBAAkB,CAAC;QAC1B,UAAK,GAAG,uBAAuB,CAAC;QAChC,gBAAW,GAChB,wMAAwM,CAAC;QACpM,gBAAW,GAAG,WAAW,CAAC;QAChB,aAAQ,GAAG,IAAI,CAAC;QAC1B,mBAAc,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAKjD,CAAC;IAHG,OAAO,CAAC,IAA0B;QAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9H,CAAC;CACJ;AAZD,kDAYC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { McpToolResultInterface } from '../interfaces/mcp.tool.result.interface';
|
|
3
|
+
import { McpTool } from './mcp.tool';
|
|
4
|
+
type ListingQueryInput = {
|
|
5
|
+
slug: string;
|
|
6
|
+
search?: string;
|
|
7
|
+
filter_query?: string;
|
|
8
|
+
order?: Record<string, unknown>;
|
|
9
|
+
limit?: number;
|
|
10
|
+
offset?: number;
|
|
11
|
+
date?: Record<string, unknown>;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare class ListingQueryTool extends McpTool<ListingQueryInput> {
|
|
15
|
+
readonly name = "listing_query";
|
|
16
|
+
readonly title = "Query listing rows";
|
|
17
|
+
readonly description = "Return rows from any listing page with filter/sort/search/paging. Honors the standard filter_query contract used by the portal. Returns { rows, total, limit, offset }.";
|
|
18
|
+
readonly inputSchema: {
|
|
19
|
+
slug: z.ZodString;
|
|
20
|
+
search: z.ZodOptional<z.ZodString>;
|
|
21
|
+
filter_query: z.ZodOptional<z.ZodString>;
|
|
22
|
+
order: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
23
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
date: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
26
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
};
|
|
28
|
+
protected readonly readOnly = true;
|
|
29
|
+
readonly requiredScopes: string[];
|
|
30
|
+
execute(args: ListingQueryInput): Promise<McpToolResultInterface>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListingQueryTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const mcp_tool_1 = require("./mcp.tool");
|
|
6
|
+
const inputSchema = {
|
|
7
|
+
slug: zod_1.z.string().min(3).max(100).describe('Listing page slug from listings_list.'),
|
|
8
|
+
search: zod_1.z.string().optional().describe('Free-text search (min 3 characters on the HTTP door).'),
|
|
9
|
+
filter_query: zod_1.z.string().optional().describe('Standard listing filter_query (SQL-like where on the listing subquery).'),
|
|
10
|
+
order: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional().describe('Custom order definition.'),
|
|
11
|
+
limit: zod_1.z.number().int().min(1).max(500).optional().describe('Page size (default 50).'),
|
|
12
|
+
offset: zod_1.z.number().int().min(0).optional().describe('Rows to skip (default 0).'),
|
|
13
|
+
date: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional().describe('Date filter object used by portal listings.'),
|
|
14
|
+
active: zod_1.z.boolean().optional().describe('Filter by active flag when the listing supports it.'),
|
|
15
|
+
};
|
|
16
|
+
class ListingQueryTool extends mcp_tool_1.McpTool {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.name = 'listing_query';
|
|
20
|
+
this.title = 'Query listing rows';
|
|
21
|
+
this.description = 'Return rows from any listing page with filter/sort/search/paging. Honors the standard filter_query contract used by the portal. Returns { rows, total, limit, offset }.';
|
|
22
|
+
this.inputSchema = inputSchema;
|
|
23
|
+
this.readOnly = true;
|
|
24
|
+
this.requiredScopes = ['reporting:read'];
|
|
25
|
+
}
|
|
26
|
+
execute(args) {
|
|
27
|
+
const { slug, ...body } = args;
|
|
28
|
+
return this.run(() => this.client.request({
|
|
29
|
+
method: 'POST',
|
|
30
|
+
path: `v1/b/listing-page/${encodeURIComponent(slug)}/query`,
|
|
31
|
+
body,
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ListingQueryTool = ListingQueryTool;
|
|
36
|
+
//# sourceMappingURL=listing.query.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listing.query.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/listing.query.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,yCAAqC;AAErC,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAClF,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IAC/F,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yEAAyE,CAAC;IACvH,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACxF,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,C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
|
4
|
+
type ListingsListInput = {
|
|
5
|
+
search?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class ListingsListTool extends McpTool<ListingsListInput> {
|
|
8
|
+
readonly name = "listings_list";
|
|
9
|
+
readonly title = "List listing pages";
|
|
10
|
+
readonly description = "Discover listing pages (slug, title, description) available to the connected business. Use a slug with listing_describe or listing_query. Returns { rows, total, limit, offset }.";
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
search: z.ZodOptional<z.ZodString>;
|
|
13
|
+
};
|
|
14
|
+
protected readonly readOnly = true;
|
|
15
|
+
readonly requiredScopes: string[];
|
|
16
|
+
execute(): Promise<McpToolResultInterface>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListingsListTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const mcp_tool_1 = require("./mcp.tool");
|
|
6
|
+
const inputSchema = {
|
|
7
|
+
search: zod_1.z.string().optional().describe('Optional text search over listing title/slug.'),
|
|
8
|
+
};
|
|
9
|
+
class ListingsListTool extends mcp_tool_1.McpTool {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.name = 'listings_list';
|
|
13
|
+
this.title = 'List listing pages';
|
|
14
|
+
this.description = 'Discover listing pages (slug, title, description) available to the connected business. Use a slug with listing_describe or listing_query. Returns { rows, total, limit, offset }.';
|
|
15
|
+
this.inputSchema = inputSchema;
|
|
16
|
+
this.readOnly = true;
|
|
17
|
+
this.requiredScopes = ['reporting:read'];
|
|
18
|
+
}
|
|
19
|
+
execute() {
|
|
20
|
+
return this.run(() => this.client.request({ method: 'GET', path: 'v1/b/listing-page' }));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.ListingsListTool = ListingsListTool;
|
|
24
|
+
//# sourceMappingURL=listings.list.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listings.list.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/listings.list.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,yCAAqC;AAErC,MAAM,WAAW,GAAG;IAChB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;CAC1F,CAAC;AAIF,MAAa,gBAAiB,SAAQ,kBAA0B;IAAhE;;QACa,SAAI,GAAG,eAAe,CAAC;QACvB,UAAK,GAAG,oBAAoB,CAAC;QAC7B,gBAAW,GAChB,mLAAmL,CAAC;QAC/K,gBAAW,GAAG,WAAW,CAAC;QAChB,aAAQ,GAAG,IAAI,CAAC;QAC1B,mBAAc,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAKjD,CAAC;IAHG,OAAO;QACH,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAC7F,CAAC;CACJ;AAZD,4CAYC"}
|
|
@@ -11,9 +11,13 @@ export declare abstract class McpTool<TArgs = Record<string, unknown>> implement
|
|
|
11
11
|
abstract readonly inputSchema: ZodRawShape;
|
|
12
12
|
protected readonly readOnly: boolean;
|
|
13
13
|
protected readonly destructive: boolean;
|
|
14
|
+
protected readonly idempotent: boolean;
|
|
15
|
+
readonly requiredScopes: string[];
|
|
14
16
|
constructor(client: SlabsApiClient);
|
|
15
17
|
abstract execute(args: TArgs): Promise<McpToolResultInterface>;
|
|
16
18
|
register(server: McpServer): void;
|
|
19
|
+
private dispatch;
|
|
20
|
+
protected callerKey(): string;
|
|
17
21
|
protected run(call: () => Promise<unknown>): Promise<McpToolResultInterface>;
|
|
18
22
|
protected success(data: unknown): McpToolResultInterface;
|
|
19
23
|
protected failure(error: unknown): McpToolResultInterface;
|
|
@@ -1,20 +1,73 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.McpTool = void 0;
|
|
4
|
+
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const mcp_idempotency_store_1 = require("../auth/mcp.idempotency.store");
|
|
4
7
|
const slabs_api_error_1 = require("../client/slabs.api.error");
|
|
5
8
|
class McpTool {
|
|
6
9
|
constructor(client) {
|
|
7
10
|
this.client = client;
|
|
8
11
|
this.readOnly = false;
|
|
9
12
|
this.destructive = false;
|
|
13
|
+
this.idempotent = false;
|
|
14
|
+
this.requiredScopes = [];
|
|
10
15
|
}
|
|
11
16
|
register(server) {
|
|
17
|
+
const inputSchema = this.destructive
|
|
18
|
+
? {
|
|
19
|
+
...this.inputSchema,
|
|
20
|
+
confirm: zod_1.z
|
|
21
|
+
.boolean()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Must be true to perform this destructive action. Omit or false returns confirmation_required and mutates nothing.'),
|
|
24
|
+
}
|
|
25
|
+
: this.inputSchema;
|
|
12
26
|
server.registerTool(this.name, {
|
|
13
27
|
title: this.title,
|
|
14
28
|
description: this.description,
|
|
15
|
-
inputSchema
|
|
29
|
+
inputSchema,
|
|
16
30
|
annotations: { readOnlyHint: this.readOnly, destructiveHint: this.destructive },
|
|
17
|
-
}, async (args) => this.
|
|
31
|
+
}, async (args) => this.dispatch(args));
|
|
32
|
+
}
|
|
33
|
+
async dispatch(args) {
|
|
34
|
+
if (this.destructive && args?.confirm !== true) {
|
|
35
|
+
return {
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: 'text',
|
|
39
|
+
text: JSON.stringify({
|
|
40
|
+
confirmation_required: true,
|
|
41
|
+
tool: this.name,
|
|
42
|
+
message: `Call ${this.name} again with confirm: true to proceed. Nothing was changed.`,
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (this.idempotent) {
|
|
49
|
+
const caller = this.callerKey();
|
|
50
|
+
const key = mcp_idempotency_store_1.McpIdempotencyStore.digest(caller, this.name, args);
|
|
51
|
+
const replay = mcp_idempotency_store_1.McpIdempotencyStore.get(key);
|
|
52
|
+
if (replay !== undefined)
|
|
53
|
+
return replay;
|
|
54
|
+
const originalRequest = this.client.request.bind(this.client);
|
|
55
|
+
this.client.request = (options) => originalRequest({ ...options, headers: { ...(options.headers || {}), 'Idempotency-Key': key } });
|
|
56
|
+
try {
|
|
57
|
+
const result = await this.execute(args);
|
|
58
|
+
if (!result.isError)
|
|
59
|
+
mcp_idempotency_store_1.McpIdempotencyStore.set(key, result);
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
this.client.request = originalRequest;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return this.execute(args);
|
|
67
|
+
}
|
|
68
|
+
callerKey() {
|
|
69
|
+
const user = nestjs_utility_services_1.Auth.user();
|
|
70
|
+
return `${user?.id || 0}:${user?.auth_attributes?.business_id || 0}`;
|
|
18
71
|
}
|
|
19
72
|
async run(call) {
|
|
20
73
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/mcp.tool.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mcp.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/mcp.tool.ts"],"names":[],"mappings":";;;AACA,oFAA8D;AAC9D,6BAAqC;AACrC,yEAAoE;AAEpE,+DAA0D;AAc1D,MAAsB,OAAO;IAYzB,YAA+B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;QANlC,aAAQ,GAAY,KAAK,CAAC;QAC1B,gBAAW,GAAY,KAAK,CAAC;QAC7B,eAAU,GAAY,KAAK,CAAC;Q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AAK,CAAC,CAAC;QAC/B,CAAC;IACL,CAAC;IAES,OAAO,CAAC,IAAa;QAC3B,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7E,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;IAC/D,CAAC;IAES,OAAO,CAAC,KAAc;QAC5B,IAAI,KAAK,YAAY,+BAAa,EAAE,CAAC;YACjC,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;YAC1F,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAChE,CAAC;QACD,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACzE,CAAC;CACJ;AAtGD,0BAsGC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { McpToolResultInterface } from '../interfaces/mcp.tool.result.interface';
|
|
3
|
+
import { McpTool } from './mcp.tool';
|
|
4
|
+
type ReportsListInput = {
|
|
5
|
+
search?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class ReportsListTool extends McpTool<ReportsListInput> {
|
|
8
|
+
readonly name = "reports_list";
|
|
9
|
+
readonly title = "List reports";
|
|
10
|
+
readonly description = "Discover report slugs and titles available to the connected business. Use a slug from this list with reports_run. Returns { rows, total, limit, offset }.";
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
search: z.ZodOptional<z.ZodString>;
|
|
13
|
+
};
|
|
14
|
+
protected readonly readOnly = true;
|
|
15
|
+
readonly requiredScopes: string[];
|
|
16
|
+
execute(args: ReportsListInput): Promise<McpToolResultInterface>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportsListTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const mcp_tool_1 = require("./mcp.tool");
|
|
6
|
+
const inputSchema = {
|
|
7
|
+
search: zod_1.z.string().optional().describe('Optional text search over report title/description.'),
|
|
8
|
+
};
|
|
9
|
+
class ReportsListTool extends mcp_tool_1.McpTool {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.name = 'reports_list';
|
|
13
|
+
this.title = 'List reports';
|
|
14
|
+
this.description = 'Discover report slugs and titles available to the connected business. Use a slug from this list with reports_run. Returns { rows, total, limit, offset }.';
|
|
15
|
+
this.inputSchema = inputSchema;
|
|
16
|
+
this.readOnly = true;
|
|
17
|
+
this.requiredScopes = ['reporting:read'];
|
|
18
|
+
}
|
|
19
|
+
execute(args) {
|
|
20
|
+
const query = args.search ? `?search=${encodeURIComponent(args.search)}` : '';
|
|
21
|
+
return this.run(() => this.client.request({ method: 'GET', path: `v1/b/reports${query}` }));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ReportsListTool = ReportsListTool;
|
|
25
|
+
//# sourceMappingURL=reports.list.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.list.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/reports.list.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,yCAAqC;AAErC,MAAM,WAAW,GAAG;IAChB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;CAChG,CAAC;AAIF,MAAa,eAAgB,SAAQ,kBAAyB;IAA9D;;QACa,SAAI,GAAG,cAAc,CAAC;QACtB,UAAK,GAAG,cAAc,CAAC;QACvB,gBAAW,GAChB,2JAA2J,CAAC;QACvJ,gBAAW,GAAG,WAAW,CAAC;QAChB,aAAQ,GAAG,IAAI,CAAC;QAC1B,mBAAc,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAMjD,CAAC;IAJG,OAAO,CAAC,IAAsB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IAChG,CAAC;CACJ;AAbD,0CAaC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { McpToolResultInterface } from '../interfaces/mcp.tool.result.interface';
|
|
3
|
+
import { McpTool } from './mcp.tool';
|
|
4
|
+
type ReportsRunInput = {
|
|
5
|
+
slug: string;
|
|
6
|
+
date?: Record<string, unknown>;
|
|
7
|
+
start_time?: string;
|
|
8
|
+
end_time?: string;
|
|
9
|
+
filter_query?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare class ReportsRunTool extends McpTool<ReportsRunInput> {
|
|
12
|
+
readonly name = "reports_run";
|
|
13
|
+
readonly title = "Run report";
|
|
14
|
+
readonly description = "Execute a report slug with optional date range and filters. Reproduces the same numbers the portal dashboards show for the connected business and period. Returns the engine payload.";
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
slug: z.ZodString;
|
|
17
|
+
date: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
18
|
+
start_time: z.ZodOptional<z.ZodString>;
|
|
19
|
+
end_time: z.ZodOptional<z.ZodString>;
|
|
20
|
+
filter_query: z.ZodOptional<z.ZodString>;
|
|
21
|
+
};
|
|
22
|
+
protected readonly readOnly = true;
|
|
23
|
+
readonly requiredScopes: string[];
|
|
24
|
+
execute(args: ReportsRunInput): Promise<McpToolResultInterface>;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportsRunTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const mcp_tool_1 = require("./mcp.tool");
|
|
6
|
+
const inputSchema = {
|
|
7
|
+
slug: zod_1.z.string().min(1).max(200).describe('Report slug from reports_list (e.g. an AR dashboard tile slug).'),
|
|
8
|
+
date: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional().describe('Portal date filter object (min/max or preset), same as the dashboard.'),
|
|
9
|
+
start_time: zod_1.z.string().optional().describe('ISO start datetime if not using date.'),
|
|
10
|
+
end_time: zod_1.z.string().optional().describe('ISO end datetime if not using date.'),
|
|
11
|
+
filter_query: zod_1.z.string().optional().describe('Additional SQL-like filter_query honored by the report engine.'),
|
|
12
|
+
};
|
|
13
|
+
class ReportsRunTool extends mcp_tool_1.McpTool {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.name = 'reports_run';
|
|
17
|
+
this.title = 'Run report';
|
|
18
|
+
this.description = 'Execute a report slug with optional date range and filters. Reproduces the same numbers the portal dashboards show for the connected business and period. Returns the engine payload.';
|
|
19
|
+
this.inputSchema = inputSchema;
|
|
20
|
+
this.readOnly = true;
|
|
21
|
+
this.requiredScopes = ['reporting:read'];
|
|
22
|
+
}
|
|
23
|
+
execute(args) {
|
|
24
|
+
const { slug, ...body } = args;
|
|
25
|
+
return this.run(() => this.client.request({ method: 'POST', path: `v1/b/reports/${encodeURIComponent(slug)}/run`, body }));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.ReportsRunTool = ReportsRunTool;
|
|
29
|
+
//# sourceMappingURL=reports.run.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.run.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/reports.run.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,yCAAqC;AAErC,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,iEAAiE,CAAC;IAC5G,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uEAAuE,CAAC;IACpI,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IACnF,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAC/E,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gEAAgE,CAAC;CACjH,CAAC;AAUF,MAAa,cAAe,SAAQ,kBAAwB;IAA5D;;QACa,SAAI,GAAG,aAAa,CAAC;QACrB,UAAK,GAAG,YAAY,CAAC;QACrB,gBAAW,GAChB,uLAAuL,CAAC;QACnL,gBAAW,GAAG,WAAW,CAAC;QAChB,aAAQ,GAAG,IAAI,CAAC;QAC1B,mBAAc,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAQjD,CAAC;IANG,OAAO,CAAC,IAAqB;QACzB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;QAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CACjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CACtG,CAAC;IACN,CAAC;CACJ;AAfD,wCAeC"}
|
|
@@ -27,6 +27,8 @@ export declare class SaveListingPreferenceTool extends McpTool<SaveListingPrefer
|
|
|
27
27
|
user_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
28
28
|
group_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
29
29
|
};
|
|
30
|
+
readonly requiredScopes: string[];
|
|
31
|
+
protected readonly idempotent = true;
|
|
30
32
|
execute(args: SaveListingPreferenceInput): Promise<McpToolResultInterface>;
|
|
31
33
|
}
|
|
32
34
|
export {};
|
|
@@ -29,8 +29,11 @@ class SaveListingPreferenceTool extends mcp_tool_1.McpTool {
|
|
|
29
29
|
this.name = 'save_listing_preference';
|
|
30
30
|
this.title = 'Save listing preference';
|
|
31
31
|
this.description = 'Create or update a listing preference (column layout, filters, and visibility) for a listing page. ' +
|
|
32
|
-
'Provide `id` to update an existing preference, omit it to create one. Returns the saved preference.'
|
|
32
|
+
'Provide `id` to update an existing preference, omit it to create one. Returns the saved preference. ' +
|
|
33
|
+
'Requires the mcp scope (not reporting:read-only).';
|
|
33
34
|
this.inputSchema = inputSchema;
|
|
35
|
+
this.requiredScopes = ['mcp'];
|
|
36
|
+
this.idempotent = true;
|
|
34
37
|
}
|
|
35
38
|
execute(args) {
|
|
36
39
|
const { slug, ...body } = args;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save.listing.preference.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/save.listing.preference.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,yCAAqC;AAErC,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAErD,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IACzF,EAAE,EAAE,OAAC;SACA,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CAAC,6FAA6F,CAAC;IAC5G,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oEAAoE,CAAC;IAChH,iBAAiB,EAAE,UAAU,CAAC,QAAQ,CAAC,4FAA4F,CAAC;IACpI,gBAAgB,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;IACrG,SAAS,EAAE,OAAC;SACP,OAAO,EAAE;SACT,QAAQ,CACL,kIAAkI;QAC9H,uHAAuH,CAC9H;IACL,YAAY,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACpF,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IACjH,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC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pF,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IACjH,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;CACtH,CAAC;AAkBF,MAAa,yBAA0B,SAAQ,kBAAmC;IAAlF;;QACa,SAAI,GAAG,yBAAyB,CAAC;QACjC,UAAK,GAAG,yBAAyB,CAAC;QAClC,gBAAW,GAChB,qGAAqG;YACrG,sGAAsG;YACtG,mDAAmD,CAAC;QAC/C,gBAAW,GAAG,WAAW,CAAC;QAC1B,mBAAc,GAAG,CAAC,KAAK,CAAC,CAAC;QACf,eAAU,GAAG,IAAI,CAAC;IAOzC,CAAC;IALG,OAAO,CAAC,IAAgC;QACpC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;QAE/B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAChI,CAAC;CACJ;AAhBD,8DAgBC"}
|
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ToolRegistry = void 0;
|
|
4
|
+
const ap_tool_registry_1 = require("./ap.tool.registry");
|
|
5
|
+
const ar_tool_registry_1 = require("./ar.tool.registry");
|
|
4
6
|
const delete_listing_preference_tool_1 = require("./delete.listing.preference.tool");
|
|
5
|
-
const
|
|
7
|
+
const listing_describe_tool_1 = require("./listing.describe.tool");
|
|
8
|
+
const listing_query_tool_1 = require("./listing.query.tool");
|
|
9
|
+
const listings_list_tool_1 = require("./listings.list.tool");
|
|
10
|
+
const reports_list_tool_1 = require("./reports.list.tool");
|
|
11
|
+
const reports_run_tool_1 = require("./reports.run.tool");
|
|
6
12
|
const save_listing_preference_tool_1 = require("./save.listing.preference.tool");
|
|
13
|
+
const whoami_tool_1 = require("./whoami.tool");
|
|
7
14
|
class ToolRegistry {
|
|
8
15
|
constructor(client) {
|
|
9
16
|
this.client = client;
|
|
10
17
|
}
|
|
11
18
|
tools() {
|
|
12
|
-
return [
|
|
19
|
+
return [
|
|
20
|
+
new whoami_tool_1.WhoamiTool(this.client),
|
|
21
|
+
new reports_list_tool_1.ReportsListTool(this.client),
|
|
22
|
+
new reports_run_tool_1.ReportsRunTool(this.client),
|
|
23
|
+
new listings_list_tool_1.ListingsListTool(this.client),
|
|
24
|
+
new listing_describe_tool_1.ListingDescribeTool(this.client),
|
|
25
|
+
new listing_query_tool_1.ListingQueryTool(this.client),
|
|
26
|
+
new save_listing_preference_tool_1.SaveListingPreferenceTool(this.client),
|
|
27
|
+
new delete_listing_preference_tool_1.DeleteListingPreferenceTool(this.client),
|
|
28
|
+
...new ap_tool_registry_1.ApToolRegistry(this.client).tools(),
|
|
29
|
+
...new ar_tool_registry_1.ArToolRegistry(this.client).tools(),
|
|
30
|
+
];
|
|
13
31
|
}
|
|
14
32
|
}
|
|
15
33
|
exports.ToolRegistry = ToolRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.registry.js","sourceRoot":"","sources":["../../../src/mcp/tools/tool.registry.ts"],"names":[],"mappings":";;;AAEA,qFAA+E;AAC/E,yDAAoD;AACpD,iFAA2E;
|
|
1
|
+
{"version":3,"file":"tool.registry.js","sourceRoot":"","sources":["../../../src/mcp/tools/tool.registry.ts"],"names":[],"mappings":";;;AAEA,yDAAoD;AACpD,yDAAoD;AACpD,qFAA+E;AAC/E,mEAA8D;AAC9D,6DAAwD;AACxD,6DAAwD;AACxD,2DAAsD;AACtD,yDAAoD;AACpD,iFAA2E;AAC3E,+CAA2C;AAM3C,MAAa,YAAY;IACrB,YAA6B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAEvD,KAAK;QACD,OAAO;YACH,IAAI,wBAAU,CAAC,IAAI,CAAC,MAAM,CAAC;YAC3B,IAAI,mCAAe,CAAC,IAAI,CAAC,MAAM,CAAC;YAChC,IAAI,iCAAc,CAAC,IAAI,CAAC,MAAM,CAAC;YAC/B,IAAI,qCAAgB,CAAC,IAAI,CAAC,MAAM,CAAC;YACjC,IAAI,2CAAmB,CAAC,IAAI,CAAC,MAAM,CAAC;YACpC,IAAI,qCAAgB,CAAC,IAAI,CAAC,MAAM,CAAC;YACjC,IAAI,wDAAyB,CAAC,IAAI,CAAC,MAAM,CAAC;YAC1C,IAAI,4DAA2B,CAAC,IAAI,CAAC,MAAM,CAAC;YAC5C,GAAG,IAAI,iCAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE;YAC1C,GAAG,IAAI,iCAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE;SAC7C,CAAC;IACN,CAAC;CACJ;AAjBD,oCAiBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpToolResultInterface } from '../interfaces/mcp.tool.result.interface';
|
|
2
|
+
import { McpTool } from './mcp.tool';
|
|
3
|
+
export declare class WhoamiTool extends McpTool<Record<string, never>> {
|
|
4
|
+
readonly name = "whoami";
|
|
5
|
+
readonly title = "Who am I";
|
|
6
|
+
readonly description = "Who you are connected as \u2014 user, business, role, read_only, credential kind, and server time. Call this first in a session to orient, and whenever a permissions error makes you unsure what you are allowed to see.";
|
|
7
|
+
readonly inputSchema: {};
|
|
8
|
+
protected readonly readOnly = true;
|
|
9
|
+
execute(): Promise<McpToolResultInterface>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WhoamiTool = void 0;
|
|
4
|
+
const mcp_tool_1 = require("./mcp.tool");
|
|
5
|
+
class WhoamiTool extends mcp_tool_1.McpTool {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.name = 'whoami';
|
|
9
|
+
this.title = 'Who am I';
|
|
10
|
+
this.description = 'Who you are connected as — user, business, role, read_only, credential kind, and server time. Call this first in a session to orient, and whenever a permissions error makes you unsure what you are allowed to see.';
|
|
11
|
+
this.inputSchema = {};
|
|
12
|
+
this.readOnly = true;
|
|
13
|
+
}
|
|
14
|
+
execute() {
|
|
15
|
+
return this.run(() => this.client.request({ method: 'GET', path: 'v1/b/whoami' }));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.WhoamiTool = WhoamiTool;
|
|
19
|
+
//# sourceMappingURL=whoami.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whoami.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/whoami.tool.ts"],"names":[],"mappings":";;;AACA,yCAAqC;AAMrC,MAAa,UAAW,SAAQ,kBAA8B;IAA9D;;QACa,SAAI,GAAG,QAAQ,CAAC;QAChB,UAAK,GAAG,UAAU,CAAC;QACnB,gBAAW,GAChB,sNAAsN,CAAC;QAClN,gBAAW,GAAG,EAAE,CAAC;QACP,aAAQ,GAAG,IAAI,CAAC;IAKvC,CAAC;IAHG,OAAO;QACH,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;IACvF,CAAC;CACJ;AAXD,gCAWC"}
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { McpToolResultInterface } from '../interfaces/mcp.tool.result.interface';
|
|
3
|
-
import { McpTool } from './mcp.tool';
|
|
4
|
-
type GetListingInput = {
|
|
5
|
-
slug: string;
|
|
6
|
-
};
|
|
7
|
-
export declare class GetListingTool extends McpTool<GetListingInput> {
|
|
8
|
-
readonly name = "get_listing";
|
|
9
|
-
readonly title = "Get listing page";
|
|
10
|
-
readonly description: string;
|
|
11
|
-
readonly inputSchema: {
|
|
12
|
-
slug: z.ZodString;
|
|
13
|
-
};
|
|
14
|
-
protected readonly readOnly = true;
|
|
15
|
-
execute(args: GetListingInput): Promise<McpToolResultInterface>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get.listing.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/get.listing.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,yCAAqC;AAErC,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,kEAAkE,CAAC;CAChH,CAAC;AAQF,MAAa,cAAe,SAAQ,kBAAwB;IAA5D;;QACa,SAAI,GAAG,aAAa,CAAC;QACrB,UAAK,GAAG,kBAAkB,CAAC;QAC3B,gBAAW,GAChB,gHAAgH;YAChH,oGAAoG,CAAC;QAChG,gBAAW,GAAG,WAAW,CAAC;QAChB,aAAQ,GAAG,IAAI,CAAC;IAKvC,CAAC;IAHG,OAAO,CAAC,IAAqB;QACzB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9H,CAAC;CACJ;AAZD,wCAYC"}
|