bambu-printer-mcp 1.1.67 → 1.1.69

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.
@@ -23,4 +23,18 @@ export declare const FDM_CAPABILITY_RESOURCE: {
23
23
  description: string;
24
24
  };
25
25
  export declare const DESIGN_PROMPTS: DesignPrompt[];
26
+ /**
27
+ * How this server's configured slicer orients, makes supports and checks a slice: the slicer-specific half of a
28
+ * design pass's print plan (the fdm_slicing prompt). `capabilities` is what slice_stl applies on that backend, as
29
+ * counterpart_printer_info reports it.
30
+ */
31
+ export declare function slicingGuidance(slicerType: string, capabilities: {
32
+ supports: boolean;
33
+ orient: boolean;
34
+ }): string;
35
+ export declare const FDM_SLICING_PROMPT: {
36
+ name: string;
37
+ title: string;
38
+ description: string;
39
+ };
26
40
  export declare const SERVER_INSTRUCTIONS: string;
@@ -174,4 +174,30 @@ export const DESIGN_PROMPTS = [
174
174
  { name: "fdm_after_slice", title: "Review a slice", text: FDM_AFTER_SLICE,
175
175
  description: "A separate review turn after a candidate has been sliced, before presenting the manufacturing recommendation: keep, revise, or validate one specific uncertainty." },
176
176
  ];
177
- export const SERVER_INSTRUCTIONS = "When designing or editing a model to print, apply the fdm_design prompt. Add fdm_multicolor when several colours or support materials share a print, fdm_assembly when a split or joint could help, and fdm_after_slice as a separate review turn after a candidate has been sliced, before presenting the manufacturing recommendation. Read " + FDM_CAPABILITY_URI + " when a bridge or overhang is consequential and there is no sufficiently specific measured capability available.";
177
+ const SLICER_NAMES = {
178
+ bambustudio: "Bambu Studio", orcaslicer: "OrcaSlicer", "orcaslicer-bambulab": "FULU OrcaSlicer-bambulab",
179
+ "orca-slicer-api": "the remote OrcaSlicer service (orca-slicer-api)", prusaslicer: "PrusaSlicer", cura: "Cura", slic3r: "Slic3r",
180
+ };
181
+ /**
182
+ * How this server's configured slicer orients, makes supports and checks a slice: the slicer-specific half of a
183
+ * design pass's print plan (the fdm_slicing prompt). `capabilities` is what slice_stl applies on that backend, as
184
+ * counterpart_printer_info reports it.
185
+ */
186
+ export function slicingGuidance(slicerType, capabilities) {
187
+ const slicer = SLICER_NAMES[slicerType] ?? slicerType;
188
+ const lines = [
189
+ `How this printer MCP slices. Its slicer is ${slicer}.`,
190
+ "- When they could change a decision, read the printer's loaded filaments with get_printer_filaments and its slicing settings with get_slice_settings.",
191
+ "- To check a consequential choice, slice a checkpoint with slice_stl and read its structured slicer_result (return code, error and each plate's warning), not only the file path. A checkpoint is only a check: the print slices the exported model again.",
192
+ capabilities.orient
193
+ ? `- Orientation: slice_stl with orient true lets ${slicer}'s own auto-orient choose how an STL sits on the bed. It keeps overhang area low; it does not check cantilevers. To see what it chooses, slice the checkpoint with orient true. When a print is oriented this way, don't promise a particular orientation on the bed: the slicer chooses it.`
194
+ : `- Orientation: ${slicer} doesn't auto-orient here. An STL prints in the orientation it's exported in.`,
195
+ capabilities.supports
196
+ ? "- Supports: set enable_support on every slice_stl call. With enable_support true it generates supports in the style support_type names (tree(auto) or normal(auto)); with false it generates none; left out, the process preset's own setting applies. Slice the checkpoint with enable_support set the way the print will be sliced. A print gets the supports it was sliced with: print the sliced file itself, or slice the print with slice_stl and the same enable_support and support_type. print_3mf's own slicing of a file that isn't sliced yet takes no support settings; it uses the process profile's."
197
+ : `- Supports: ${slicer} takes no support settings from slice_stl here: whether it generates supports is its configured profile's own setting. Slice a checkpoint to see what that profile does before modeling any support yourself.`,
198
+ ];
199
+ return lines.join("\n");
200
+ }
201
+ export const FDM_SLICING_PROMPT = { name: "fdm_slicing", title: "How this MCP slices",
202
+ description: "Add to every design or model-editing task: how this server's slicer orients a model and generates supports, and how to check a choice with a checkpoint slice." };
203
+ export const SERVER_INSTRUCTIONS = "When designing or editing a model to print, apply the fdm_design prompt and the fdm_slicing prompt. Add fdm_multicolor when several colours or support materials share a print, fdm_assembly when a split or joint could help, and fdm_after_slice as a separate review turn after a candidate has been sliced, before presenting the manufacturing recommendation. Read " + FDM_CAPABILITY_URI + " when a bridge or overhang is consequential and there is no sufficiently specific measured capability available.";
package/dist/index.js CHANGED
@@ -2,7 +2,8 @@
2
2
  import { CAMERA_STREAM_TOOLS } from "./printers/camera-tools.js";
