@ratio-mcp-sandbox/docs-server 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +16 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/schemas/oauth.json +71 -0
  6. package/dist/schemas/orders.json +167 -0
  7. package/dist/schemas/products.json +167 -0
  8. package/dist/schemas/schemas/oauth.json +71 -0
  9. package/dist/schemas/schemas/orders.json +167 -0
  10. package/dist/schemas/schemas/products.json +167 -0
  11. package/dist/schemas/schemas/scopes.json +52 -0
  12. package/dist/schemas/schemas/webhooks.json +69 -0
  13. package/dist/schemas/scopes.json +52 -0
  14. package/dist/schemas/webhooks.json +69 -0
  15. package/dist/server.d.ts +6 -0
  16. package/dist/server.d.ts.map +1 -0
  17. package/dist/server.js +87 -0
  18. package/dist/server.js.map +1 -0
  19. package/dist/tools/get-api-reference.d.ts +60 -0
  20. package/dist/tools/get-api-reference.d.ts.map +1 -0
  21. package/dist/tools/get-api-reference.js +53 -0
  22. package/dist/tools/get-api-reference.js.map +1 -0
  23. package/dist/tools/get-scope-map.d.ts +17 -0
  24. package/dist/tools/get-scope-map.d.ts.map +1 -0
  25. package/dist/tools/get-scope-map.js +102 -0
  26. package/dist/tools/get-scope-map.js.map +1 -0
  27. package/dist/tools/get-scopes.d.ts +63 -0
  28. package/dist/tools/get-scopes.d.ts.map +1 -0
  29. package/dist/tools/get-scopes.js +72 -0
  30. package/dist/tools/get-scopes.js.map +1 -0
  31. package/dist/tools/get-webhooks.d.ts +30 -0
  32. package/dist/tools/get-webhooks.d.ts.map +1 -0
  33. package/dist/tools/get-webhooks.js +32 -0
  34. package/dist/tools/get-webhooks.js.map +1 -0
  35. package/dist/tools/index.d.ts +15 -0
  36. package/dist/tools/index.d.ts.map +1 -0
  37. package/dist/tools/index.js +110 -0
  38. package/dist/tools/index.js.map +1 -0
  39. package/dist/tools/lookup-docs.d.ts +58 -0
  40. package/dist/tools/lookup-docs.d.ts.map +1 -0
  41. package/dist/tools/lookup-docs.js +211 -0
  42. package/dist/tools/lookup-docs.js.map +1 -0
  43. package/dist/tools/validate-code.d.ts +12 -0
  44. package/dist/tools/validate-code.d.ts.map +1 -0
  45. package/dist/tools/validate-code.js +185 -0
  46. package/dist/tools/validate-code.js.map +1 -0
  47. package/dist/utils/logger.d.ts +16 -0
  48. package/dist/utils/logger.d.ts.map +1 -0
  49. package/dist/utils/logger.js +85 -0
  50. package/dist/utils/logger.js.map +1 -0
  51. package/dist/utils/schema-loader.d.ts +13 -0
  52. package/dist/utils/schema-loader.d.ts.map +1 -0
  53. package/dist/utils/schema-loader.js +61 -0
  54. package/dist/utils/schema-loader.js.map +1 -0
  55. package/dist/utils/zod-to-json.d.ts +7 -0
  56. package/dist/utils/zod-to-json.d.ts.map +1 -0
  57. package/dist/utils/zod-to-json.js +63 -0
  58. package/dist/utils/zod-to-json.js.map +1 -0
  59. package/package.json +28 -0
