@maviapi/mcp 0.2.7 → 0.2.8

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/config.js CHANGED
@@ -1,4 +1,4 @@
1
- export const VERSION = "0.2.7";
1
+ export const VERSION = "0.2.8";
2
2
  export const DEFAULT_BASE_URL = "https://api.maviapi.com";
3
3
  export const SITE_URL = "https://maviapi.com";
4
4
  /**
package/dist/requests.js CHANGED
@@ -149,6 +149,10 @@ export const REQUEST_TOOLS = [
149
149
  description: 'The parameters of a call that shows the fault, e.g. {"geo": "187147", "page": 2}.',
150
150
  additionalProperties: true,
151
151
  },
152
+ request_id: {
153
+ type: "string",
154
+ description: "Optional: the x-request-id header of the failed call, so the team can find that exact call in its logs.",
155
+ },
152
156
  },
153
157
  },
154
158
  annotations: WRITE,
@@ -183,6 +187,13 @@ function describeReport(report) {
183
187
  return report.message;
184
188
  return `status ${String(report.status ?? "unknown")}`;
185
189
  }
190
+ /** "The build stopped at the build step (build_failed): <message>." with the code, message and step the backend gives. */
191
+ export function stoppedLine(s) {
192
+ const step = s.failure?.step;
193
+ const code = s.failure?.code ?? s.resultCode;
194
+ const message = (s.failure?.message ?? s.error ?? "no reason given").trim();
195
+ return `The build stopped${step ? ` at the ${step} step` : ""}${code ? ` (${code})` : ""}: ${message}${/[.!?]$/.test(message) ? "" : "."}`;
196
+ }
186
197
  const RUNNING = new Set(["queued", "reading", "mapping", "building", "testing"]);
187
198
  /** Phases that change on their own, so waiting on them is worth it. */
188
199
  const MOVING = new Set([...RUNNING, "publishing"]);
@@ -400,10 +411,12 @@ export class RequestTools {
400
411
  throw new UserError(`${api.slug} has no endpoint "${endpointArg}". Its endpoints: ${endpoints.map((e) => e.path).join(", ")}.`);
401
412
  }
402
413
  const params = objectArg(args, "params");
414
+ const requestId = typeof args.request_id === "string" ? args.request_id.trim() : "";
403
415
  const result = await this.client.reportEndpoint(api.slug, {
404
416
  path: endpoint.path,
405
417
  description,
406
418
  ...(Object.keys(params).length > 0 && { params }),
419
+ ...(requestId && { request_id: requestId }),
407
420
  });
408
421
  const body = payloadOf(result);
409
422
  if (!result.ok) {
@@ -531,7 +544,7 @@ export class RequestTools {
531
544
  out.push(`Live${s.live ? ` as ${s.live.version} at ${s.live.baseUrl}` : ""}. get_api "${s.slug}" shows it and call_api calls it.`);
532
545
  }
533
546
  else if (s.phase === "failed") {
534
- out.push(`The build stopped: ${s.error ?? "no reason given"}. ` +
547
+ out.push(`${stoppedLine(s)} ` +
535
548
  'send_request_message "try again" builds it again; a narrower description may build where this did not.');
536
549
  }
537
550
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maviapi/mcp",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "MCP server for maviapi, the unofficial API for any website: hosted, documented JSON APIs for sites with no official API, kept working when the site changes.",
5
5
  "mcpName": "io.github.kuzenlabs/maviapi-mcp",
6
6
  "type": "module",