@henrylabs/mcp 0.8.0 → 0.9.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/README.md +52 -2
- package/code-tool-worker.d.mts.map +1 -1
- package/code-tool-worker.d.ts.map +1 -1
- package/code-tool-worker.js +97 -7
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +97 -7
- package/code-tool-worker.mjs.map +1 -1
- package/code-tool.js +1 -1
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +1 -1
- package/code-tool.mjs.map +1 -1
- package/http.js +2 -2
- package/http.js.map +1 -1
- package/http.mjs +2 -2
- package/http.mjs.map +1 -1
- package/package.json +3 -2
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/code-tool-worker.ts +126 -7
- package/src/code-tool.ts +1 -1
- package/src/http.ts +2 -2
- package/src/server.ts +1 -1
- package/src/tools/products/search-products.ts +1 -1
- package/tools/products/search-products.js +1 -1
- package/tools/products/search-products.js.map +1 -1
- package/tools/products/search-products.mjs +1 -1
- package/tools/products/search-products.mjs.map +1 -1
package/README.md
CHANGED
|
@@ -34,12 +34,36 @@ For clients with a configuration JSON, it might look something like this:
|
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
### Cursor
|
|
38
|
+
|
|
39
|
+
If you use Cursor, you can install the MCP server by using the button below. You will need to set your environment variables
|
|
40
|
+
in Cursor's `mcp.json`, which can be found in Cursor Settings > Tools & MCP > New MCP Server.
|
|
41
|
+
|
|
42
|
+
[](https://cursor.com/en-US/install-mcp?name=@henrylabs/mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBoZW5yeWxhYnMvbWNwIl0sImVudiI6eyJIRU5SWV9TREtfQVBJX0tFWSI6IlNldCB5b3VyIEhFTlJZX1NES19BUElfS0VZIGhlcmUuIn19)
|
|
43
|
+
|
|
44
|
+
### VS Code
|
|
45
|
+
|
|
46
|
+
If you use MCP, you can install the MCP server by clicking the link below. You will need to set your environment variables
|
|
47
|
+
in VS Code's `mcp.json`, which can be found via Command Palette > MCP: Open User Configuration.
|
|
48
|
+
|
|
49
|
+
[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40henrylabs%2Fmcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40henrylabs%2Fmcp%22%5D%2C%22env%22%3A%7B%22HENRY_SDK_API_KEY%22%3A%22Set%20your%20HENRY_SDK_API_KEY%20here.%22%7D%7D)
|
|
50
|
+
|
|
51
|
+
### Claude Code
|
|
52
|
+
|
|
53
|
+
If you use Claude Code, you can install the MCP server by running the command below in your terminal. You will need to set your
|
|
54
|
+
environment variables in Claude Code's `.claude.json`, which can be found in your home directory.
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
claude mcp add --transport stdio henrylabs_sdk_api --env HENRY_SDK_API_KEY="Your HENRY_SDK_API_KEY here." -- npx -y @henrylabs/mcp
|
|
58
|
+
```
|
|
59
|
+
|
|
37
60
|
## Exposing endpoints to your MCP Client
|
|
38
61
|
|
|
39
|
-
There are
|
|
62
|
+
There are three ways to expose endpoints as tools in the MCP server:
|
|
40
63
|
|
|
41
64
|
1. Exposing one tool per endpoint, and filtering as necessary
|
|
42
65
|
2. Exposing a set of tools to dynamically discover and invoke endpoints from the API
|
|
66
|
+
3. Exposing a docs search tool and a code execution tool, allowing the client to write code to be executed against the TypeScript client
|
|
43
67
|
|
|
44
68
|
### Filtering endpoints and tools
|
|
45
69
|
|
|
@@ -75,6 +99,18 @@ All of these command-line options can be repeated, combined together, and have c
|
|
|
75
99
|
|
|
76
100
|
Use `--list` to see the list of available tools, or see below.
|
|
77
101
|
|
|
102
|
+
### Code execution
|
|
103
|
+
|
|
104
|
+
If you specify `--tools=code` to the MCP server, it will expose just two tools:
|
|
105
|
+
|
|
106
|
+
- `search_docs` - Searches the API documentation and returns a list of markdown results
|
|
107
|
+
- `execute` - Runs code against the TypeScript client
|
|
108
|
+
|
|
109
|
+
This allows the LLM to implement more complex logic by chaining together many API calls without loading
|
|
110
|
+
intermediary results into its context window.
|
|
111
|
+
|
|
112
|
+
The code execution itself happens in a Deno sandbox that has network access only to the base URL for the API.
|
|
113
|
+
|
|
78
114
|
### Specifying the MCP Client
|
|
79
115
|
|
|
80
116
|
Different clients have varying abilities to handle arbitrary tools and schemas.
|
|
@@ -206,7 +242,21 @@ The following tools are available in this MCP server.
|
|
|
206
242
|
### Resource `products`:
|
|
207
243
|
|
|
208
244
|
- `retrieve_product_details` (`read`) tags: [headless, hosted]: Retrieve detailed information about a specific product given product ID. Must be called to first get a product link before adding an item to cart
|
|
209
|
-
- `search_products` (`write`) tags: [headless, hosted]: Search for products
|
|
245
|
+
- `search_products` (`write`) tags: [headless, hosted]: Search for products from Google Shopping. Returns basic product info including:
|
|
246
|
+
|
|
247
|
+
- Product ID (required for getting detail links)
|
|
248
|
+
- Name, price, description
|
|
249
|
+
- Thumbnail image URL
|
|
250
|
+
|
|
251
|
+
IMPORTANT: This endpoint does NOT return clickable product/store URLs.
|
|
252
|
+
To get actual store links where users can purchase products, you MUST
|
|
253
|
+
call retrieve_product_details with each product's ID.
|
|
254
|
+
|
|
255
|
+
Recommended workflow:
|
|
256
|
+
|
|
257
|
+
1. Call search_products to find products
|
|
258
|
+
2. For each product, call retrieve_product_details(productId) to get store URLs
|
|
259
|
+
3. Present results with both images and clickable store links
|
|
210
260
|
|
|
211
261
|
### Resource `cart`:
|
|
212
262
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool-worker.d.mts","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"code-tool-worker.d.mts","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";iBA2J0B,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC;;AAwDrD,wBAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool-worker.d.ts","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"code-tool-worker.d.ts","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";iBA2J0B,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC;;AAwDrD,wBAAyB"}
|
package/code-tool-worker.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const node_util_1 = __importDefault(require("node:util"));
|
|
8
|
+
const fuse_js_1 = __importDefault(require("fuse.js"));
|
|
8
9
|
const typescript_1 = __importDefault(require("typescript"));
|
|
9
10
|
const sdk_1 = require("@henrylabs/sdk");
|
|
10
11
|
function getRunFunctionNode(code) {
|
|
@@ -31,8 +32,101 @@ function getRunFunctionNode(code) {
|
|
|
31
32
|
}
|
|
32
33
|
return null;
|
|
33
34
|
}
|
|
35
|
+
const fuse = new fuse_js_1.default([
|
|
36
|
+
'client.products.retrieveDetails',
|
|
37
|
+
'client.products.search',
|
|
38
|
+
'client.products.variantCheck.create',
|
|
39
|
+
'client.products.variantCheck.retrieveStatus',
|
|
40
|
+
'client.cart.createCheckout',
|
|
41
|
+
'client.cart.items.add',
|
|
42
|
+
'client.cart.items.clear',
|
|
43
|
+
'client.cart.items.list',
|
|
44
|
+
'client.cart.items.remove',
|
|
45
|
+
'client.checkout.session.confirmCheckout',
|
|
46
|
+
'client.checkout.session.createQuote',
|
|
47
|
+
'client.checkout.session.listProducts',
|
|
48
|
+
'client.checkout.session.retrieveShippingInfo',
|
|
49
|
+
'client.orders.retrieveStatus',
|
|
50
|
+
'client.wallet.createCardCollection',
|
|
51
|
+
'client.merchants.checkStatus',
|
|
52
|
+
'client.merchants.getShippingInfo',
|
|
53
|
+
'client.merchants.listSupported',
|
|
54
|
+
], { threshold: 1, shouldSort: true });
|
|
55
|
+
function getMethodSuggestions(fullyQualifiedMethodName) {
|
|
56
|
+
return fuse
|
|
57
|
+
.search(fullyQualifiedMethodName)
|
|
58
|
+
.map(({ item }) => item)
|
|
59
|
+
.slice(0, 5);
|
|
60
|
+
}
|
|
61
|
+
const proxyToObj = new WeakMap();
|
|
62
|
+
const objToProxy = new WeakMap();
|
|
63
|
+
function makeSdkProxy(obj, { path, isBelievedBad = false }) {
|
|
64
|
+
let proxy = objToProxy.get(obj);
|
|
65
|
+
if (!proxy) {
|
|
66
|
+
proxy = new Proxy(obj, {
|
|
67
|
+
get(target, prop, receiver) {
|
|
68
|
+
const propPath = [...path, String(prop)];
|
|
69
|
+
const value = Reflect.get(target, prop, receiver);
|
|
70
|
+
if (isBelievedBad || (!(prop in target) && value === undefined)) {
|
|
71
|
+
// If we're accessing a path that doesn't exist, it will probably eventually error.
|
|
72
|
+
// Let's proxy it and mark it bad so that we can control the error message.
|
|
73
|
+
// We proxy an empty class so that an invocation or construction attempt is possible.
|
|
74
|
+
return makeSdkProxy(class {
|
|
75
|
+
}, { path: propPath, isBelievedBad: true });
|
|
76
|
+
}
|
|
77
|
+
if (value !== null && (typeof value === 'object' || typeof value === 'function')) {
|
|
78
|
+
return makeSdkProxy(value, { path: propPath, isBelievedBad });
|
|
79
|
+
}
|
|
80
|
+
return value;
|
|
81
|
+
},
|
|
82
|
+
apply(target, thisArg, args) {
|
|
83
|
+
if (isBelievedBad || typeof target !== 'function') {
|
|
84
|
+
const fullyQualifiedMethodName = path.join('.');
|
|
85
|
+
const suggestions = getMethodSuggestions(fullyQualifiedMethodName);
|
|
86
|
+
throw new Error(`${fullyQualifiedMethodName} is not a function. Did you mean: ${suggestions.join(', ')}`);
|
|
87
|
+
}
|
|
88
|
+
return Reflect.apply(target, proxyToObj.get(thisArg) ?? thisArg, args);
|
|
89
|
+
},
|
|
90
|
+
construct(target, args, newTarget) {
|
|
91
|
+
if (isBelievedBad || typeof target !== 'function') {
|
|
92
|
+
const fullyQualifiedMethodName = path.join('.');
|
|
93
|
+
const suggestions = getMethodSuggestions(fullyQualifiedMethodName);
|
|
94
|
+
throw new Error(`${fullyQualifiedMethodName} is not a constructor. Did you mean: ${suggestions.join(', ')}`);
|
|
95
|
+
}
|
|
96
|
+
return Reflect.construct(target, args, newTarget);
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
objToProxy.set(obj, proxy);
|
|
100
|
+
proxyToObj.set(proxy, obj);
|
|
101
|
+
}
|
|
102
|
+
return proxy;
|
|
103
|
+
}
|
|
104
|
+
function parseError(code, error) {
|
|
105
|
+
if (!(error instanceof Error))
|
|
106
|
+
return;
|
|
107
|
+
const message = error.name ? `${error.name}: ${error.message}` : error.message;
|
|
108
|
+
try {
|
|
109
|
+
// Deno uses V8; the first "<anonymous>:LINE:COLUMN" is the top of stack.
|
|
110
|
+
const lineNumber = error.stack?.match(/<anonymous>:([0-9]+):[0-9]+/)?.[1];
|
|
111
|
+
// -1 for the zero-based indexing
|
|
112
|
+
const line = lineNumber &&
|
|
113
|
+
code
|
|
114
|
+
.split('\n')
|
|
115
|
+
.at(parseInt(lineNumber, 10) - 1)
|
|
116
|
+
?.trim();
|
|
117
|
+
return line ? `${message}\n at line ${lineNumber}\n ${line}` : message;
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return message;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
34
123
|
const fetch = async (req) => {
|
|
35
124
|
const { opts, code } = (await req.json());
|
|
125
|
+
if (code == null) {
|
|
126
|
+
return Response.json({
|
|
127
|
+
message: 'The code param is missing. Provide one containing a top-level `run` function. Write code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```',
|
|
128
|
+
}, { status: 400, statusText: 'Code execution error' });
|
|
129
|
+
}
|
|
36
130
|
const runFunctionNode = getRunFunctionNode(code);
|
|
37
131
|
if (!runFunctionNode) {
|
|
38
132
|
return Response.json({
|
|
@@ -54,11 +148,8 @@ const fetch = async (req) => {
|
|
|
54
148
|
};
|
|
55
149
|
try {
|
|
56
150
|
let run_ = async (client) => { };
|
|
57
|
-
eval(
|
|
58
|
-
|
|
59
|
-
run_ = run;
|
|
60
|
-
`);
|
|
61
|
-
const result = await run_(client);
|
|
151
|
+
eval(`${code}\nrun_ = run;`);
|
|
152
|
+
const result = await run_(makeSdkProxy(client, { path: ['client'] }));
|
|
62
153
|
return Response.json({
|
|
63
154
|
result,
|
|
64
155
|
logLines,
|
|
@@ -66,9 +157,8 @@ const fetch = async (req) => {
|
|
|
66
157
|
});
|
|
67
158
|
}
|
|
68
159
|
catch (e) {
|
|
69
|
-
const message = e instanceof Error ? e.message : undefined;
|
|
70
160
|
return Response.json({
|
|
71
|
-
message,
|
|
161
|
+
message: parseError(code, e),
|
|
72
162
|
}, { status: 400, statusText: 'Code execution error' });
|
|
73
163
|
}
|
|
74
164
|
};
|
package/code-tool-worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool-worker.js","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;AAEtF,0DAA6B;AAE7B,4DAA4B;AAG5B,wCAA0C;AAE1C,SAAS,kBAAkB,CACzB,IAAY;IAEZ,MAAM,UAAU,GAAG,oBAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAEtF,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;QAC9C,4CAA4C;QAC5C,IAAI,oBAAE,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,CAAC;YACxC,IAAI,SAAS,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK,EAAE,CAAC;gBACnC,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,qFAAqF;QACrF,IAAI,oBAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;YACtC,KAAK,MA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C9B,MAAM,OAAO,GAAG;QACd,GAAG,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,mBAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,KAAK,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE;YAC5B,QAAQ,CAAC,IAAI,CAAC,mBAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;KACF,CAAC;IACF,IAAI,CAAC;QACH,IAAI,IAAI,GAAG,KAAK,EAAE,MAAW,EAAE,EAAE,GAAE,CAAC,CAAC;QACrC,IAAI,CAAC,GAAG,IAAI,eAAe,CAAC,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QACtE,OAAO,QAAQ,CAAC,IAAI,CAAC;YACnB,MAAM;YACN,QAAQ;YACR,QAAQ;SACe,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,QAAQ,CAAC,IAAI,CAClB;YACE,OAAO,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;SACP,EACvB,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,sBAAsB,EAAE,CACpD,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,EAAE,KAAK,EAAE,CAAC"}
|
package/code-tool-worker.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import util from 'node:util';
|
|
3
|
+
import Fuse from 'fuse.js';
|
|
3
4
|
import ts from 'typescript';
|
|
4
5
|
import { HenrySDK } from '@henrylabs/sdk';
|
|
5
6
|
function getRunFunctionNode(code) {
|
|
@@ -26,8 +27,101 @@ function getRunFunctionNode(code) {
|
|
|
26
27
|
}
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
30
|
+
const fuse = new Fuse([
|
|
31
|
+
'client.products.retrieveDetails',
|
|
32
|
+
'client.products.search',
|
|
33
|
+
'client.products.variantCheck.create',
|
|
34
|
+
'client.products.variantCheck.retrieveStatus',
|
|
35
|
+
'client.cart.createCheckout',
|
|
36
|
+
'client.cart.items.add',
|
|
37
|
+
'client.cart.items.clear',
|
|
38
|
+
'client.cart.items.list',
|
|
39
|
+
'client.cart.items.remove',
|
|
40
|
+
'client.checkout.session.confirmCheckout',
|
|
41
|
+
'client.checkout.session.createQuote',
|
|
42
|
+
'client.checkout.session.listProducts',
|
|
43
|
+
'client.checkout.session.retrieveShippingInfo',
|
|
44
|
+
'client.orders.retrieveStatus',
|
|
45
|
+
'client.wallet.createCardCollection',
|
|
46
|
+
'client.merchants.checkStatus',
|
|
47
|
+
'client.merchants.getShippingInfo',
|
|
48
|
+
'client.merchants.listSupported',
|
|
49
|
+
], { threshold: 1, shouldSort: true });
|
|
50
|
+
function getMethodSuggestions(fullyQualifiedMethodName) {
|
|
51
|
+
return fuse
|
|
52
|
+
.search(fullyQualifiedMethodName)
|
|
53
|
+
.map(({ item }) => item)
|
|
54
|
+
.slice(0, 5);
|
|
55
|
+
}
|
|
56
|
+
const proxyToObj = new WeakMap();
|
|
57
|
+
const objToProxy = new WeakMap();
|
|
58
|
+
function makeSdkProxy(obj, { path, isBelievedBad = false }) {
|
|
59
|
+
let proxy = objToProxy.get(obj);
|
|
60
|
+
if (!proxy) {
|
|
61
|
+
proxy = new Proxy(obj, {
|
|
62
|
+
get(target, prop, receiver) {
|
|
63
|
+
const propPath = [...path, String(prop)];
|
|
64
|
+
const value = Reflect.get(target, prop, receiver);
|
|
65
|
+
if (isBelievedBad || (!(prop in target) && value === undefined)) {
|
|
66
|
+
// If we're accessing a path that doesn't exist, it will probably eventually error.
|
|
67
|
+
// Let's proxy it and mark it bad so that we can control the error message.
|
|
68
|
+
// We proxy an empty class so that an invocation or construction attempt is possible.
|
|
69
|
+
return makeSdkProxy(class {
|
|
70
|
+
}, { path: propPath, isBelievedBad: true });
|
|
71
|
+
}
|
|
72
|
+
if (value !== null && (typeof value === 'object' || typeof value === 'function')) {
|
|
73
|
+
return makeSdkProxy(value, { path: propPath, isBelievedBad });
|
|
74
|
+
}
|
|
75
|
+
return value;
|
|
76
|
+
},
|
|
77
|
+
apply(target, thisArg, args) {
|
|
78
|
+
if (isBelievedBad || typeof target !== 'function') {
|
|
79
|
+
const fullyQualifiedMethodName = path.join('.');
|
|
80
|
+
const suggestions = getMethodSuggestions(fullyQualifiedMethodName);
|
|
81
|
+
throw new Error(`${fullyQualifiedMethodName} is not a function. Did you mean: ${suggestions.join(', ')}`);
|
|
82
|
+
}
|
|
83
|
+
return Reflect.apply(target, proxyToObj.get(thisArg) ?? thisArg, args);
|
|
84
|
+
},
|
|
85
|
+
construct(target, args, newTarget) {
|
|
86
|
+
if (isBelievedBad || typeof target !== 'function') {
|
|
87
|
+
const fullyQualifiedMethodName = path.join('.');
|
|
88
|
+
const suggestions = getMethodSuggestions(fullyQualifiedMethodName);
|
|
89
|
+
throw new Error(`${fullyQualifiedMethodName} is not a constructor. Did you mean: ${suggestions.join(', ')}`);
|
|
90
|
+
}
|
|
91
|
+
return Reflect.construct(target, args, newTarget);
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
objToProxy.set(obj, proxy);
|
|
95
|
+
proxyToObj.set(proxy, obj);
|
|
96
|
+
}
|
|
97
|
+
return proxy;
|
|
98
|
+
}
|
|
99
|
+
function parseError(code, error) {
|
|
100
|
+
if (!(error instanceof Error))
|
|
101
|
+
return;
|
|
102
|
+
const message = error.name ? `${error.name}: ${error.message}` : error.message;
|
|
103
|
+
try {
|
|
104
|
+
// Deno uses V8; the first "<anonymous>:LINE:COLUMN" is the top of stack.
|
|
105
|
+
const lineNumber = error.stack?.match(/<anonymous>:([0-9]+):[0-9]+/)?.[1];
|
|
106
|
+
// -1 for the zero-based indexing
|
|
107
|
+
const line = lineNumber &&
|
|
108
|
+
code
|
|
109
|
+
.split('\n')
|
|
110
|
+
.at(parseInt(lineNumber, 10) - 1)
|
|
111
|
+
?.trim();
|
|
112
|
+
return line ? `${message}\n at line ${lineNumber}\n ${line}` : message;
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return message;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
29
118
|
const fetch = async (req) => {
|
|
30
119
|
const { opts, code } = (await req.json());
|
|
120
|
+
if (code == null) {
|
|
121
|
+
return Response.json({
|
|
122
|
+
message: 'The code param is missing. Provide one containing a top-level `run` function. Write code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```',
|
|
123
|
+
}, { status: 400, statusText: 'Code execution error' });
|
|
124
|
+
}
|
|
31
125
|
const runFunctionNode = getRunFunctionNode(code);
|
|
32
126
|
if (!runFunctionNode) {
|
|
33
127
|
return Response.json({
|
|
@@ -49,11 +143,8 @@ const fetch = async (req) => {
|
|
|
49
143
|
};
|
|
50
144
|
try {
|
|
51
145
|
let run_ = async (client) => { };
|
|
52
|
-
eval(
|
|
53
|
-
|
|
54
|
-
run_ = run;
|
|
55
|
-
`);
|
|
56
|
-
const result = await run_(client);
|
|
146
|
+
eval(`${code}\nrun_ = run;`);
|
|
147
|
+
const result = await run_(makeSdkProxy(client, { path: ['client'] }));
|
|
57
148
|
return Response.json({
|
|
58
149
|
result,
|
|
59
150
|
logLines,
|
|
@@ -61,9 +152,8 @@ const fetch = async (req) => {
|
|
|
61
152
|
});
|
|
62
153
|
}
|
|
63
154
|
catch (e) {
|
|
64
|
-
const message = e instanceof Error ? e.message : undefined;
|
|
65
155
|
return Response.json({
|
|
66
|
-
message,
|
|
156
|
+
message: parseError(code, e),
|
|
67
157
|
}, { status: 400, statusText: 'Code execution error' });
|
|
68
158
|
}
|
|
69
159
|
};
|
package/code-tool-worker.mjs.map
CHANGED
|
@@ -1 +1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,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QACtE,OAAO,QAAQ,CAAC,IAAI,CAAC;YACnB,MAAM;YACN,QAAQ;YACR,QAAQ;SACe,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,QAAQ,CAAC,IAAI,CAClB;YACE,OAAO,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;SACP,EACvB,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,sBAAsB,EAAE,CACpD,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,KAAK,EAAE,CAAC"}
|
package/code-tool.js
CHANGED
|
@@ -50,7 +50,7 @@ async function codeTool() {
|
|
|
50
50
|
const metadata = { resource: 'all', operation: 'write', tags: [] };
|
|
51
51
|
const tool = {
|
|
52
52
|
name: 'execute',
|
|
53
|
-
description: 'Runs
|
|
53
|
+
description: 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client named "client", and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
|
|
54
54
|
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
|
|
55
55
|
};
|
|
56
56
|
// Import dynamically to avoid failing at import time in cases where the environment is not well-supported.
|
package/code-tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.js","sourceRoot":"","sources":["src/code-tool.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AAC;oBACrB,IAAI;oBACN,CAAC,CAAC;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;qBAC1B,CAAC;gBACN,MAAM,SAAS,GACb,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;oBACrB,IAAI;oBACN,CAAC,CAAC;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;qBAC9C,CAAC;gBACN,OAAO;oBACL,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC;iBAChF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAgB,CAAC;gBACvD,OAAO;oBACL,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oBACjE,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
package/code-tool.mjs
CHANGED
|
@@ -14,7 +14,7 @@ export async function codeTool() {
|
|
|
14
14
|
const metadata = { resource: 'all', operation: 'write', tags: [] };
|
|
15
15
|
const tool = {
|
|
16
16
|
name: 'execute',
|
|
17
|
-
description: 'Runs
|
|
17
|
+
description: 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client named "client", and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
|
|
18
18
|
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
|
|
19
19
|
};
|
|
20
20
|
// Import dynamically to avoid failing at import time in cases where the environment is not well-supported.
|
package/code-tool.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.mjs","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,OAAO,EAAE,MAAM,WAAW;OAC5B,EAAE,aAAa,EAAE,MAAM,UAAU;AAQxC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"code-tool.mjs","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,OAAO,EAAE,MAAM,WAAW;OAC5B,EAAE,aAAa,EAAE,MAAM,UAAU;AAQxC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,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E,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oBACjE,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
package/http.js
CHANGED
|
@@ -38,12 +38,12 @@ const newServer = ({ clientOptions, mcpOptions: defaultMcpOptions, req, res, })
|
|
|
38
38
|
mcpOptions,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
catch {
|
|
41
|
+
catch (error) {
|
|
42
42
|
res.status(401).json({
|
|
43
43
|
jsonrpc: '2.0',
|
|
44
44
|
error: {
|
|
45
45
|
code: -32000,
|
|
46
|
-
message:
|
|
46
|
+
message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
|
|
47
47
|
},
|
|
48
48
|
});
|
|
49
49
|
return null;
|
package/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAGtF,0FAAmG;AAEnG,sDAA8B;AAC9B,gDAAoD;AACpD,0CAA0D;AAC1D,wCAAsE;AACtE,0CAA6C;AAE7C,MAAM,SAAS,GAAG,CAAC,EACjB,aAAa,EACb,UAAU,EAAE,iBAAiB,EAC7B,GAAG,EACH,GAAG,GAMJ,EAAoB,EAAE;IACrB,MAAM,MAAM,GAAG,IAAA,qBAAY,GAAE,CAAC;IAE9B,IAAI,UAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,UAAU,GAAG,IAAA,2BAAiB,EAAC,iBAAiB,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,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,CAAC;IAEjC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,CAAC,KAAK,CAAC,4CAA4C,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;SAAM,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAC5B,OAAO,CAAC,KAAK,CAAC,iDAAiD,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,iDAAiD,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,0BAA0B,8BAYrC"}
|
package/http.mjs
CHANGED
|
@@ -32,12 +32,12 @@ const newServer = ({ clientOptions, mcpOptions: defaultMcpOptions, req, res, })
|
|
|
32
32
|
mcpOptions,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
catch {
|
|
35
|
+
catch (error) {
|
|
36
36
|
res.status(401).json({
|
|
37
37
|
jsonrpc: '2.0',
|
|
38
38
|
error: {
|
|
39
39
|
code: -32000,
|
|
40
|
-
message:
|
|
40
|
+
message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
return null;
|
package/http.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.mjs","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,6BAA6B,EAAE,MAAM,oDAAoD;OAE3F,OAAO,MAAM,SAAS;OACtB,EAAE,SAAS,EAAE,MAAM,yBAAyB;OAC5C,EAAc,iBAAiB,EAAE;OACjC,EAAiB,aAAa,EAAE,YAAY,EAAE;OAC9C,EAAE,gBAAgB,EAAE;AAE3B,MAAM,SAAS,GAAG,CAAC,EACjB,aAAa,EACb,UAAU,EAAE,iBAAiB,EAC7B,GAAG,EACH,GAAG,GAMJ,EAAoB,EAAE;IACrB,MAAM,MAAM,GAAG,YA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BAA0B,GAAG,KAAK,EAAE,OAAmB,EAAE,IAAiC,EAAE,EAAE;IACzG,MAAM,GAAG,GAAG,iBAAiB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAEjC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,CAAC,KAAK,CAAC,4CAA4C,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;SAAM,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAC5B,OAAO,CAAC,KAAK,CAAC,iDAAiD,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,iDAAiD,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henrylabs/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The official MCP Server for the Henry SDK API",
|
|
5
5
|
"author": "Henry SDK <lawrence@henry.social>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -27,12 +27,13 @@
|
|
|
27
27
|
"fix": "eslint --fix --ext ts,js ."
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@henrylabs/sdk": "^0.
|
|
30
|
+
"@henrylabs/sdk": "^0.9.0",
|
|
31
31
|
"@cloudflare/cabidela": "^0.2.4",
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.11.5",
|
|
33
33
|
"@valtown/deno-http-worker": "^0.0.21",
|
|
34
34
|
"cors": "^2.8.5",
|
|
35
35
|
"express": "^5.1.0",
|
|
36
|
+
"fuse.js": "^7.1.0",
|
|
36
37
|
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.6/jq-web.tar.gz",
|
|
37
38
|
"qs": "^6.14.0",
|
|
38
39
|
"typescript": "5.8.3",
|
package/server.js
CHANGED
|
@@ -22,7 +22,7 @@ var tools_2 = require("./tools.js");
|
|
|
22
22
|
Object.defineProperty(exports, "endpoints", { enumerable: true, get: function () { return tools_2.endpoints; } });
|
|
23
23
|
const newMcpServer = () => new mcp_js_1.McpServer({
|
|
24
24
|
name: 'henrylabs_sdk_api',
|
|
25
|
-
version: '0.
|
|
25
|
+
version: '0.9.0',
|
|
26
26
|
}, { capabilities: { tools: {}, logging: {} } });
|
|
27
27
|
exports.newMcpServer = newMcpServer;
|
|
28
28
|
// Create server instance
|
package/server.mjs
CHANGED
|
@@ -11,7 +11,7 @@ export { ClientType } from "./compat.mjs";
|
|
|
11
11
|
export { endpoints } from "./tools.mjs";
|
|
12
12
|
export const newMcpServer = () => new McpServer({
|
|
13
13
|
name: 'henrylabs_sdk_api',
|
|
14
|
-
version: '0.
|
|
14
|
+
version: '0.9.0',
|
|
15
15
|
}, { capabilities: { tools: {}, logging: {} } });
|
|
16
16
|
// Create server instance
|
|
17
17
|
export const server = newMcpServer();
|
package/src/code-tool-worker.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import util from 'node:util';
|
|
4
4
|
|
|
5
|
+
import Fuse from 'fuse.js';
|
|
5
6
|
import ts from 'typescript';
|
|
6
7
|
|
|
7
8
|
import { WorkerInput, WorkerSuccess, WorkerError } from './code-tool-types';
|
|
@@ -39,8 +40,130 @@ function getRunFunctionNode(
|
|
|
39
40
|
return null;
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
const fuse = new Fuse(
|
|
44
|
+
[
|
|
45
|
+
'client.products.retrieveDetails',
|
|
46
|
+
'client.products.search',
|
|
47
|
+
'client.products.variantCheck.create',
|
|
48
|
+
'client.products.variantCheck.retrieveStatus',
|
|
49
|
+
'client.cart.createCheckout',
|
|
50
|
+
'client.cart.items.add',
|
|
51
|
+
'client.cart.items.clear',
|
|
52
|
+
'client.cart.items.list',
|
|
53
|
+
'client.cart.items.remove',
|
|
54
|
+
'client.checkout.session.confirmCheckout',
|
|
55
|
+
'client.checkout.session.createQuote',
|
|
56
|
+
'client.checkout.session.listProducts',
|
|
57
|
+
'client.checkout.session.retrieveShippingInfo',
|
|
58
|
+
'client.orders.retrieveStatus',
|
|
59
|
+
'client.wallet.createCardCollection',
|
|
60
|
+
'client.merchants.checkStatus',
|
|
61
|
+
'client.merchants.getShippingInfo',
|
|
62
|
+
'client.merchants.listSupported',
|
|
63
|
+
],
|
|
64
|
+
{ threshold: 1, shouldSort: true },
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
function getMethodSuggestions(fullyQualifiedMethodName: string): string[] {
|
|
68
|
+
return fuse
|
|
69
|
+
.search(fullyQualifiedMethodName)
|
|
70
|
+
.map(({ item }) => item)
|
|
71
|
+
.slice(0, 5);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const proxyToObj = new WeakMap<any, any>();
|
|
75
|
+
const objToProxy = new WeakMap<any, any>();
|
|
76
|
+
|
|
77
|
+
type ClientProxyConfig = {
|
|
78
|
+
path: string[];
|
|
79
|
+
isBelievedBad?: boolean;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
function makeSdkProxy<T extends object>(obj: T, { path, isBelievedBad = false }: ClientProxyConfig): T {
|
|
83
|
+
let proxy: T = objToProxy.get(obj);
|
|
84
|
+
|
|
85
|
+
if (!proxy) {
|
|
86
|
+
proxy = new Proxy(obj, {
|
|
87
|
+
get(target, prop, receiver) {
|
|
88
|
+
const propPath = [...path, String(prop)];
|
|
89
|
+
const value = Reflect.get(target, prop, receiver);
|
|
90
|
+
|
|
91
|
+
if (isBelievedBad || (!(prop in target) && value === undefined)) {
|
|
92
|
+
// If we're accessing a path that doesn't exist, it will probably eventually error.
|
|
93
|
+
// Let's proxy it and mark it bad so that we can control the error message.
|
|
94
|
+
// We proxy an empty class so that an invocation or construction attempt is possible.
|
|
95
|
+
return makeSdkProxy(class {}, { path: propPath, isBelievedBad: true });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (value !== null && (typeof value === 'object' || typeof value === 'function')) {
|
|
99
|
+
return makeSdkProxy(value, { path: propPath, isBelievedBad });
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return value;
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
apply(target, thisArg, args) {
|
|
106
|
+
if (isBelievedBad || typeof target !== 'function') {
|
|
107
|
+
const fullyQualifiedMethodName = path.join('.');
|
|
108
|
+
const suggestions = getMethodSuggestions(fullyQualifiedMethodName);
|
|
109
|
+
throw new Error(
|
|
110
|
+
`${fullyQualifiedMethodName} is not a function. Did you mean: ${suggestions.join(', ')}`,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return Reflect.apply(target, proxyToObj.get(thisArg) ?? thisArg, args);
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
construct(target, args, newTarget) {
|
|
118
|
+
if (isBelievedBad || typeof target !== 'function') {
|
|
119
|
+
const fullyQualifiedMethodName = path.join('.');
|
|
120
|
+
const suggestions = getMethodSuggestions(fullyQualifiedMethodName);
|
|
121
|
+
throw new Error(
|
|
122
|
+
`${fullyQualifiedMethodName} is not a constructor. Did you mean: ${suggestions.join(', ')}`,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return Reflect.construct(target, args, newTarget);
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
objToProxy.set(obj, proxy);
|
|
131
|
+
proxyToObj.set(proxy, obj);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return proxy;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function parseError(code: string, error: unknown): string | undefined {
|
|
138
|
+
if (!(error instanceof Error)) return;
|
|
139
|
+
const message = error.name ? `${error.name}: ${error.message}` : error.message;
|
|
140
|
+
try {
|
|
141
|
+
// Deno uses V8; the first "<anonymous>:LINE:COLUMN" is the top of stack.
|
|
142
|
+
const lineNumber = error.stack?.match(/<anonymous>:([0-9]+):[0-9]+/)?.[1];
|
|
143
|
+
// -1 for the zero-based indexing
|
|
144
|
+
const line =
|
|
145
|
+
lineNumber &&
|
|
146
|
+
code
|
|
147
|
+
.split('\n')
|
|
148
|
+
.at(parseInt(lineNumber, 10) - 1)
|
|
149
|
+
?.trim();
|
|
150
|
+
return line ? `${message}\n at line ${lineNumber}\n ${line}` : message;
|
|
151
|
+
} catch {
|
|
152
|
+
return message;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
42
156
|
const fetch = async (req: Request): Promise<Response> => {
|
|
43
157
|
const { opts, code } = (await req.json()) as WorkerInput;
|
|
158
|
+
if (code == null) {
|
|
159
|
+
return Response.json(
|
|
160
|
+
{
|
|
161
|
+
message:
|
|
162
|
+
'The code param is missing. Provide one containing a top-level `run` function. Write code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```',
|
|
163
|
+
} satisfies WorkerError,
|
|
164
|
+
{ status: 400, statusText: 'Code execution error' },
|
|
165
|
+
);
|
|
166
|
+
}
|
|
44
167
|
|
|
45
168
|
const runFunctionNode = getRunFunctionNode(code);
|
|
46
169
|
if (!runFunctionNode) {
|
|
@@ -69,21 +192,17 @@ const fetch = async (req: Request): Promise<Response> => {
|
|
|
69
192
|
};
|
|
70
193
|
try {
|
|
71
194
|
let run_ = async (client: any) => {};
|
|
72
|
-
eval(
|
|
73
|
-
|
|
74
|
-
run_ = run;
|
|
75
|
-
`);
|
|
76
|
-
const result = await run_(client);
|
|
195
|
+
eval(`${code}\nrun_ = run;`);
|
|
196
|
+
const result = await run_(makeSdkProxy(client, { path: ['client'] }));
|
|
77
197
|
return Response.json({
|
|
78
198
|
result,
|
|
79
199
|
logLines,
|
|
80
200
|
errLines,
|
|
81
201
|
} satisfies WorkerSuccess);
|
|
82
202
|
} catch (e) {
|
|
83
|
-
const message = e instanceof Error ? e.message : undefined;
|
|
84
203
|
return Response.json(
|
|
85
204
|
{
|
|
86
|
-
message,
|
|
205
|
+
message: parseError(code, e),
|
|
87
206
|
} satisfies WorkerError,
|
|
88
207
|
{ status: 400, statusText: 'Code execution error' },
|
|
89
208
|
);
|
package/src/code-tool.ts
CHANGED
|
@@ -23,7 +23,7 @@ export async function codeTool(): Promise<Endpoint> {
|
|
|
23
23
|
const tool: Tool = {
|
|
24
24
|
name: 'execute',
|
|
25
25
|
description:
|
|
26
|
-
'Runs
|
|
26
|
+
'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client named "client", and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
|
|
27
27
|
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
|
|
28
28
|
};
|
|
29
29
|
|
package/src/http.ts
CHANGED
|
@@ -46,12 +46,12 @@ const newServer = ({
|
|
|
46
46
|
},
|
|
47
47
|
mcpOptions,
|
|
48
48
|
});
|
|
49
|
-
} catch {
|
|
49
|
+
} catch (error) {
|
|
50
50
|
res.status(401).json({
|
|
51
51
|
jsonrpc: '2.0',
|
|
52
52
|
error: {
|
|
53
53
|
code: -32000,
|
|
54
|
-
message:
|
|
54
|
+
message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
|
|
55
55
|
},
|
|
56
56
|
});
|
|
57
57
|
return null;
|
package/src/server.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|
|
18
18
|
export const tool: Tool = {
|
|
19
19
|
name: 'search_products',
|
|
20
20
|
description:
|
|
21
|
-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nSearch for products
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nSearch for products from Google Shopping. Returns basic product info including:\n- Product ID (required for getting detail links)\n- Name, price, description\n- Thumbnail image URL\n\nIMPORTANT: This endpoint does NOT return clickable product/store URLs. \nTo get actual store links where users can purchase products, you MUST \ncall retrieve_product_details with each product's ID.\n\nRecommended workflow:\n1. Call search_products to find products\n2. For each product, call retrieve_product_details(productId) to get store URLs\n3. Present results with both images and clickable store links\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
22
|
inputSchema: {
|
|
23
23
|
type: 'object',
|
|
24
24
|
properties: {
|
|
@@ -14,7 +14,7 @@ exports.metadata = {
|
|
|
14
14
|
};
|
|
15
15
|
exports.tool = {
|
|
16
16
|
name: 'search_products',
|
|
17
|
-
description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nSearch for products
|
|
17
|
+
description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nSearch for products from Google Shopping. Returns basic product info including:\n- Product ID (required for getting detail links)\n- Name, price, description\n- Thumbnail image URL\n\nIMPORTANT: This endpoint does NOT return clickable product/store URLs. \nTo get actual store links where users can purchase products, you MUST \ncall retrieve_product_details with each product's ID.\n\nRecommended workflow:\n1. Call search_products to find products\n2. For each product, call retrieve_product_details(productId) to get store URLs\n3. Present results with both images and clickable store links\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
18
18
|
inputSchema: {
|
|
19
19
|
type: 'object',
|
|
20
20
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-products.js","sourceRoot":"","sources":["../../src/tools/products/search-products.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAuD;AACvD,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5B,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,kBAAkB;IAC5B,WAAW,EAAE,gBAAgB;CAC9B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT
|
|
1
|
+
{"version":3,"file":"search-products.js","sourceRoot":"","sources":["../../src/tools/products/search-products.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAuD;AACvD,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5B,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,kBAAkB;IAC5B,WAAW,EAAE,gBAAgB;CAC9B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,wqEAAwqE;IAC1qE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,cAAc;aAC5B;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,OAAO;aACrB;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,QAAQ;aACtB;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oBAAoB;aAClC;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,6BAA6B;aAC3C;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kBAAkB;aAChC;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,cAAc;aAC5B;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,QAAQ;aACtB;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,MAAM;aACpB;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/F,CAAC,CAAC;AAHW,QAAA,OAAO,WAGlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -11,7 +11,7 @@ export const metadata = {
|
|
|
11
11
|
};
|
|
12
12
|
export const tool = {
|
|
13
13
|
name: 'search_products',
|
|
14
|
-
description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nSearch for products
|
|
14
|
+
description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nSearch for products from Google Shopping. Returns basic product info including:\n- Product ID (required for getting detail links)\n- Name, price, description\n- Thumbnail image URL\n\nIMPORTANT: This endpoint does NOT return clickable product/store URLs. \nTo get actual store links where users can purchase products, you MUST \ncall retrieve_product_details with each product's ID.\n\nRecommended workflow:\n1. Call search_products to find products\n2. For each product, call retrieve_product_details(productId) to get store URLs\n3. Present results with both images and clickable store links\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
15
15
|
inputSchema: {
|
|
16
16
|
type: 'object',
|
|
17
17
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-products.mjs","sourceRoot":"","sources":["../../src/tools/products/search-products.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAY,mBAAmB,EAAE,MAAM,4BAA4B;AAK1E,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5B,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,kBAAkB;IAC5B,WAAW,EAAE,gBAAgB;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT
|
|
1
|
+
{"version":3,"file":"search-products.mjs","sourceRoot":"","sources":["../../src/tools/products/search-products.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAY,mBAAmB,EAAE,MAAM,4BAA4B;AAK1E,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5B,U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