@kaddo/mcp 3.88.3 → 3.89.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 (2) hide show
  1. package/dist/index.js +19 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11715,6 +11715,8 @@ function defaultMessageFor(code) {
11715
11715
  return "The external provider is temporarily unavailable.";
11716
11716
  case "INTEGRATION_TIMEOUT":
11717
11717
  return "The external provider did not respond in time.";
11718
+ case "INTEGRATION_INVALID_QUERY":
11719
+ return "The query syntax is invalid. Check filter values or JQL.";
11718
11720
  case "INTEGRATION_PROVIDER_ERROR":
11719
11721
  return "The external provider returned an error.";
11720
11722
  case "UNSUPPORTED_CAPABILITY":
@@ -12315,11 +12317,19 @@ async function handleJiraResponse(res) {
12315
12317
  if (res.status >= 500) throw integrationError("INTEGRATION_UNAVAILABLE");
12316
12318
  if (!res.ok) {
12317
12319
  let detail = "";
12320
+ let isJqlError = false;
12318
12321
  try {
12319
12322
  const body = await res.json();
12320
- detail = body.errorMessages?.[0] ?? "";
12323
+ const msgs = body.errorMessages?.filter(Boolean) ?? [];
12324
+ const fieldErrs = body.errors ? Object.entries(body.errors).map(([k2, v]) => `${k2}: ${v}`) : [];
12325
+ detail = [...msgs, ...fieldErrs].join("; ");
12326
+ if (res.status === 400) {
12327
+ const combined = detail.toLowerCase();
12328
+ isJqlError = combined.includes("jql") || combined.includes("query") || combined.includes("field") || combined.includes("clause");
12329
+ }
12321
12330
  } catch {
12322
12331
  }
12332
+ if (isJqlError) throw integrationError("INTEGRATION_INVALID_QUERY");
12323
12333
  throw integrationError("INTEGRATION_PROVIDER_ERROR", detail || `Jira responded with status ${res.status}.`);
12324
12334
  }
12325
12335
  return await res.json();
@@ -12473,19 +12483,19 @@ function createJiraAdapter() {
12473
12483
  const auth = authHeader(email, apiToken);
12474
12484
  const jql = buildJql(request.filters);
12475
12485
  const pageSize = Math.min(Math.max(1, request.pageSize ?? DEFAULT_PAGE_SIZE), 100);
12476
- const startAt = request.cursor ? Math.max(0, Number.parseInt(request.cursor, 10) || 0) : 0;
12486
+ const nextPageToken = request.cursor || void 0;
12477
12487
  try {
12478
- const fullJql = jql ? jql + " ORDER BY updated DESC" : "ORDER BY updated DESC";
12479
- const data = await jiraPost(baseUrl, "/rest/api/3/search/jql", auth, request.context.timeoutMs, {
12488
+ const fullJql = jql ? jql + " ORDER BY updated DESC" : "updated >= -30d ORDER BY updated DESC";
12489
+ const body = {
12480
12490
  jql: fullJql,
12481
- startAt,
12482
12491
  maxResults: pageSize,
12483
12492
  fields: SEARCH_FIELDS.split(",")
12484
- });
12493
+ };
12494
+ if (nextPageToken) body.nextPageToken = nextPageToken;
12495
+ const data = await jiraPost(baseUrl, "/rest/api/3/search/jql", auth, request.context.timeoutMs, body);
12485
12496
  const items = data.issues.map((issue) => normalizeIssue(issue, baseUrl, request.context.integrationId));
12486
- const nextStart = data.startAt + data.issues.length;
12487
- const hasMore = nextStart < data.total;
12488
- return { items, hasMore, ...hasMore ? { nextCursor: String(nextStart) } : {} };
12497
+ const hasMore = data.isLast === false;
12498
+ return { items, hasMore, ...hasMore && data.nextPageToken ? { nextCursor: data.nextPageToken } : {} };
12489
12499
  } catch (err) {
12490
12500
  throw normalizeProviderError(err);
12491
12501
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/mcp",
3
- "version": "3.88.3",
3
+ "version": "3.89.0",
4
4
  "description": "MCP server for Kaddo project knowledge: read-only resources/tools/prompts plus safe derived generation under .kaddo/.",
5
5
  "license": "MIT",
6
6
  "repository": {