@wrongstack/mcp 0.316.2 → 0.317.2

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 (2) hide show
  1. package/dist/index.js +8 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1122,21 +1122,23 @@ function normalizeMCPTools(value) {
1122
1122
  for (const raw of value) {
1123
1123
  if (!raw || typeof raw !== "object") continue;
1124
1124
  const t = raw;
1125
- if (typeof t.name !== "string" || t.name.trim().length === 0) continue;
1125
+ if (typeof t.name !== "string") continue;
1126
+ const name = t.name.trim();
1127
+ if (name.length === 0) continue;
1126
1128
  const inputSchema = t.inputSchema && typeof t.inputSchema === "object" && !Array.isArray(t.inputSchema) ? t.inputSchema : { type: "object", properties: {} };
1127
1129
  if (!t.inputSchema || typeof t.inputSchema !== "object" || Array.isArray(t.inputSchema)) {
1128
1130
  console.warn(
1129
1131
  JSON.stringify({
1130
1132
  level: "warn",
1131
1133
  event: "mcp.tool_schema_invalid",
1132
- tool: t.name,
1134
+ tool: name,
1133
1135
  message: "no/invalid inputSchema \u2014 defaulting to empty object",
1134
1136
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
1135
1137
  })
1136
1138
  );
1137
1139
  }
1138
1140
  tools.push({
1139
- name: t.name,
1141
+ name,
1140
1142
  ...typeof t.description === "string" ? { description: t.description } : {},
1141
1143
  inputSchema
1142
1144
  });
@@ -3567,13 +3569,14 @@ function wrapMCPTool(serverName, mcpTool, client, permission = "confirm", observ
3567
3569
  mutating: isMutatingTool(mcpTool),
3568
3570
  capabilities: [ToolCapabilities.MCP_PROXY],
3569
3571
  inputSchema: mcpTool.inputSchema ?? { type: "object", properties: {} },
3570
- async execute(input, _ctx, opts) {
3572
+ async execute(input, ctx, opts) {
3571
3573
  const startedAt = Date.now();
3572
3574
  observer?.onStart();
3573
3575
  let ok = false;
3574
3576
  try {
3575
3577
  const live = typeof client === "function" ? await client() : client;
3576
- const res = await live.callTool(mcpTool.name, input, { signal: opts.signal });
3578
+ const signal = opts?.signal ?? ctx?.signal;
3579
+ const res = await live.callTool(mcpTool.name, input, signal ? { signal } : void 0);
3577
3580
  if (res.isError) {
3578
3581
  throw new Error(stringify(res.content));
3579
3582
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/mcp",
3
- "version": "0.316.2",
3
+ "version": "0.317.2",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack Model Context Protocol client and registry: stdio, SSE, and streamable HTTP transports.",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "!dist/**/*.map"
27
27
  ],
28
28
  "dependencies": {
29
- "@wrongstack/core": "0.316.2"
29
+ "@wrongstack/core": "0.317.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^26.2.0",