3
3
  import { withAnnotations } from "./tool-annotations.js";
4
4
  import { withRemote } from "./counterpart/remote.js";
5
- import { slicedFileFacts, slicerReport } from "./counterpart/sliced-file.js";
5
+ import { refusalReport, slicedFileFacts, slicerReport } from "./counterpart/sliced-file.js";
6
+ import { listModelPlates } from "./counterpart/model-plates.js";
6
7
  /** The slicer's verdict beside its result.json (`slicer_report`). */
7
8
  function reportOf(result) {
8
9
  const report = slicerReport(result);
@@ -23,7 +24,7 @@ import path from "path";
23
24
  import { createServer as createHttpServer } from "node:http";
24
25
  import { createHash, randomUUID } from "node:crypto";
25
26
  import { STLManipulator, SLICER_TYPES, normalizeSlicerType, SlicerRunError, } from "./stl/stl-manipulator.js";
26
- import { BambuNetworkBridge, describeBambuNetworkPrintError } from "./bambu-network-bridge.js";
27
+ import { BambuNetworkBridge, bridgeSnapshotRoot, describeBambuNetworkPrintError } from "./bambu-network-bridge.js";
27
28
  import { assertBambuNativeAvailable, bambuNativeControlsAvailable, bambuNativeUnavailableReason, interruptNativeOperations, validateBambuNativeMetadata, buildBambuNativeFanCommand, buildBambuNativeTemperatureCommand, printWithBambuNative, sendCommandWithBambuNative, uploadWithBambuNative, } from "./bambu-native.js";
28
29
  import { importFileViaBambuConnect } from "./bambu-connect.js";
29
30
  import { BlenderMcpBridge } from "./blender-mcp-bridge.js";
@@ -44,7 +45,7 @@ import { bambuPrinterInfo, bambuSliceCapabilities } from "./counterpart/info.js"
44
45
  import { DISCOVER_OUTPUT_SCHEMA, discoverBambu } from "./counterpart/discovery.js";
45
46
  import { SETUP_FIELDS_OUTPUT_SCHEMA, bambuSetupFields, slicerSetup } from "./counterpart/setup.js";
46
47
  import { PROPOSE_FILAMENTS_INPUT_PROPERTIES, PROPOSE_FILAMENTS_OUTPUT_SCHEMA, NO_COLOUR_NAMES, bambuTrayLabel, loadColourNames, proposeFilaments, spoolName } from "./counterpart/filaments.js";
47
- import { DESIGN_PROMPTS, FDM_CAPABILITY_GUIDANCE, FDM_CAPABILITY_RESOURCE, FDM_CAPABILITY_URI, SERVER_INSTRUCTIONS } from "./design-guidance.js";
48
+ import { DESIGN_PROMPTS, FDM_CAPABILITY_GUIDANCE, FDM_CAPABILITY_RESOURCE, FDM_CAPABILITY_URI, FDM_SLICING_PROMPT, SERVER_INSTRUCTIONS, slicingGuidance } from "./design-guidance.js";
48
49
  import { bambuProgress, offlineProgress } from "./counterpart/progress.js";
49
50
  import { makeCounterpart3mf } from "./counterpart/make-3mf.js";
50
51
  import { MAKE_3MF_OUTPUT_SCHEMA, PRINT_PROGRESS_OUTPUT_SCHEMA, PRINTER_INFO_OUTPUT_SCHEMA } from "./counterpart/schemas.js";
@@ -1614,7 +1615,7 @@ class BambuPrinterMCPServer {
1614
1615
  amsMapping: mapping,
1615
1616
  params: redactPrintParams(params),
1616
1617
  };
1617
- }));
1618
+ }, bridgeSnapshotRoot()));
1618
1619
  }