package/dist/server.js ADDED
@@ -0,0 +1,87 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { DOCS_SERVER_NAME, DOCS_SERVER_VERSION } from '@ratio-mcp-sandbox/shared';
3
+ import { docsTools } from './tools/index.js';
4
+ import { logger } from './utils/logger.js';
5
+ const DOCS_SERVER_INSTRUCTIONS = `You are connected to the Ratio Docs MCP Server — the authoritative reference for the Ratio/OpenStore platform API.
6
+
7
+ PLATFORM TERMINOLOGY (IMPORTANT):
8
+ On the Ratio platform, developers build "apps" (also called "applications") that merchants install on their stores. Users may refer to these as:
9
+ - "agent" / "agents" → same as app / apps
10
+ - "bot" / "bots" → same as app / apps
11
+ - "integration" / "integrations" → same as app / apps
12
+ - "plugin" / "plugins" → same as app / apps
13
+ - "extension" / "extensions" → same as app / apps
14
+
15
+ When the developer says "I want to create an agent" or "build a bot", they mean "create an app on Ratio". Do NOT tell them "Ratio doesn't have agents" — translate their terminology to "app" and guide them through the dev-server tools (developer_login → create_app → gather_requirements → etc.).
16
+
17
+ CRITICAL RULES:
18
+ 1. ALWAYS use these tools BEFORE answering any question about the Ratio platform API, scopes, webhooks, or endpoints. NEVER answer from memory.
19
+ 2. If lookup_docs returns found=false, tell the user the information is not available. NEVER guess or hallucinate.
20
+ 3. ALWAYS call validate_api_code after generating any code that calls Ratio APIs, before presenting it to the developer.
21
+ 4. ALWAYS call get_available_scopes before answering scope-related questions.
22
+ 5. ALWAYS call get_api_reference before answering API endpoint questions.
23
+ 6. ALWAYS call get_webhook_events before answering webhook questions.
24
+
25
+ TOOL USAGE:
26
+ - lookup_docs: Unified search across all documentation. Use as the MANDATORY fallback when unsure about ANY platform detail. Understands aliases like agent, bot, integration, plugin (all map to "app").
27
+ - get_available_scopes: Returns all 78 resources with their scopes. Use before discussing scope selection.
28
+ - get_api_reference: Returns endpoints for a specific resource. Use before generating or discussing API calls.
29
+ - get_scope_endpoint_map: Maps scopes to their endpoints. Use before code generation.
30
+ - validate_api_code: Validates generated NestJS code against real API schemas. Use AFTER code generation.
31
+ - get_webhook_events: Returns webhook event topics and verification details. Use before discussing webhooks.
32
+
33
+ These tools exist to PREVENT hallucination. The Ratio platform has specific APIs, scopes, and patterns — do not assume you know them. Always verify.
34
+
35
+ CROSS-SERVER RULE:
36
+ When the user asks about the Ratio platform in a general / info-seeking way — "what is Ratio", "how does Ratio work", "what can I build on Ratio", "how do I get started" — your FIRST action is to call ratio-mcp-dev's get_app_lifecycle. That returns the onboarding journey map. The docs-server answers specific API / scope / webhook questions; the dev-server's lifecycle answers "how do I get started". Use both servers together — don't answer general platform questions from memory.`;
37
+ /**
38
+ * Create and configure the Ratio Docs MCP Server
39
+ */
40
+ export function createDocsServer() {
41
+ const server = new McpServer({
42
+ name: DOCS_SERVER_NAME,
43
+ version: DOCS_SERVER_VERSION,
44
+ }, {
45
+ instructions: DOCS_SERVER_INSTRUCTIONS,
46
+ });
47
+ // Register all tools
48
+ for (const tool of docsTools) {
49
+ // Pass Zod shape directly — MCP SDK handles Zod-to-JSON conversion internally
50
+ const shape = tool.inputSchema.shape;
51
+ server.tool(tool.name, tool.description, shape, async (args) => {
52
+ logger.toolCall(tool.name, args);
53
+ const startTime = Date.now();
54
+ try {
55
+ const result = tool.handler(args);
56
+ const duration = Date.now() - startTime;
57
+ logger.toolResult(tool.name, duration, result);
58
+ return {
59
+ content: [
60
+ {
61
+ type: 'text',
62
+ text: JSON.stringify(result, null, 2),
63
+ },
64
+ ],
65
+ };
66
+ }
67
+ catch (error) {
68
+ const duration = Date.now() - startTime;
69
+ logger.toolError(tool.name, duration, error);
70
+ const message = error instanceof Error ? error.message : String(error);
71
+ return {
72
+ content: [
73
+ {
74
+ type: 'text',
75
+ text: JSON.stringify({ error: true, message }, null, 2),
76
+ },
77
+ ],
78
+ isError: true,
79
+ };
80
+ }
81
+ });
82
+ logger.debug(`Registered tool: ${tool.name}`);
83
+ }
84
+ logger.info(`${DOCS_SERVER_NAME} initialized with ${docsTools.length} tools`);
85
+ return server;
86
+ }
87
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;meA+Bkc,CAAC;AAEpe;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;QACE,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,mBAAmB;KAC7B,EACD;QACE,YAAY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IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;yBACxD;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC,CACF,CAAC;QAEF,MAAM,CAAC,KAAK,CAAC,oBAAoB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,gBAAgB,qBAAqB,SAAS,CAAC,MAAM,QAAQ,CAAC,CAAC;IAC9E,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * get_api_reference — Returns complete API reference for a resource.
3
+ * Optionally filters by scope to show only endpoints accessible with that scope.
4
+ */
5
+ export declare function getApiReference(input: {
6
+ resource: string;
7
+ scope_filter?: string;
8
+ }): {
9
+ error: boolean;
10
+ message: string;
11
+ available_resources: string[];
12
+ available_scopes?: undefined;
13
+ resource?: undefined;
14
+ base_url?: undefined;
15
+ auth?: undefined;
16
+ endpoint_count?: undefined;
17
+ endpoints?: undefined;
18
+ schemas?: undefined;
19
+ statuses?: undefined;
20
+ scope_filter_applied?: undefined;
21
+ } | {
22
+ error: boolean;
23
+ message: string;
24
+ available_scopes: string[];
25
+ available_resources?: undefined;
26
+ resource?: undefined;
27
+ base_url?: undefined;
28
+ auth?: undefined;
29
+ endpoint_count?: undefined;
30
+ endpoints?: undefined;
31
+ schemas?: undefined;
32
+ statuses?: undefined;
33
+ scope_filter_applied?: undefined;
34
+ } | {
35
+ resource: string;
36
+ base_url: string;
37
+ auth: Record<string, string> | undefined;
38
+ endpoint_count: number;
39
+ endpoints: {
40
+ method: string;
41
+ path: string;
42
+ controller_order: number;
43
+ handler_name: string;
44
+ required_scope: string;
45
+ summary: string;
46
+ description: string | undefined;
47
+ query_params: import("@ratio-mcp-sandbox/shared").EndpointParam[];
48
+ path_params: import("@ratio-mcp-sandbox/shared").EndpointParam[];
49
+ request_body: Record<string, unknown> | null;
50
+ response_schema: string | null;
51
+ }[];
52
+ schemas: Record<string, unknown>;
53
+ statuses: string[];
54
+ scope_filter_applied: string | null;
55
+ error?: undefined;
56
+ message?: undefined;
57
+ available_resources?: undefined;
58
+ available_scopes?: undefined;
59
+ };
60
+ //# sourceMappingURL=get-api-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-api-reference.d.ts","sourceRoot":"","sources":["../../src/tools/get-api-reference.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDjF"}
@@ -0,0 +1,53 @@
1
+ import { loadResourceSchema, getAvailableResourceFiles } from '../utils/schema-loader.js';
2
+ /**
3
+ * get_api_reference — Returns complete API reference for a resource.
4
+ * Optionally filters by scope to show only endpoints accessible with that scope.
5
+ */
6
+ export function getApiReference(input) {
7
+ const availableResources = getAvailableResourceFiles();
8
+ if (!availableResources.includes(input.resource)) {
9
+ return {
10
+ error: true,
11
+ message: `Unknown resource: "${input.resource}"`,
12
+ available_resources: availableResources,
13
+ };
14
+ }
15
+ const schema = loadResourceSchema(input.resource);
16
+ let endpoints = schema.endpoints;
17
+ // Filter by scope if provided
18
+ if (input.scope_filter) {
19
+ endpoints = endpoints.filter((ep) => ep.required_scope === input.scope_filter);
20
+ if (endpoints.length === 0) {
21
+ return {
22
+ error: true,
23
+ message: `No endpoints found for scope "${input.scope_filter}" in resource "${input.resource}"`,
24
+ available_scopes: [...new Set(schema.endpoints.map((ep) => ep.required_scope))],
25
+ };
26
+ }
27
+ }
28
+ // Sort by controller_order
29
+ endpoints = [...endpoints].sort((a, b) => a.controller_order - b.controller_order);
30
+ return {
31
+ resource: schema.resource,
32
+ base_url: schema.base_url,
33
+ auth: schema.auth,
34
+ endpoint_count: endpoints.length,
35
+ endpoints: endpoints.map((ep) => ({
36
+ method: ep.method,
37
+ path: ep.path,
38
+ controller_order: ep.controller_order,
39
+ handler_name: ep.handler_name,
40
+ required_scope: ep.required_scope,
41
+ summary: ep.summary,
42
+ description: ep.description,
43
+ query_params: ep.query_params || [],
44
+ path_params: ep.path_params || [],
45
+ request_body: ep.request_body || null,
46
+ response_schema: ep.response_schema || null,
47
+ })),
48
+ schemas: schema.schemas,
49
+ statuses: schema.statuses || [],
50
+ scope_filter_applied: input.scope_filter || null,
51
+ };
52
+ }
53
+ //# sourceMappingURL=get-api-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-api-reference.js","sourceRoot":"","sources":["../../src/tools/get-api-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE1F;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAkD;IAChF,MAAM,kBAAkB,GAAG,yBAAyB,EAAE,CAAC;IAEvD,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO;YACL,KAAK,EAAE,IAAI;YACX,OAAO,EAAE,sBAAsB,KAAK,CAAC,QAAQ,GAAG;YAChD,mBAAmB,EAAE,kBAAkB;SACxC,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAElD,IAAI,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IAEjC,8BAA8B;IAC9B,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACvB,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,cAAc,KAAK,KAAK,CAAC,YAAY,CAAC,CAAC;QAC/E,IAAI,SAAS,CAAC,MAAM,KAAK,CAA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C,OAAO;QACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,EAAE;QAC/B,oBAAoB,EAAE,KAAK,CAAC,YAAY,IAAI,IAAI;KACjD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { ScopeEndpointMapping } from '@ratio-mcp-sandbox/shared';
2
+ /**
3
+ * get_scope_endpoint_map — Given a list of scopes, returns exactly which endpoints
4
+ * are unlocked, in controller_order. This is what the codegen reads before generating routes.
5
+ *
6
+ * Works by scanning resource schema files and matching endpoints by required_scope.
7
+ */
8
+ export declare function getScopeEndpointMap(input: {
9
+ scopes: string[];
10
+ }): {
11
+ requested_scopes: string[];
12
+ resolved_scopes: string[];
13
+ total_endpoints: number;
14
+ mappings: ScopeEndpointMapping[];
15
+ _instruction: string;
16
+ };
17
+ //# sourceMappingURL=get-scope-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-scope-map.d.ts","sourceRoot":"","sources":["../../src/tools/get-scope-map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AA6BtE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE;;;;;;EAgF9D"}
@@ -0,0 +1,102 @@
1
+ import { loadResourceSchema } from '../utils/schema-loader.js';
2
+ /**
3
+ * Resolve scope inheritance:
4
+ * - write_X includes read_X
5
+ * - delete_X includes write_X and read_X
6
+ * - order-create / order-update / order-cancel include read_orders
7
+ * (these are custom scopes that don't follow the write_X pattern)
8
+ */
9
+ function resolveInheritedScopes(scopes) {
10
+ const resolved = new Set(scopes);
11
+ for (const scope of scopes) {
12
+ if (scope.startsWith('write_')) {
13
+ const resource = scope.replace('write_', '');
14
+ resolved.add(`read_${resource}`);
15
+ }
16
+ else if (scope.startsWith('delete_')) {
17
+ const resource = scope.replace('delete_', '');
18
+ resolved.add(`write_${resource}`);
19
+ resolved.add(`read_${resource}`);
20
+ }
21
+ else if (['order-create', 'order-update', 'order-cancel'].includes(scope)) {
22
+ // Custom order scopes inherit read_orders
23
+ resolved.add('read_orders');
24
+ }
25
+ }
26
+ return resolved;
27
+ }
28
+ /**
29
+ * get_scope_endpoint_map — Given a list of scopes, returns exactly which endpoints
30
+ * are unlocked, in controller_order. This is what the codegen reads before generating routes.
31
+ *
32
+ * Works by scanning resource schema files and matching endpoints by required_scope.
33
+ */
34
+ export function getScopeEndpointMap(input) {
35
+ const result = [];
36
+ // Resolve scope inheritance
37
+ const resolvedScopes = resolveInheritedScopes(input.scopes);
38
+ // Determine which resources to scan based on scope names
39
+ // Scope format: read_orders → resource "orders", write_products → resource "products"
40
+ const resourceNames = new Set();
41
+ for (const scope of resolvedScopes) {
42
+ // Extract resource name by removing the prefix (read_, write_, delete_, or custom like order-create)
43
+ const match = scope.match(/^(?:read_|write_|delete_)(.+)$/);
44
+ if (match) {
45
+ resourceNames.add(match[1]);
46
+ }
47
+ else {
48
+ // For custom scopes like "order-create", try to extract resource from the scope code
49
+ const parts = scope.split(/[-_]/);
50
+ if (parts.length > 0) {
51
+ resourceNames.add(parts[0]);
52
+ // Also try plural form
53
+ resourceNames.add(parts[0] + 's');
54
+ }
55
+ }
56
+ }
57
+ // Group endpoints by resource
58
+ const endpointsByResource = new Map();
59
+ for (const resourceName of resourceNames) {
60
+ try {
61
+ const resourceSchema = loadResourceSchema(resourceName);
62
+ const matchingEndpoints = resourceSchema.endpoints
63
+ .filter((ep) => resolvedScopes.has(ep.required_scope))
64
+ .map((ep) => ({
65
+ method: ep.method,
66
+ path: ep.path,
67
+ controller_order: ep.controller_order,
68
+ handler_name: ep.handler_name,
69
+ summary: ep.summary,
70
+ required_scope: ep.required_scope,
71
+ }));
72
+ if (matchingEndpoints.length > 0) {
73
+ const existing = endpointsByResource.get(resourceName) || [];
74
+ existing.push(...matchingEndpoints);
75
+ endpointsByResource.set(resourceName, existing);
76
+ }
77
+ }
78
+ catch {
79
+ // Resource schema file not found — skip
80
+ }
81
+ }
82
+ // Build result sorted by controller_order within each resource
83
+ for (const [resourceName, endpoints] of endpointsByResource) {
84
+ const sorted = endpoints.sort((a, b) => a.controller_order - b.controller_order);
85
+ result.push({
86
+ scope: input.scopes.filter((s) => {
87
+ const match = s.match(/^(?:read_|write_|delete_)(.+)$/);
88
+ return match && match[1] === resourceName;
89
+ }).join(', '),
90
+ resource: resourceName,
91
+ endpoints: sorted,
92
+ });
93
+ }
94
+ return {
95
+ requested_scopes: input.scopes,
96
+ resolved_scopes: [...resolvedScopes],
97
+ total_endpoints: result.reduce((sum, r) => sum + r.endpoints.length, 0),
98
+ mappings: result,
99
+ _instruction: 'Use these endpoints in controller_order for deterministic code generation.',
100
+ };
101
+ }
102
+ //# sourceMappingURL=get-scope-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-scope-map.js","sourceRoot":"","sources":["../../src/tools/get-scope-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA6B,MAAM,2BAA2B,CAAC;AAG1F;;;;;;GAMG;AACH,SAAS,sBAAsB,CAAC,MAAgB;IAC9C,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAS,MAAM,CAAC,CAAC;IAEzC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAC7C,QAAQ,CAAC,GAAG,CAAC,QAAQ,QAAQ,EAAE,CAAC,CAAC;QACnC,CAAC;aAAM,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YAC9C,QAAQ,CAAC,GAAG,CAAC,SAAS,QAAQ,EAAE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AAC,CAAC,EAAE,EAAE;gBAC/B,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;gBACxD,OAAO,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC;YAC5C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACb,QAAQ,EAAE,YAAY;YACtB,SAAS,EAAE,MAAM;SAClB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,gBAAgB,EAAE,KAAK,CAAC,MAAM;QAC9B,eAAe,EAAE,CAAC,GAAG,cAAc,CAAC;QACpC,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;QACvE,QAAQ,EAAE,MAAM;QAChB,YAAY,EAAE,4EAA4E;KAC3F,CAAC;AACJ,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * get_available_scopes — Returns all available scopes grouped by primary resource.
3
+ * Returns all scopes from the platform grouped by resource.
4
+ * Data sourced from GET /api/v1/scopes — all 147 scopes across 78 resources.
5
+ */
6
+ export declare function getAvailableScopes(input: {
7
+ resource?: string;
8
+ }): {
9
+ error: boolean;
10
+ message: string;
11
+ available_resources: string[];
12
+ resource?: undefined;
13
+ resource_info?: undefined;
14
+ scopes?: undefined;
15
+ total?: undefined;
16
+ total_resources?: undefined;
17
+ total_scopes?: undefined;
18
+ resources?: undefined;
19
+ _instruction?: undefined;
20
+ } | {
21
+ resource: string;
22
+ resource_info: {
23
+ description: string;
24
+ codegen_ready: boolean;
25
+ commonly_needed_with: string[] | undefined;
26
+ example_app_types: string[] | undefined;
27
+ } | undefined;
28
+ scopes: {
29
+ code: string;
30
+ label: string;
31
+ }[];
32
+ total: number;
33
+ error?: undefined;
34
+ message?: undefined;
35
+ available_resources?: undefined;
36
+ total_resources?: undefined;
37
+ total_scopes?: undefined;
38
+ resources?: undefined;
39
+ _instruction?: undefined;
40
+ } | {
41
+ total_resources: number;
42
+ total_scopes: number;
43
+ resources: {
44
+ resource: string;
45
+ description: string;
46
+ codegen_ready: boolean;
47
+ is_primary: boolean;
48
+ scopes: {
49
+ code: string;
50
+ label: string;
51
+ }[];
52
+ count: number;
53
+ }[];
54
+ _instruction: string;
55
+ error?: undefined;
56
+ message?: undefined;
57
+ available_resources?: undefined;
58
+ resource?: undefined;
59
+ resource_info?: undefined;
60
+ scopes?: undefined;
61
+ total?: undefined;
62
+ };
63
+ //# sourceMappingURL=get-scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-scopes.d.ts","sourceRoot":"","sources":["../../src/tools/get-scopes.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqE9D"}
@@ -0,0 +1,72 @@
1
+ import { SCOPES_BY_RESOURCE, PRIMARY_RESOURCES, RESOURCE_METADATA, getAllResources } from '@ratio-mcp-sandbox/shared';
2
+ /**
3
+ * get_available_scopes — Returns all available scopes grouped by primary resource.
4
+ * Returns all scopes from the platform grouped by resource.
5
+ * Data sourced from GET /api/v1/scopes — all 147 scopes across 78 resources.
6
+ */
7
+ export function getAvailableScopes(input) {
8
+ if (input.resource) {
9
+ const resourceScopes = SCOPES_BY_RESOURCE[input.resource];
10
+ const resourceMeta = RESOURCE_METADATA[input.resource];
11
+ if (!resourceScopes) {
12
+ return {
13
+ error: true,
14
+ message: `Unknown resource: "${input.resource}"`,
15
+ available_resources: getAllResources(),
16
+ };
17
+ }
18
+ return {
19
+ resource: input.resource,
20
+ resource_info: resourceMeta
21
+ ? {
22
+ description: resourceMeta.description,
23
+ codegen_ready: resourceMeta.codegen_ready,
24
+ commonly_needed_with: resourceMeta.commonly_needed_with,
25
+ example_app_types: resourceMeta.example_app_types,
26
+ }
27
+ : undefined,
28
+ scopes: resourceScopes.map((s) => ({
29
+ code: s.code,
30
+ label: s.label,
31
+ })),
32
+ total: resourceScopes.length,
33
+ };
34
+ }
35
+ // Return ALL resources with their scopes — primary resources first with metadata, then the rest
36
+ const allResourceNames = getAllResources();
37
+ const primarySet = new Set(PRIMARY_RESOURCES);
38
+ const resources = allResourceNames.map((resourceName) => {
39
+ const scopes = SCOPES_BY_RESOURCE[resourceName] || [];
40
+ const meta = RESOURCE_METADATA[resourceName];
41
+ return {
42
+ resource: resourceName,
43
+ description: meta?.description || '',
44
+ codegen_ready: meta?.codegen_ready || false,
45
+ is_primary: primarySet.has(resourceName),
46
+ scopes: scopes.map((s) => ({
47
+ code: s.code,
48
+ label: s.label,
49
+ })),
50
+ count: scopes.length,
51
+ };
52
+ })
53
+ // Sort: primary resources first, then alphabetical
54
+ .sort((a, b) => {
55
+ if (a.is_primary && !b.is_primary)
56
+ return -1;
57
+ if (!a.is_primary && b.is_primary)
58
+ return 1;
59
+ return a.resource.localeCompare(b.resource);
60
+ });
61
+ return {
62
+ total_resources: resources.length,
63
+ total_scopes: resources.reduce((sum, r) => sum + r.count, 0),
64
+ resources,
65
+ _instruction: 'These are ALL scopes available on the platform (sourced from the real API). ' +
66
+ 'Primary resources are listed first — these are the most commonly needed. ' +
67
+ 'codegen_ready=true means generate_api_routes can auto-generate backend code for that resource. ' +
68
+ 'Present the scopes to the developer grouped by resource. Let them pick what they need. ' +
69
+ 'After selecting scopes, call define_app_requirements with confirmed=false for preview, then confirmed=true.',
70
+ };
71
+ }
72
+ //# sourceMappingURL=get-scopes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-scopes.js","sourceRoot":"","sources":["../../src/tools/get-scopes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AA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C,YAAY,CAAC,CAAC;QAE7C,OAAO;YACL,QAAQ,EAAE,YAAY;YACtB,WAAW,EAAE,IAAI,EAAE,WAAW,IAAI,EAAE;YACpC,aAAa,EAAE,IAAI,EAAE,aAAa,IAAI,KAAK;YAC3C,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC;YACxC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACzB,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,KAAK,EAAE,CAAC,CAAC,KAAK;aACf,CAAC,CAAC;YACH,KAAK,EAAE,MAAM,CAAC,MAAM;SACrB,CAAC;IACJ,CAAC,CAAC;QACF,mDAAmD;SAClD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACb,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,UAAU;YAAE,OAAO,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU;YAAE,OAAO,CAAC,CAAC;QAC5C,OAAO,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,eAAe,EAAE,SAAS,CAAC,MAAM;QACjC,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QAC5D,SAAS;QACT,YAAY,EACV,8EAA8E;YAC9E,2EAA2E;YAC3E,iGAAiG;YACjG,yFAAyF;YACzF,6GAA6G;KAChH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * get_webhook_events — Returns available webhook events, optionally filtered by resource.
3
+ */
4
+ export declare function getWebhookEvents(input: {
5
+ resource?: string;
6
+ }): {
7
+ error: boolean;
8
+ message: string;
9
+ available_resources: string[];
10
+ total_events?: undefined;
11
+ verification?: undefined;
12
+ retry_policy?: undefined;
13
+ events?: undefined;
14
+ resource_filter?: undefined;
15
+ } | {
16
+ total_events: number;
17
+ verification: Record<string, string> | undefined;
18
+ retry_policy: Record<string, unknown> | undefined;
19
+ events: {
20
+ topic: string;
21
+ description: string;
22
+ resource: string;
23
+ required_scope: string | null | undefined;
24
+ }[];
25
+ resource_filter: string | null;
26
+ error?: undefined;
27
+ message?: undefined;
28
+ available_resources?: undefined;
29
+ };
30
+ //# sourceMappingURL=get-webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-webhooks.d.ts","sourceRoot":"","sources":["../../src/tools/get-webhooks.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;EA6B5D"}
@@ -0,0 +1,32 @@
1
+ import { loadWebhooks } from '../utils/schema-loader.js';
2
+ /**
3
+ * get_webhook_events — Returns available webhook events, optionally filtered by resource.
4
+ */
5
+ export function getWebhookEvents(input) {
6
+ const webhooks = loadWebhooks();
7
+ let events = webhooks.events;
8
+ if (input.resource) {
9
+ events = events.filter((e) => e.resource === input.resource);
10
+ if (events.length === 0) {
11
+ const availableResources = [...new Set(webhooks.events.map((e) => e.resource))];
12
+ return {
13
+ error: true,
14
+ message: `No webhook events found for resource: "${input.resource}"`,
15
+ available_resources: availableResources,
16
+ };
17
+ }
18
+ }
19
+ return {
20
+ total_events: events.length,
21
+ verification: webhooks.verification,
22
+ retry_policy: webhooks.retry_policy,
23
+ events: events.map((e) => ({
24
+ topic: e.topic,
25
+ description: e.description,
26
+ resource: e.resource,
27
+ required_scope: e.required_scope,
28
+ })),
29
+ resource_filter: input.resource || null,
30
+ };
31
+ }
32
+ //# sourceMappingURL=get-webhooks.js.map
@@ -0,0 +1 @@
1
+ {"version":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C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Tool definition for MCP registration
4
+ */
5
+ export interface ToolDefinition {
6
+ name: string;
7
+ description: string;
8
+ inputSchema: z.ZodType;
9
+ handler: (input: Record<string, unknown>) => unknown;
10
+ }
11
+ /**
12
+ * All docs-server tools (6 tools)
13
+ */
14
+ export declare const docsTools: ToolDefinition[];
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC;IACvB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;CACtD;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,cAAc,EAyGrC,CAAC"}