@ratio-mcp/docs-server 1.2.0 → 1.4.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/schemas/products.json +5 -5
- package/dist/schemas/schemas/products.json +5 -5
- package/dist/tools/get-scopes.d.ts +5 -15
- package/dist/tools/get-scopes.d.ts.map +1 -1
- package/dist/tools/get-scopes.js +22 -24
- package/dist/tools/get-scopes.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +39 -14
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/lookup-docs.d.ts +58 -0
- package/dist/tools/lookup-docs.d.ts.map +1 -0
- package/dist/tools/lookup-docs.js +181 -0
- package/dist/tools/lookup-docs.js.map +1 -0
- package/dist/utils/logger.js +7 -7
- package/dist/utils/logger.js.map +1 -1
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"endpoints": [
|
|
10
10
|
{
|
|
11
11
|
"method": "GET",
|
|
12
|
-
"path": "/api/v1/products",
|
|
12
|
+
"path": "/api/v1/v1/products",
|
|
13
13
|
"controller_order": 1,
|
|
14
14
|
"handler_name": "getProducts",
|
|
15
15
|
"required_scope": "read_products",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"method": "GET",
|
|
38
|
-
"path": "/api/v1/products/:id",
|
|
38
|
+
"path": "/api/v1/v1/products/:id",
|
|
39
39
|
"controller_order": 2,
|
|
40
40
|
"handler_name": "getProductById",
|
|
41
41
|
"required_scope": "read_products",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"method": "POST",
|
|
55
|
-
"path": "/api/v1/products",
|
|
55
|
+
"path": "/api/v1/v1/products",
|
|
56
56
|
"controller_order": 3,
|
|
57
57
|
"handler_name": "createProduct",
|
|
58
58
|
"required_scope": "write_products",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
"method": "PUT",
|
|
93
|
-
"path": "/api/v1/products/:id",
|
|
93
|
+
"path": "/api/v1/v1/products/:id",
|
|
94
94
|
"controller_order": 4,
|
|
95
95
|
"handler_name": "updateProduct",
|
|
96
96
|
"required_scope": "write_products",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
"method": "DELETE",
|
|
130
|
-
"path": "/api/v1/products/:id",
|
|
130
|
+
"path": "/api/v1/v1/products/:id",
|
|
131
131
|
"controller_order": 5,
|
|
132
132
|
"handler_name": "deleteProduct",
|
|
133
133
|
"required_scope": "write_products",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"endpoints": [
|
|
10
10
|
{
|
|
11
11
|
"method": "GET",
|
|
12
|
-
"path": "/api/v1/products",
|
|
12
|
+
"path": "/api/v1/v1/products",
|
|
13
13
|
"controller_order": 1,
|
|
14
14
|
"handler_name": "getProducts",
|
|
15
15
|
"required_scope": "read_products",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"method": "GET",
|
|
38
|
-
"path": "/api/v1/products/:id",
|
|
38
|
+
"path": "/api/v1/v1/products/:id",
|
|
39
39
|
"controller_order": 2,
|
|
40
40
|
"handler_name": "getProductById",
|
|
41
41
|
"required_scope": "read_products",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"method": "POST",
|
|
55
|
-
"path": "/api/v1/products",
|
|
55
|
+
"path": "/api/v1/v1/products",
|
|
56
56
|
"controller_order": 3,
|
|
57
57
|
"handler_name": "createProduct",
|
|
58
58
|
"required_scope": "write_products",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
"method": "PUT",
|
|
93
|
-
"path": "/api/v1/products/:id",
|
|
93
|
+
"path": "/api/v1/v1/products/:id",
|
|
94
94
|
"controller_order": 4,
|
|
95
95
|
"handler_name": "updateProduct",
|
|
96
96
|
"required_scope": "write_products",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
"method": "DELETE",
|
|
130
|
-
"path": "/api/v1/products/:id",
|
|
130
|
+
"path": "/api/v1/v1/products/:id",
|
|
131
131
|
"controller_order": 5,
|
|
132
132
|
"handler_name": "deleteProduct",
|
|
133
133
|
"required_scope": "write_products",
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* get_available_scopes — Returns all available scopes grouped by primary resource.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* This enriched data allows the LLM to intelligently suggest scopes based on
|
|
7
|
-
* a developer's app description, without needing a separate recommendation tool.
|
|
3
|
+
* Returns all scopes from the platform grouped by resource.
|
|
4
|
+
* Data sourced from GET /api/v1/scopes — all 147 scopes across 78 resources.
|
|
8
5
|
*/
|
|
9
6
|
export declare function getAvailableScopes(input: {
|
|
10
7
|
resource?: string;
|
|
11
8
|
}): {
|
|
12
9
|
error: boolean;
|
|
13
10
|
message: string;
|
|
14
|
-
available_resources:
|
|
11
|
+
available_resources: string[];
|
|
15
12
|
resource?: undefined;
|
|
16
13
|
resource_info?: undefined;
|
|
17
14
|
scopes?: undefined;
|
|
@@ -31,9 +28,6 @@ export declare function getAvailableScopes(input: {
|
|
|
31
28
|
scopes: {
|
|
32
29
|
code: string;
|
|
33
30
|
label: string;
|
|
34
|
-
description: string;
|
|
35
|
-
use_cases: string[];
|
|
36
|
-
commonly_paired_with: string[] | undefined;
|
|
37
31
|
}[];
|
|
38
32
|
total: number;
|
|
39
33
|
error?: undefined;
|
|
@@ -47,17 +41,13 @@ export declare function getAvailableScopes(input: {
|
|
|
47
41
|
total_resources: number;
|
|
48
42
|
total_scopes: number;
|
|
49
43
|
resources: {
|
|
50
|
-
resource:
|
|
44
|
+
resource: string;
|
|
51
45
|
description: string;
|
|
52
46
|
codegen_ready: boolean;
|
|
53
|
-
|
|
54
|
-
example_app_types: string[];
|
|
47
|
+
is_primary: boolean;
|
|
55
48
|
scopes: {
|
|
56
49
|
code: string;
|
|
57
50
|
label: string;
|
|
58
|
-
description: string;
|
|
59
|
-
use_cases: string[];
|
|
60
|
-
commonly_paired_with: string[] | undefined;
|
|
61
51
|
}[];
|
|
62
52
|
count: number;
|
|
63
53
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-scopes.d.ts","sourceRoot":"","sources":["../../src/tools/get-scopes.ts"],"names":[],"mappings":"AAEA
|
|
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"}
|
package/dist/tools/get-scopes.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { SCOPES_BY_RESOURCE, PRIMARY_RESOURCES, RESOURCE_METADATA } from '@ratio-mcp/shared';
|
|
1
|
+
import { SCOPES_BY_RESOURCE, PRIMARY_RESOURCES, RESOURCE_METADATA, getAllResources } from '@ratio-mcp/shared';
|
|
2
2
|
/**
|
|
3
3
|
* get_available_scopes — Returns all available scopes grouped by primary resource.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* This enriched data allows the LLM to intelligently suggest scopes based on
|
|
8
|
-
* a developer's app description, without needing a separate recommendation tool.
|
|
4
|
+
* Returns all scopes from the platform grouped by resource.
|
|
5
|
+
* Data sourced from GET /api/v1/scopes — all 147 scopes across 78 resources.
|
|
9
6
|
*/
|
|
10
7
|
export function getAvailableScopes(input) {
|
|
11
8
|
if (input.resource) {
|
|
@@ -15,7 +12,7 @@ export function getAvailableScopes(input) {
|
|
|
15
12
|
return {
|
|
16
13
|
error: true,
|
|
17
14
|
message: `Unknown resource: "${input.resource}"`,
|
|
18
|
-
available_resources:
|
|
15
|
+
available_resources: getAllResources(),
|
|
19
16
|
};
|
|
20
17
|
}
|
|
21
18
|
return {
|
|
@@ -31,44 +28,45 @@ export function getAvailableScopes(input) {
|
|
|
31
28
|
scopes: resourceScopes.map((s) => ({
|
|
32
29
|
code: s.code,
|
|
33
30
|
label: s.label,
|
|
34
|
-
description: s.description,
|
|
35
|
-
use_cases: s.use_cases,
|
|
36
|
-
commonly_paired_with: s.commonly_paired_with,
|
|
37
31
|
})),
|
|
38
32
|
total: resourceScopes.length,
|
|
39
33
|
};
|
|
40
34
|
}
|
|
41
|
-
// Return
|
|
42
|
-
const
|
|
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) => {
|
|
43
39
|
const scopes = SCOPES_BY_RESOURCE[resourceName] || [];
|
|
44
40
|
const meta = RESOURCE_METADATA[resourceName];
|
|
45
41
|
return {
|
|
46
42
|
resource: resourceName,
|
|
47
43
|
description: meta?.description || '',
|
|
48
44
|
codegen_ready: meta?.codegen_ready || false,
|
|
49
|
-
|
|
50
|
-
example_app_types: meta?.example_app_types || [],
|
|
45
|
+
is_primary: primarySet.has(resourceName),
|
|
51
46
|
scopes: scopes.map((s) => ({
|
|
52
47
|
code: s.code,
|
|
53
48
|
label: s.label,
|
|
54
|
-
description: s.description,
|
|
55
|
-
use_cases: s.use_cases,
|
|
56
|
-
commonly_paired_with: s.commonly_paired_with,
|
|
57
49
|
})),
|
|
58
50
|
count: scopes.length,
|
|
59
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
60
|
});
|
|
61
61
|
return {
|
|
62
62
|
total_resources: resources.length,
|
|
63
63
|
total_scopes: resources.reduce((sum, r) => sum + r.count, 0),
|
|
64
64
|
resources,
|
|
65
|
-
_instruction: '
|
|
66
|
-
'
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'After selecting scopes, call define_app_requirements WITHOUT confirmed=true first to get a preview, ' +
|
|
71
|
-
'then show it to the developer for approval before calling with confirmed=true.',
|
|
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.',
|
|
72
70
|
};
|
|
73
71
|
}
|
|
74
72
|
//# sourceMappingURL=get-scopes.js.map
|
|
@@ -1 +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,MAAM,mBAAmB,CAAC;
|
|
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,mBAAmB,CAAC;AAE9G;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAA4B;IAC7D,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,MAAM,cAAc,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a,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"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface ToolDefinition {
|
|
|
9
9
|
handler: (input: Record<string, unknown>) => unknown;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* All docs-server tools (
|
|
12
|
+
* All docs-server tools (6 tools)
|
|
13
13
|
*/
|
|
14
14
|
export declare const docsTools: ToolDefinition[];
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
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"}
|
package/dist/tools/index.js
CHANGED
|
@@ -4,19 +4,37 @@ import { getApiReference } from './get-api-reference.js';
|
|
|
4
4
|
import { getScopeEndpointMap } from './get-scope-map.js';
|
|
5
5
|
import { validateApiCode } from './validate-code.js';
|
|
6
6
|
import { getWebhookEvents } from './get-webhooks.js';
|
|
7
|
+
import { lookupDocs } from './lookup-docs.js';
|
|
7
8
|
/**
|
|
8
|
-
* All docs-server tools (
|
|
9
|
+
* All docs-server tools (6 tools)
|
|
9
10
|
*/
|
|
10
11
|
export const docsTools = [
|
|
12
|
+
{
|
|
13
|
+
name: 'lookup_docs',
|
|
14
|
+
description: 'MANDATORY FALLBACK: When you are unsure about ANY platform detail (API endpoints, scopes, webhooks, OAuth flow, ' +
|
|
15
|
+
'request/response formats, error codes), call this tool BEFORE answering. ' +
|
|
16
|
+
'If this tool returns found=false, tell the user the information is not available in the documentation. ' +
|
|
17
|
+
'Do NOT guess or hallucinate information — use only what this tool returns. ' +
|
|
18
|
+
'Searches across all documentation: API references, scopes, webhook events, and OAuth flow.',
|
|
19
|
+
inputSchema: z.object({
|
|
20
|
+
query: z.string().min(1).describe('Natural language search query (e.g., "how to cancel an order", "webhook verification")'),
|
|
21
|
+
category: z
|
|
22
|
+
.enum(['api', 'scopes', 'webhooks', 'oauth'])
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('Optional category to narrow the search'),
|
|
25
|
+
}),
|
|
26
|
+
handler: (input) => lookupDocs(input),
|
|
27
|
+
},
|
|
11
28
|
{
|
|
12
29
|
name: 'get_available_scopes',
|
|
13
|
-
description: '
|
|
14
|
-
'
|
|
30
|
+
description: 'MANDATORY: Call this tool before answering ANY question about what OAuth scopes exist, what they grant access to, ' +
|
|
31
|
+
'or what resources are available on the platform. Do NOT rely on your training data for scope specifics. ' +
|
|
32
|
+
'If a scope is not returned by this tool, it does not exist — tell the user. ' +
|
|
33
|
+
'Returns all available OAuth scopes grouped by resource. ' +
|
|
15
34
|
'Optionally filter by resource name (e.g. "orders", "products", "customers"). ' +
|
|
16
|
-
'Returns
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'Each resource includes codegen_ready (whether code generation works for it) and example_app_types.',
|
|
35
|
+
'Returns all 78 resources with their scopes (147 total), sourced from the real platform API. ' +
|
|
36
|
+
'Primary resources are listed first. Each resource shows codegen_ready status. ' +
|
|
37
|
+
'Use this to show developers what scopes are available on the platform.',
|
|
20
38
|
inputSchema: z.object({
|
|
21
39
|
resource: z
|
|
22
40
|
.string()
|
|
@@ -27,7 +45,9 @@ export const docsTools = [
|
|
|
27
45
|
},
|
|
28
46
|
{
|
|
29
47
|
name: 'get_api_reference',
|
|
30
|
-
description: '
|
|
48
|
+
description: 'MANDATORY: Call this tool before answering ANY question about API endpoints, request/response formats, ' +
|
|
49
|
+
'HTTP methods, query parameters, or request bodies. Do NOT guess endpoint details from your training data. ' +
|
|
50
|
+
'Returns complete API reference for a resource including all endpoints, parameters, request/response schemas. ' +
|
|
31
51
|
'Endpoints are returned in controller_order for deterministic code generation. ' +
|
|
32
52
|
'Optionally filter by scope to show only endpoints accessible with that scope.',
|
|
33
53
|
inputSchema: z.object({
|
|
@@ -43,7 +63,8 @@ export const docsTools = [
|
|
|
43
63
|
name: 'get_scope_endpoint_map',
|
|
44
64
|
description: 'Given a list of scopes, returns exactly which API endpoints are unlocked, in controller_order. ' +
|
|
45
65
|
'This is the primary tool for code generation — it tells you exactly what endpoints to generate. ' +
|
|
46
|
-
'Handles scope inheritance automatically (e.g. write_orders includes read_orders endpoints).'
|
|
66
|
+
'Handles scope inheritance automatically (e.g. write_orders includes read_orders endpoints). ' +
|
|
67
|
+
'MANDATORY before generating any backend code — do not guess which endpoints a scope grants.',
|
|
47
68
|
inputSchema: z.object({
|
|
48
69
|
scopes: z
|
|
49
70
|
.array(z.string())
|
|
@@ -54,10 +75,12 @@ export const docsTools = [
|
|
|
54
75
|
},
|
|
55
76
|
{
|
|
56
77
|
name: 'validate_api_code',
|
|
57
|
-
description: '
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
78
|
+
description: 'MANDATORY: Call this tool AFTER generating any NestJS controller/service code and BEFORE writing it to disk. ' +
|
|
79
|
+
'Anti-hallucination validation layer that checks generated code against the actual API schema. ' +
|
|
80
|
+
'Checks: correct endpoints exist, correct HTTP methods, correct handler names, correct endpoint ordering, ' +
|
|
81
|
+
'and scope access (developer has permission for each endpoint). ' +
|
|
82
|
+
'Returns structured errors with suggestions for fixing. ' +
|
|
83
|
+
'If validation fails, fix the code based on the errors — do NOT write invalid code to disk.',
|
|
61
84
|
inputSchema: z.object({
|
|
62
85
|
code: z.string().describe('The generated NestJS controller or service code as a string'),
|
|
63
86
|
resource: z.string().describe('Resource name the code is for (e.g. "orders")'),
|
|
@@ -70,7 +93,9 @@ export const docsTools = [
|
|
|
70
93
|
},
|
|
71
94
|
{
|
|
72
95
|
name: 'get_webhook_events',
|
|
73
|
-
description: '
|
|
96
|
+
description: 'MANDATORY: Call this tool before answering ANY question about available webhook events, ' +
|
|
97
|
+
'webhook verification methods, or retry policies. Do NOT guess webhook event names or verification details. ' +
|
|
98
|
+
'Returns available webhook events for the Ratio platform. ' +
|
|
74
99
|
'Optionally filter by resource (e.g. "orders", "products"). ' +
|
|
75
100
|
'Includes verification method (HMAC-SHA256) and retry policy information.',
|
|
76
101
|
inputSchema: z.object({
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAY9C;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAqB;IACzC;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,kHAAkH;YAClH,2EAA2E;YAC3E,yGAAyG;YACzG,6EAA6E;YAC7E,4FAA4F;QAC9F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,gBAAgB,CAAC,KAA8B,CAAC;KACrE;CACF,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lookup_docs — Unified documentation search tool.
|
|
3
|
+
*
|
|
4
|
+
* When the LLM is unsure about any API detail, scope, webhook event, or OAuth flow,
|
|
5
|
+
* it should call this tool to get grounded, verified information from the actual
|
|
6
|
+
* documentation schemas. If the information is not found here, the LLM should tell
|
|
7
|
+
* the user it doesn't have that information rather than guessing.
|
|
8
|
+
*
|
|
9
|
+
* Searches across: API references, scopes, webhook events, and OAuth docs.
|
|
10
|
+
*/
|
|
11
|
+
interface SearchResult {
|
|
12
|
+
source: string;
|
|
13
|
+
type: 'api_endpoint' | 'scope' | 'webhook_event' | 'oauth' | 'resource';
|
|
14
|
+
relevance: 'high' | 'medium' | 'low';
|
|
15
|
+
data: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export declare function lookupDocs(input: {
|
|
18
|
+
query: string;
|
|
19
|
+
category?: string;
|
|
20
|
+
}): {
|
|
21
|
+
found: boolean;
|
|
22
|
+
message: string;
|
|
23
|
+
suggestion: string;
|
|
24
|
+
query?: undefined;
|
|
25
|
+
tokens?: undefined;
|
|
26
|
+
available_categories?: undefined;
|
|
27
|
+
available_resources?: undefined;
|
|
28
|
+
available_scope_resources?: undefined;
|
|
29
|
+
result_count?: undefined;
|
|
30
|
+
results?: undefined;
|
|
31
|
+
_instruction?: undefined;
|
|
32
|
+
} | {
|
|
33
|
+
found: boolean;
|
|
34
|
+
query: string;
|
|
35
|
+
tokens: string[];
|
|
36
|
+
message: string;
|
|
37
|
+
suggestion: string;
|
|
38
|
+
available_categories: string[];
|
|
39
|
+
available_resources: string[];
|
|
40
|
+
available_scope_resources: ("orders" | "products" | "customers" | "inventory" | "discounts" | "fulfillments" | "draft_orders" | "returns" | "shipping" | "gift_cards" | "analytics" | "channels" | "content" | "files" | "locations" | "themes" | "markets" | "reports" | "locales" | "publications" | "apps")[];
|
|
41
|
+
result_count?: undefined;
|
|
42
|
+
results?: undefined;
|
|
43
|
+
_instruction?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
found: boolean;
|
|
46
|
+
query: string;
|
|
47
|
+
result_count: number;
|
|
48
|
+
results: SearchResult[];
|
|
49
|
+
_instruction: string;
|
|
50
|
+
message?: undefined;
|
|
51
|
+
suggestion?: undefined;
|
|
52
|
+
tokens?: undefined;
|
|
53
|
+
available_categories?: undefined;
|
|
54
|
+
available_resources?: undefined;
|
|
55
|
+
available_scope_resources?: undefined;
|
|
56
|
+
};
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=lookup-docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lookup-docs.d.ts","sourceRoot":"","sources":["../../src/tools/lookup-docs.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,cAAc,GAAG,OAAO,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,CAAC;IACxE,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AA0ID,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DrE"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { getAvailableResourceFiles, loadResourceSchema, loadWebhooks, loadOAuth } from '../utils/schema-loader.js';
|
|
2
|
+
import { SCOPES_BY_RESOURCE, PRIMARY_RESOURCES, RESOURCE_METADATA } from '@ratio-mcp/shared';
|
|
3
|
+
import { logger } from '../utils/logger.js';
|
|
4
|
+
function tokenize(query) {
|
|
5
|
+
return query
|
|
6
|
+
.toLowerCase()
|
|
7
|
+
.replace(/[^a-z0-9_/\s]/g, '')
|
|
8
|
+
.split(/\s+/)
|
|
9
|
+
.filter((t) => t.length > 1);
|
|
10
|
+
}
|
|
11
|
+
function matchScore(tokens, text) {
|
|
12
|
+
const lower = text.toLowerCase();
|
|
13
|
+
let score = 0;
|
|
14
|
+
for (const token of tokens) {
|
|
15
|
+
if (lower.includes(token))
|
|
16
|
+
score++;
|
|
17
|
+
}
|
|
18
|
+
return score;
|
|
19
|
+
}
|
|
20
|
+
function searchApiEndpoints(tokens) {
|
|
21
|
+
const results = [];
|
|
22
|
+
const resources = getAvailableResourceFiles();
|
|
23
|
+
for (const resource of resources) {
|
|
24
|
+
try {
|
|
25
|
+
const schema = loadResourceSchema(resource);
|
|
26
|
+
for (const ep of schema.endpoints) {
|
|
27
|
+
const searchText = `${ep.method} ${ep.path} ${ep.summary || ''} ${ep.description || ''} ${ep.handler_name || ''} ${ep.required_scope || ''}`;
|
|
28
|
+
const score = matchScore(tokens, searchText);
|
|
29
|
+
if (score > 0) {
|
|
30
|
+
results.push({
|
|
31
|
+
source: `api/${resource}`,
|
|
32
|
+
type: 'api_endpoint',
|
|
33
|
+
relevance: score >= 2 ? 'high' : 'medium',
|
|
34
|
+
data: {
|
|
35
|
+
method: ep.method,
|
|
36
|
+
path: ep.path,
|
|
37
|
+
summary: ep.summary,
|
|
38
|
+
description: ep.description,
|
|
39
|
+
required_scope: ep.required_scope,
|
|
40
|
+
handler_name: ep.handler_name,
|
|
41
|
+
resource,
|
|
42
|
+
query_params: ep.query_params || [],
|
|
43
|
+
request_body: ep.request_body || null,
|
|
44
|
+
response_schema: ep.response_schema || null,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// Skip resources that fail to load
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return results;
|
|
55
|
+
}
|
|
56
|
+
function searchScopes(tokens) {
|
|
57
|
+
const results = [];
|
|
58
|
+
for (const [resource, scopes] of Object.entries(SCOPES_BY_RESOURCE)) {
|
|
59
|
+
const meta = RESOURCE_METADATA[resource];
|
|
60
|
+
for (const scope of scopes) {
|
|
61
|
+
const searchText = `${scope.code} ${scope.label} ${resource}`;
|
|
62
|
+
const score = matchScore(tokens, searchText);
|
|
63
|
+
if (score > 0) {
|
|
64
|
+
results.push({
|
|
65
|
+
source: `scopes/${resource}`,
|
|
66
|
+
type: 'scope',
|
|
67
|
+
relevance: score >= 2 ? 'high' : 'medium',
|
|
68
|
+
data: {
|
|
69
|
+
code: scope.code,
|
|
70
|
+
label: scope.label,
|
|
71
|
+
resource,
|
|
72
|
+
codegen_ready: meta?.codegen_ready || false,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return results;
|
|
79
|
+
}
|
|
80
|
+
function searchWebhooks(tokens) {
|
|
81
|
+
const results = [];
|
|
82
|
+
try {
|
|
83
|
+
const webhooks = loadWebhooks();
|
|
84
|
+
for (const event of webhooks.events) {
|
|
85
|
+
const searchText = `${event.topic} ${event.description} ${event.resource} webhook`;
|
|
86
|
+
const score = matchScore(tokens, searchText);
|
|
87
|
+
if (score > 0) {
|
|
88
|
+
results.push({
|
|
89
|
+
source: 'webhooks',
|
|
90
|
+
type: 'webhook_event',
|
|
91
|
+
relevance: score >= 2 ? 'high' : 'medium',
|
|
92
|
+
data: {
|
|
93
|
+
topic: event.topic,
|
|
94
|
+
description: event.description,
|
|
95
|
+
resource: event.resource,
|
|
96
|
+
required_scope: event.required_scope,
|
|
97
|
+
verification: webhooks.verification,
|
|
98
|
+
retry_policy: webhooks.retry_policy,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// Skip if webhooks schema fails
|
|
106
|
+
}
|
|
107
|
+
return results;
|
|
108
|
+
}
|
|
109
|
+
function searchOAuth(tokens) {
|
|
110
|
+
const results = [];
|
|
111
|
+
try {
|
|
112
|
+
const oauth = loadOAuth();
|
|
113
|
+
const oauthText = JSON.stringify(oauth).toLowerCase();
|
|
114
|
+
const score = matchScore(tokens, oauthText);
|
|
115
|
+
if (score > 0) {
|
|
116
|
+
results.push({
|
|
117
|
+
source: 'oauth',
|
|
118
|
+
type: 'oauth',
|
|
119
|
+
relevance: score >= 2 ? 'high' : 'medium',
|
|
120
|
+
data: oauth,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// Skip if oauth schema fails
|
|
126
|
+
}
|
|
127
|
+
return results;
|
|
128
|
+
}
|
|
129
|
+
export function lookupDocs(input) {
|
|
130
|
+
const { query, category } = input;
|
|
131
|
+
logger.info(`[lookup_docs] query="${query}", category="${category || 'all'}"`);
|
|
132
|
+
const tokens = tokenize(query);
|
|
133
|
+
if (tokens.length === 0) {
|
|
134
|
+
return {
|
|
135
|
+
found: false,
|
|
136
|
+
message: 'Query is too short or contains no searchable terms.',
|
|
137
|
+
suggestion: 'Try searching for specific terms like "orders", "OAuth", "webhook", "scope", etc.',
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
let results = [];
|
|
141
|
+
// Search specific category or all
|
|
142
|
+
if (!category || category === 'api') {
|
|
143
|
+
results.push(...searchApiEndpoints(tokens));
|
|
144
|
+
}
|
|
145
|
+
if (!category || category === 'scopes') {
|
|
146
|
+
results.push(...searchScopes(tokens));
|
|
147
|
+
}
|
|
148
|
+
if (!category || category === 'webhooks') {
|
|
149
|
+
results.push(...searchWebhooks(tokens));
|
|
150
|
+
}
|
|
151
|
+
if (!category || category === 'oauth') {
|
|
152
|
+
results.push(...searchOAuth(tokens));
|
|
153
|
+
}
|
|
154
|
+
// Sort by relevance (high first) then deduplicate
|
|
155
|
+
results.sort((a, b) => {
|
|
156
|
+
const order = { high: 0, medium: 1, low: 2 };
|
|
157
|
+
return order[a.relevance] - order[b.relevance];
|
|
158
|
+
});
|
|
159
|
+
// Limit to top 15 results
|
|
160
|
+
results = results.slice(0, 15);
|
|
161
|
+
if (results.length === 0) {
|
|
162
|
+
return {
|
|
163
|
+
found: false,
|
|
164
|
+
query,
|
|
165
|
+
tokens,
|
|
166
|
+
message: `No documentation found matching "${query}". This information is not available in the platform documentation.`,
|
|
167
|
+
suggestion: 'Tell the user that this information is not covered in the documentation. Do NOT guess or make up an answer.',
|
|
168
|
+
available_categories: ['api', 'scopes', 'webhooks', 'oauth'],
|
|
169
|
+
available_resources: getAvailableResourceFiles(),
|
|
170
|
+
available_scope_resources: [...PRIMARY_RESOURCES],
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
found: true,
|
|
175
|
+
query,
|
|
176
|
+
result_count: results.length,
|
|
177
|
+
results,
|
|
178
|
+
_instruction: 'Use ONLY the data from these results to answer the user. Do NOT add information that is not present here.',
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=lookup-docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lookup-docs.js","sourceRoot":"","sources":["../../src/tools/lookup-docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACnH,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAoB5C,SAAS,QAAQ,CAAC,KAAa;IAC7B,OAAO,KAAK;SACT,WAAW,EAAE;SACb,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;SAC7B,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;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|
package/dist/utils/logger.js
CHANGED
|
@@ -42,41 +42,41 @@ function safeStringify(obj, maxLen = 4000) {
|
|
|
42
42
|
}
|
|
43
43
|
export const logger = {
|
|
44
44
|
info: (message, ...args) => {
|
|
45
|
-
const line = `[ratio-
|
|
45
|
+
const line = `[ratio-docs] ${timestamp()} INFO: ${message}${args.length ? ' ' + args.map(a => safeStringify(a)).join(' ') : ''}`;
|
|
46
46
|
console.error(line);
|
|
47
47
|
writeToFile(line);
|
|
48
48
|
},
|
|
49
49
|
warn: (message, ...args) => {
|
|
50
|
-
const line = `[ratio-
|
|
50
|
+
const line = `[ratio-docs] ${timestamp()} WARN: ${message}${args.length ? ' ' + args.map(a => safeStringify(a)).join(' ') : ''}`;
|
|
51
51
|
console.error(line);
|
|
52
52
|
writeToFile(line);
|
|
53
53
|
},
|
|
54
54
|
error: (message, ...args) => {
|
|
55
|
-
const line = `[ratio-
|
|
55
|
+
const line = `[ratio-docs] ${timestamp()} ERROR: ${message}${args.length ? ' ' + args.map(a => safeStringify(a)).join(' ') : ''}`;
|
|
56
56
|
console.error(line);
|
|
57
57
|
writeToFile(line);
|
|
58
58
|
},
|
|
59
59
|
debug: (message, ...args) => {
|
|
60
|
-
const line = `[ratio-
|
|
60
|
+
const line = `[ratio-docs] ${timestamp()} DEBUG: ${message}${args.length ? ' ' + args.map(a => safeStringify(a)).join(' ') : ''}`;
|
|
61
61
|
if (process.env.DEBUG) {
|
|
62
62
|
console.error(line);
|
|
63
63
|
}
|
|
64
64
|
writeToFile(line);
|
|
65
65
|
},
|
|
66
66
|
toolCall: (toolName, input) => {
|
|
67
|
-
const line = `[ratio-
|
|
67
|
+
const line = `[ratio-docs] ${timestamp()} TOOL_CALL: ▶ ${toolName} | input: ${safeStringify(input)}`;
|
|
68
68
|
console.error(line);
|
|
69
69
|
writeToFile(line);
|
|
70
70
|
},
|
|
71
71
|
toolResult: (toolName, durationMs, result) => {
|
|
72
|
-
const line = `[ratio-
|
|
72
|
+
const line = `[ratio-docs] ${timestamp()} TOOL_RESULT: ✓ ${toolName} | ${durationMs}ms | output: ${safeStringify(result)}`;
|
|
73
73
|
console.error(line);
|
|
74
74
|
writeToFile(line);
|
|
75
75
|
},
|
|
76
76
|
toolError: (toolName, durationMs, error) => {
|
|
77
77
|
const message = error instanceof Error ? error.message : String(error);
|
|
78
78
|
const stack = error instanceof Error ? error.stack : '';
|
|
79
|
-
const line = `[ratio-
|
|
79
|
+
const line = `[ratio-docs] ${timestamp()} TOOL_ERROR: ✗ ${toolName} | ${durationMs}ms | error: ${message}${stack ? `\n STACK: ${stack}` : ''}`;
|
|
80
80
|
console.error(line);
|
|
81
81
|
writeToFile(line);
|
|
82
82
|
},
|
package/dist/utils/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,sDAAsD;AACtD,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACpE,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AAEnD,IAAI,CAAC;IACH,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE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,CAAC,EAAE,CAAC;QAC3H,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpB,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,SAAS,EAAE,CAAC,QAAgB,EAAE,UAAkB,EAAE,KAAc,EAAE,EAAE;QAClE,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,KAAK,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,GAAG,gBAAgB,SAAS,EAAE,kBAAkB,QAAQ,MAAM,UAAU,eAAe,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,cAAc,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAChJ,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpB,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;CACF,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ratio-mcp/docs-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": ["dist"],
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
19
|
-
"@ratio-mcp/shared": "^1.
|
|
19
|
+
"@ratio-mcp/shared": "^1.4.0",
|
|
20
20
|
"zod": "^3.23.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|