1619
1620
  async handoff3mfViaBambuConnect(args) {
1620
1621
  if (!args?.three_mf_path) {
@@ -1874,9 +1875,17 @@ class BambuPrinterMCPServer {
1874
1875
  /** The FDM design guidance as MCP prompts: the client decides when to attach each one. */
1875
1876
  setupPromptHandlers() {
1876
1877
  this.server.setRequestHandler(ListPromptsRequestSchema, async () => ({
1877
- prompts: DESIGN_PROMPTS.map(({ name, title, description }) => ({ name, title, description })),
1878
+ prompts: [...DESIGN_PROMPTS, FDM_SLICING_PROMPT].map(({ name, title, description }) => ({ name, title, description })),
1878
1879
  }));
1879
1880
  this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
1881
+ if (request.params.name === FDM_SLICING_PROMPT.name) {
1882
+ // The slicer slice_stl uses by default, and what it applies there (as counterpart_printer_info reports it).
1883
+ const slicerType = normalizeSlicerType(DEFAULT_SLICER_TYPE);
1884
+ return {
1885
+ description: FDM_SLICING_PROMPT.description,
1886
+ messages: [{ role: "user", content: { type: "text", text: slicingGuidance(slicerType, bambuSliceCapabilities(slicerType)) } }],
1887
+ };
1888
+ }
1880
1889
  const prompt = DESIGN_PROMPTS.find(item => item.name === request.params.name);
1881
1890
  if (!prompt)
1882
1891
  throw new McpError(ErrorCode.InvalidParams, `Unknown prompt: ${request.params.name}`);
@@ -2052,6 +2061,18 @@ class BambuPrinterMCPServer {
2052
2061
  required: ["three_mf_path"]
2053
2062
  }
2054
2063
  },
2064
+ {
2065
+ name: "list_3mf_plates",
2066
+ description: "List a Bambu Studio or OrcaSlicer 3MF's plates as its designer laid them out, before slicing: plate_count, and for each plate its index (from 0; slice_stl's slice_plate is index + 1, inspect_print_file's plate_index is index), name, the objects on it and whether the file already holds its G-code (sliced). A plain 3MF without plate metadata is one plate. include_thumbnails adds each plate's own preview from the file (thumbnail_png_base64). Read-only.",
2067
+ inputSchema: {
2068
+ type: "object",
2069
+ properties: {
2070
+ three_mf_path: { type: "string", description: "Path to the 3MF (a designer's project, sliced or not)" },
2071
+ include_thumbnails: { type: "boolean", description: "Include each plate's own preview PNG from the file, base64 (default false)" }
2072
+ },
2073
+ required: ["three_mf_path"]
2074
+ }
2075
+ },
2055
2076
  {
2056
2077
  name: "list_3mf_plate_objects",
2057
2078
  description: "List object IDs from a sliced 3MF plate. Use these IDs with skip_objects during a running print.",
@@ -2242,7 +2263,7 @@ class BambuPrinterMCPServer {
2242
2263
  },
2243
2264
  {
2244
2265
  name: "slice_stl",
2245
- description: "Slice an STL or 3MF file using a slicer to generate printable G-code or sliced 3MF. IMPORTANT: bambu_model must be specified to ensure the slicer generates safe G-code for the correct printer. The text result is the sliced file's path. When Bambu Studio or OrcaSlicer writes a result.json, structuredContent.slicer_result carries it verbatim, success or error: error_string, return_code and each sliced_plates[].warning_message, such as a floating cantilever. A failed slice's text starts with those words. A 3MF that carries its own process settings (a designer's Bambu Studio or Orca project) slices with them unless slicer_profile, template_name or template_3mf_path is given; the machine still comes from bambu_model. quality and strength adjust that process, and strength never lowers its walls or infill.",
2266
+ description: "Slice an STL or 3MF file using a slicer to generate printable G-code or sliced 3MF. IMPORTANT: bambu_model must be specified to ensure the slicer generates safe G-code for the correct printer. The text result is the sliced file's path. When Bambu Studio or OrcaSlicer writes a result.json, structuredContent.slicer_result carries it verbatim, success or error: error_string, return_code and each sliced_plates[].warning_message, such as a floating cantilever. structuredContent.slicer_report says whether it failed; for a failure, its message is a plain sentence for a person and slicer_message keeps the slicer's words, which a failed slice's text gives after that sentence. A 3MF that carries its own process settings (a designer's Bambu Studio or Orca project) slices with them unless slicer_profile, template_name or template_3mf_path is given; the machine still comes from bambu_model. quality and strength adjust that process, and strength never lowers its walls or infill.",
2246
2267
  inputSchema: {
2247
2268
  type: "object",
2248
2269
  properties: {
@@ -3359,6 +3380,14 @@ class BambuPrinterMCPServer {
3359
3380
  };
3360
3381
  break;
3361
3382
  }
3383
+ case "list_3mf_plates": {
3384
+ if (typeof args?.three_mf_path !== "string" || !args.three_mf_path)
3385
+ throw new Error("Missing required parameter: three_mf_path");
3386
+ if (args.include_thumbnails !== undefined && typeof args.include_thumbnails !== "boolean")
3387
+ throw new Error("include_thumbnails must be a boolean.");
3388
+ const plates = await listModelPlates(args.three_mf_path, { thumbnails: args.include_thumbnails === true });
3389
+ return { content: [{ type: "text", text: JSON.stringify(plates) }], structuredContent: plates };
3390
+ }
3362
3391
  case "list_3mf_plate_objects": {
3363
3392
  if (!args?.three_mf_path) {
3364
3393
  throw new Error("Missing required parameter: three_mf_path");
@@ -4387,13 +4416,18 @@ class BambuPrinterMCPServer {
4387
4416
  tool: name,
4388
4417
  ...(error instanceof PrinterRefusal ? { code: error.code } : {}),
4389
4418
  // The slicer's own result.json; the message starts with its error_string and warnings.
4390
- ...(error instanceof SlicerRunError && error.slicerResult ? { slicer_result: error.slicerResult, ...reportOf(error.slicerResult) } : {}),
4419
+ // A slicer failure always carries slicer_report: the plain sentence a person sees, the slicer's words for the log.
4420
+ // The report always says failed (a result.json that says success can still leave no output file).
4421
+ ...(error instanceof SlicerRunError ? {
4422
+ ...(error.slicerResult ? { slicer_result: error.slicerResult } : {}),
4423
+ slicer_report: { ...refusalReport(error.words), message: error.plain ?? error.words.slice(0, 2000) },
4424
+ } : {}),
4391
4425
  };
4392
4426
  // MCP clients validate structuredContent against a declared outputSchema even on
4393
4427
  // errors (SDK 1.32 Client.callTool), so those tools return the error as text only.
4394
4428
  return {
4395
- // A slicer failure leads with the slicer's own words.
4396
- content: [{ type: "text", text: error instanceof SlicerRunError && error.slicerText ? message : `Error: ${message}` }],
4429
+ // A slicer's refusal leads with its plain sentence, then the slicer's own words.
4430
+ content: [{ type: "text", text: error instanceof SlicerRunError && error.plain ? message : `Error: ${message}` }],
4397
4431
  ...(OUTPUT_SCHEMA_TOOLS.has(name) ? {} : { structuredContent: structured }),
4398
4432
  isError: true,
4399
4433
  };
@@ -4416,6 +4450,8 @@ class BambuPrinterMCPServer {
4416
4450
  // Closing the MCP transport aborts its active requests before exit cleanup.
4417
4451
  await this.server.close();
4418
4452
  await this.fusion.close();
4453
+ // The FULU host's container (BAMBU_NETWORK_BRIDGE_IMAGE) is removed with the server, not left running.
4454
+ await this.bambuNetwork.stop();
4419
4455
  this.httpRuntime?.httpServer.close();
4420
4456
  }
4421
4457
  catch (error) {
@@ -1,6 +1,9 @@
1
1
  export declare function cancelPendingPrinterOperations(_host: string, serial: string): void;
2
2
  export declare function withPrinterOperation<T>(_host: string, serial: string, operation: (assertActive: () => void) => Promise<T>): Promise<T>;
3
- /** Inspect and send a private copy, so changes to the user's source cannot change the job. */
4
- export declare function withPrintSnapshot<T>(source: string, operation: (snapshot: string, retainForDispatchedUpload: () => void) => Promise<T>): Promise<T>;
3
+ /**
4
+ * Inspect and send a private copy, so changes to the user's source cannot change the job. `root` is where the copy
5
+ * goes (the system temporary folder unless the bridge host needs it in a folder its container mounts).
6
+ */
7
+ export declare function withPrintSnapshot<T>(source: string, operation: (snapshot: string, retainForDispatchedUpload: () => void) => Promise<T>, root?: string): Promise<T>;
5
8
  export declare function uniquePrintName(filename: string): string;
6
9
  export declare function normalizedRemotePath(filename: string): string;
@@ -36,9 +36,12 @@ export async function withPrinterOperation(_host, serial, operation) {
36
36
  operations.delete(key);
37
37
  }
38
38
  }
39
- /** Inspect and send a private copy, so changes to the user's source cannot change the job. */
40
- export async function withPrintSnapshot(source, operation) {
41
- const directory = await fs.mkdtemp(path.join(os.tmpdir(), "bambu-print-"));
39
+ /**
40
+ * Inspect and send a private copy, so changes to the user's source cannot change the job. `root` is where the copy
41
+ * goes (the system temporary folder unless the bridge host needs it in a folder its container mounts).
42
+ */
43
+ export async function withPrintSnapshot(source, operation, root = os.tmpdir()) {
44
+ const directory = await fs.mkdtemp(path.join(root, "bambu-print-"));
42
45
  const snapshot = path.join(directory, path.basename(source));
43
46
  let retainUntilExit = false;
44
47
  try {
@@ -509,7 +509,12 @@ export async function inspectPrintFile(filePath, options) {
509
509
  invalid();
510
510
  continue;
511
511
  }
512
- if (!['M117', 'M118', 'M1002', 'M1006', 'M900', 'M970', 'M983.1', 'G383'].includes(code) && /[GM]\s*\d/i.test(argumentsText))
512
+ // Bambu Studio's skip-object start carries one base64 mask of the layer's objects (M624 /g8C/B8AAAA=), whose
513
+ // letters and digits can read as a command; only that exact one-token form is exempt.
514
+ const mask = argumentsText.trim();
515
+ // A whole base64 value (length a multiple of 4) that doesn't itself start like a command (M104S300, G28, T1).
516
+ const objectMask = code === 'M624' && /^[A-Za-z0-9+/]+={0,2}$/.test(mask) && mask.length % 4 === 0 && !/^[GMT]\d/i.test(mask);
517
+ if (!objectMask && !['M117', 'M118', 'M1002', 'M1006', 'M900', 'M970', 'M983.1', 'G383'].includes(code) && /[GM]\s*\d/i.test(argumentsText))
513
518
  fail('multiple commands on one line are unsupported');
514
519
  // Coordinated extrusion closes the startup-only allowance even when the
515
520
  // source omits layer comments. Retraction also closes it conservatively.
@@ -0,0 +1,4 @@
1
+ /** The plain sentence for a slicer's error, or undefined when the words aren't one this knows. */
2
+ export declare function plainSlicerError(words: string): string | undefined;
3
+ /** What a person is told when the slicer refused with words this doesn't know. */
4
+ export declare const UNKNOWN_SLICER_ERROR = "The slicer couldn't slice this model. Its own message is kept for the log.";
@@ -0,0 +1,62 @@
1
+ /**
2
+ * A slicer's refusal in plain words. Bambu Studio, OrcaSlicer, PrusaSlicer and CuraEngine word their errors for
3
+ * their own windows ("One of the plate is empty or has no object fully inside it..."); a client shows the person
4
+ * the sentence here and keeps the slicer's own words for its logs (`slicer_report.slicer_message`).
5
+ *
6
+ * The phrases are the slicers' own strings: Bambu Studio 02.09 and OrcaSlicer 2.3 (their CLI and validation
7
+ * messages), PrusaSlicer 2.9.2 (src/libslic3r/Print.cpp, src/CLI/ProcessActions.cpp) and CuraEngine
8
+ * (src/FffPolygonGenerator.cpp). Matching is on a lowercase fragment, so a version that adds a prefix or a
9
+ * plate number still matches.
10
+ */
11
+ const PLAIN = [
12
+ {
13
+ phrases: [
14
+ "one of the plate is empty or has no object fully inside it",
15
+ "a plate is empty or has no object fully inside it",
16
+ "cannot send the print job for empty plate",
17
+ "no object is fully inside the print volume",
18
+ "found no objects in print volume to slice",
19
+ "found no objects in print volume after skip",
20
+ "all objects are outside of the print volume",
21
+ "arrangement ignored the following objects which can't fit into a single bed",
22
+ ],
23
+ sentence: "Nothing on this plate can be printed: no part sits fully on the bed. A part is off the plate or across its edge, or the model is bigger than the bed.",
24
+ },
25
+ {
26
+ phrases: [
27
+ "laid over the boundary of plate or exceeds the height limit",
28
+ "layed over the boundary of plate",
29
+ "laid over the plate boundaries",
30
+ "partly inside, can not be sliced",
31
+ "located over the boundary of the heated bed",
32
+ ],
33
+ sentence: "A part sits across the edge of the plate, or is taller than the printer can print, so it can't be sliced as it is placed.",
34
+ },
35
+ {
36
+ phrases: ["exceeds the maximum build volume height", "exceeds the printable height"],
37
+ sentence: "The model is taller than the printer can print.",
38
+ },
39
+ {
40
+ phrases: ["object too large", "scale to fit error", "printable area/volume reduced"],
41
+ sentence: "The model is larger than the printer's bed.",
42
+ },
43
+ {
44
+ phrases: ["found g-code outside of the printable area", "found g-code in unprintable area", "g-code path exceeds the printable range"],
45
+ sentence: "The print would go outside the area the printer can reach, usually a brim, skirt, support or the wipe tower near an edge. Move the model further onto the plate.",
46
+ },
47
+ {
48
+ phrases: ["g-code path conflicts found", "found gcode path conflicts between object"],
49
+ sentence: "Two parts are so close that their print paths overlap. Move them apart.",
50
+ },
51
+ {
52
+ phrases: ["the supplied settings will cause an empty print", "there are no non-empty layers"],
53
+ sentence: "These settings would print nothing: no layer of the model has anything to print.",
54
+ },
55
+ ];
56
+ /** The plain sentence for a slicer's error, or undefined when the words aren't one this knows. */
57
+ export function plainSlicerError(words) {
58
+ const text = words.toLowerCase();
59
+ return PLAIN.find(entry => entry.phrases.some(phrase => text.includes(phrase)))?.sentence;
60
+ }
61
+ /** What a person is told when the slicer refused with words this doesn't know. */
62
+ export const UNKNOWN_SLICER_ERROR = "The slicer couldn't slice this model. Its own message is kept for the log.";
@@ -68,6 +68,10 @@ export type SliceOutput = {
68
68
  export declare class SlicerRunError extends Error {
69
69
  readonly slicerResult?: SlicerResult | undefined;
70
70
  readonly slicerText: string;
71
+ /** What a person is told for a slicer's refusal: a plain sentence, never its own words (src/slicer/slicer-messages.ts). */
72
+ readonly plain?: string;
73
+ /** The slicer's words and this server's detail, after the plain sentence: what slicer_report.slicer_message keeps. */
74
+ readonly words: string;
71
75
  constructor(detail: string, slicerResult?: SlicerResult | undefined);
72
76
  }
73
77
  export declare class STLManipulator extends EventEmitter {
@@ -12,6 +12,7 @@ import * as crypto from 'crypto';
12
12
  import { execFile } from 'child_process';
13
13
  import { keepSlice, restoreSlice, sliceCacheKey } from '../slicer/slice-cache.js';
14
14
  import { flattenForCli, detectProfilesRoot, resolveBblMachineProfile } from '../slicer/profile-flatten.js';
15
+ import { plainSlicerError, UNKNOWN_SLICER_ERROR } from '../slicer/slicer-messages.js';
15
16
  import { applyProcessOverrides } from '../slicer/process-overrides.js';
16
17
  import { profileJsonFiles } from '../slicer/profile-files.js';
17
18
  import { materializeOrcaProfilesRoot, stageOrcaCliProfiles } from '../slicer/orca-profile-cache.js';
@@ -122,10 +123,16 @@ const PROFILE_METADATA_KEYS = new Set([
122
123
  export class SlicerRunError extends Error {
123
124
  constructor(detail, slicerResult) {
124
125
  const slicerText = slicerResult ? slicerResultText(slicerResult) : "";
125
- super(slicerText ? `${slicerText}\n${detail}` : detail);
126
+ const words = slicerText ? `${slicerText}\n${detail}` : detail;
127
+ // A known refusal, or one in the slicer's own words, is said plainly. A fault of the setup (no slicer, a crash,
128
+ // no output) stays in this server's own words, which say what to fix.
129
+ const plain = plainSlicerError(words) ?? (slicerText ? UNKNOWN_SLICER_ERROR : undefined);
130
+ super(plain ? `${plain}\nThe slicer said: ${words}` : words);
126
131
  this.slicerResult = slicerResult;
127
132
  this.name = "SlicerRunError";
128
133
  this.slicerText = slicerText;
134
+ this.plain = plain;
135
+ this.words = words;
129
136
  }
130
137
  }
131
138
  /**
@@ -31,6 +31,7 @@ export const TOOL_ANNOTATIONS = {
31
31
  // Local reads
32
32
  inspect_print_file: READ_LOCAL,
33
33
  list_3mf_plate_objects: READ_LOCAL,
34
+ list_3mf_plates: READ_LOCAL,
34
35
  get_stl_info: READ_LOCAL,
35
36
  list_templates: READ_LOCAL,
36
37
  get_slice_settings: LOCAL_OUTPUT, // a 3MF's settings are extracted to a fixed file in the temporary directory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bambu-printer-mcp",
3
- "version": "1.1.67",
3
+ "version": "1.1.69",
4
4
  "description": "MCP server for Bambu Lab 3D printers with STL manipulation, slicing, and print management",
5
5
  "main": "dist/index.js",
6
6
  "repository": {