@ampless/backend 1.0.0-beta.90 → 1.0.0-beta.91

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.
@@ -1814,12 +1814,23 @@ var tools = [
1814
1814
  }
1815
1815
  ];
1816
1816
 
1817
- // ../mcp-server/dist/jsonrpc/index.js
1817
+ // ../mcp-server/dist/chunk-4REBPD2N.js
1818
1818
  var JSON_RPC_PARSE_ERROR = -32700;
1819
1819
  var JSON_RPC_INVALID_REQUEST = -32600;
1820
1820
  var JSON_RPC_METHOD_NOT_FOUND = -32601;
1821
1821
  var JSON_RPC_INVALID_PARAMS = -32602;
1822
1822
  var JSON_RPC_INTERNAL_ERROR = -32603;
1823
+ var TOOL_USER_ERROR_BRAND = /* @__PURE__ */ Symbol.for("ampless.mcp.toolUserError");
1824
+ var ToolUserError = class extends Error {
1825
+ [TOOL_USER_ERROR_BRAND] = true;
1826
+ constructor(message) {
1827
+ super(message);
1828
+ this.name = "ToolUserError";
1829
+ }
1830
+ };
1831
+ function isToolUserError(error) {
1832
+ return error instanceof Error && error[TOOL_USER_ERROR_BRAND] === true;
1833
+ }
1823
1834
  var SUPPORTED_PROTOCOL_VERSIONS = ["2025-03-26", "2024-11-05"];
1824
1835
  var LATEST_SUPPORTED_PROTOCOL_VERSION = SUPPORTED_PROTOCOL_VERSIONS[0];
1825
1836
  function jsonRpcResult(id, result) {
@@ -1978,11 +1989,14 @@ async function dispatchMethod(req, opts) {
1978
1989
  });
1979
1990
  } catch (err2) {
1980
1991
  const rawMessage = err2 instanceof Error ? err2.message : String(err2);
1981
- console.error("[mcp-jsonrpc] tool dispatch failed", {
1982
- tool: params.name,
1983
- message: rawMessage
1984
- });
1985
- const message = opts.formatToolError ? opts.formatToolError(err2) : rawMessage;
1992
+ const userError = isToolUserError(err2);
1993
+ if (!userError) {
1994
+ console.error("[mcp-jsonrpc] tool dispatch failed", {
1995
+ tool: params.name,
1996
+ message: rawMessage
1997
+ });
1998
+ }
1999
+ const message = userError ? rawMessage : opts.formatToolError ? opts.formatToolError(err2) : rawMessage;
1986
2000
  return jsonRpcResult(id, {
1987
2001
  isError: true,
1988
2002
  content: [{ type: "text", text: message }]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampless/backend",
3
- "version": "1.0.0-beta.90",
3
+ "version": "1.0.0-beta.91",
4
4
  "description": "Amplify Gen 2 backend factories for ampless: auth, data, storage, event processors, API key renewer",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -69,8 +69,8 @@
69
69
  "@smithy/protocol-http": "^5.4.4",
70
70
  "@smithy/signature-v4": "^5.4.4",
71
71
  "fflate": "^0.8.3",
72
- "@ampless/mcp-server": "1.0.0-beta.67",
73
- "ampless": "1.0.0-beta.60"
72
+ "@ampless/mcp-server": "1.0.0-beta.68",
73
+ "ampless": "1.0.0-beta.61"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "@aws-amplify/backend": "^1.19.0",