Skip to main content
Glama
Noosbai
by Noosbai

Diagnostiquer un défaut d'impression

diagnose_print

Diagnose 3D printing defects by describing observed issues to receive probable causes, corrective actions, and PrusaSlicer setting adjustments.

Instructions

Diagnostic post-impression basé sur la Bible FDM. Décris le défaut observé et obtiens les causes probables, les corrections à appliquer, et les réglages PrusaSlicer à modifier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
defectYesDescription du défaut observé (ex: 'warping', 'stringing', 'sous-extrusion', 'couches décalées', 'ringing', 'elephant foot', 'délamination', 'buse bouchée')
materialNoMatériau utilisé (PLA, PETG, ABS...)
detailsNoDétails supplémentaires sur le problème

Implementation Reference

  • Main handler function that processes the diagnose_print tool request. It searches the diagnostic database for matching defects based on user input, performs fuzzy matching on symptoms if needed, and generates a detailed diagnostic response with symptoms, causes, material-specific notes, fixes, and PrusaSlicer settings.
    async ({ defect, material, details }) => {
      const query = defect.toLowerCase().trim();
    
      // Find matching diagnostics
      const matches = DIAGNOSTIC_DB.filter((entry) =>
        entry.aliases.some((alias) => query.includes(alias)) ||
        query.includes(entry.defect.toLowerCase())
      );
    
      // If no exact match, do fuzzy search on symptoms
      if (matches.length === 0) {
        const fuzzy = DIAGNOSTIC_DB.filter((entry) =>
          entry.symptoms.some((s) => {
            const sLower = s.toLowerCase();
            return query.split(/\s+/).some((word) => word.length > 3 && sLower.includes(word));
          })
        );
        matches.push(...fuzzy);
      }
    
      if (matches.length === 0) {
        // Return all available defects as suggestions
        const available = DIAGNOSTIC_DB.map((e) => `- ${e.defect}`).join("\n");
        return {
          content: [{
            type: "text" as const,
            text: `Défaut non reconnu : "${defect}"\n\n` +
              `**Défauts diagnosticables :**\n${available}\n\n` +
              `_Décris le problème avec plus de détails ou utilise un des termes ci-dessus._`,
          }],
        };
      }
    
      const lines: string[] = [];
    
      for (const entry of matches) {
        lines.push(`## ${entry.defect}`);
        lines.push("");
    
        lines.push("### Symptômes");
        for (const s of entry.symptoms) {
          lines.push(`- ${s}`);
        }
        lines.push("");
    
        lines.push("### Causes probables");
        for (const c of entry.causes) {
          lines.push(`- ${c}`);
        }
        lines.push("");
    
        // Material-specific notes
        if (material) {
          const matUpper = material.toUpperCase();
          const materialNotes: string[] = [];
    
          if (entry.defect.includes("Warping") && ["ABS", "ASA", "PC", "NYLON"].includes(matUpper)) {
            materialNotes.push(`${matUpper} est particulièrement sujet au warping — enceinte fermée OBLIGATOIRE`);
          }
          if (entry.defect.includes("Stringing") && matUpper === "PETG") {
            materialNotes.push("PETG est connu pour le stringing — réduire temp à 230°C, rétraction max 0.8-1mm");
          }
          if (entry.defect.includes("Stringing") && matUpper === "TPU") {
            materialNotes.push("TPU : rétraction très limitée (0.5mm max). Accepter un peu de stringing ou post-traiter.");
          }
          if (entry.defect.includes("Délamination") && ["ABS", "ASA"].includes(matUpper)) {
            materialNotes.push(`${matUpper} : ventilateur à 0%, enceinte fermée, temp buse 255-260°C minimum`);
          }
    
          if (materialNotes.length > 0) {
            lines.push(`### Notes spécifiques ${matUpper}`);
            for (const note of materialNotes) {
              lines.push(`- ${note}`);
            }
            lines.push("");
          }
        }
    
        lines.push("### Corrections recommandées (Bible FDM)");
        for (let i = 0; i < entry.fixes.length; i++) {
          lines.push(`${i + 1}. ${entry.fixes[i]}`);
        }
        lines.push("");
    
        lines.push("### Réglages PrusaSlicer à modifier");
        for (const [key, value] of Object.entries(entry.preventionSettings)) {
          lines.push(`- **${key}** : ${value}`);
        }
        lines.push("");
      }
    
      if (details) {
        lines.push(`_Détails fournis : ${details}_`);
        lines.push("");
      }
    
      lines.push("---");
      lines.push("_Diagnostic basé sur la Bible de l'impression 3D FDM et les recommandations Prusa officielles._");
    
      return {
        content: [{ type: "text" as const, text: lines.join("\n") }],
      };
    },
  • Input schema definition using zod for the diagnose_print tool. Defines three optional parameters: defect (required), material (optional), and details (optional) with descriptions.
    inputSchema: {
      defect: z.string().describe(
        "Description du défaut observé (ex: 'warping', 'stringing', 'sous-extrusion', " +
        "'couches décalées', 'ringing', 'elephant foot', 'délamination', 'buse bouchée')"
      ),
      material: z.string().optional().describe("Matériau utilisé (PLA, PETG, ABS...)"),
      details: z.string().optional().describe("Détails supplémentaires sur le problème"),
    },
  • The registerDiagnosePrint function that registers the diagnose_print tool with the MCP server. Includes tool metadata (title, description), input schema, and the async handler function.
    export function registerDiagnosePrint(server: McpServer) {
      server.registerTool(
        "diagnose_print",
        {
          title: "Diagnostiquer un défaut d'impression",
          description:
            "Diagnostic post-impression basé sur la Bible FDM. " +
            "Décris le défaut observé et obtiens les causes probables, " +
            "les corrections à appliquer, et les réglages PrusaSlicer à modifier.",
          inputSchema: {
            defect: z.string().describe(
              "Description du défaut observé (ex: 'warping', 'stringing', 'sous-extrusion', " +
              "'couches décalées', 'ringing', 'elephant foot', 'délamination', 'buse bouchée')"
            ),
            material: z.string().optional().describe("Matériau utilisé (PLA, PETG, ABS...)"),
            details: z.string().optional().describe("Détails supplémentaires sur le problème"),
          },
        },
        async ({ defect, material, details }) => {
          const query = defect.toLowerCase().trim();
    
          // Find matching diagnostics
          const matches = DIAGNOSTIC_DB.filter((entry) =>
            entry.aliases.some((alias) => query.includes(alias)) ||
            query.includes(entry.defect.toLowerCase())
          );
    
          // If no exact match, do fuzzy search on symptoms
          if (matches.length === 0) {
            const fuzzy = DIAGNOSTIC_DB.filter((entry) =>
              entry.symptoms.some((s) => {
                const sLower = s.toLowerCase();
                return query.split(/\s+/).some((word) => word.length > 3 && sLower.includes(word));
              })
            );
            matches.push(...fuzzy);
          }
    
          if (matches.length === 0) {
            // Return all available defects as suggestions
            const available = DIAGNOSTIC_DB.map((e) => `- ${e.defect}`).join("\n");
            return {
              content: [{
                type: "text" as const,
                text: `Défaut non reconnu : "${defect}"\n\n` +
                  `**Défauts diagnosticables :**\n${available}\n\n` +
                  `_Décris le problème avec plus de détails ou utilise un des termes ci-dessus._`,
              }],
            };
          }
    
          const lines: string[] = [];
    
          for (const entry of matches) {
            lines.push(`## ${entry.defect}`);
            lines.push("");
    
            lines.push("### Symptômes");
            for (const s of entry.symptoms) {
              lines.push(`- ${s}`);
            }
            lines.push("");
    
            lines.push("### Causes probables");
            for (const c of entry.causes) {
              lines.push(`- ${c}`);
            }
            lines.push("");
    
            // Material-specific notes
            if (material) {
              const matUpper = material.toUpperCase();
              const materialNotes: string[] = [];
    
              if (entry.defect.includes("Warping") && ["ABS", "ASA", "PC", "NYLON"].includes(matUpper)) {
                materialNotes.push(`${matUpper} est particulièrement sujet au warping — enceinte fermée OBLIGATOIRE`);
              }
              if (entry.defect.includes("Stringing") && matUpper === "PETG") {
                materialNotes.push("PETG est connu pour le stringing — réduire temp à 230°C, rétraction max 0.8-1mm");
              }
              if (entry.defect.includes("Stringing") && matUpper === "TPU") {
                materialNotes.push("TPU : rétraction très limitée (0.5mm max). Accepter un peu de stringing ou post-traiter.");
              }
              if (entry.defect.includes("Délamination") && ["ABS", "ASA"].includes(matUpper)) {
                materialNotes.push(`${matUpper} : ventilateur à 0%, enceinte fermée, temp buse 255-260°C minimum`);
              }
    
              if (materialNotes.length > 0) {
                lines.push(`### Notes spécifiques ${matUpper}`);
                for (const note of materialNotes) {
                  lines.push(`- ${note}`);
                }
                lines.push("");
              }
            }
    
            lines.push("### Corrections recommandées (Bible FDM)");
            for (let i = 0; i < entry.fixes.length; i++) {
              lines.push(`${i + 1}. ${entry.fixes[i]}`);
            }
            lines.push("");
    
            lines.push("### Réglages PrusaSlicer à modifier");
            for (const [key, value] of Object.entries(entry.preventionSettings)) {
              lines.push(`- **${key}** : ${value}`);
            }
            lines.push("");
          }
    
          if (details) {
            lines.push(`_Détails fournis : ${details}_`);
            lines.push("");
          }
    
          lines.push("---");
          lines.push("_Diagnostic basé sur la Bible de l'impression 3D FDM et les recommandations Prusa officielles._");
    
          return {
            content: [{ type: "text" as const, text: lines.join("\n") }],
          };
        },
      );
    }
  • src/index.ts:22-22 (registration)
    Import statement for registerDiagnosePrint function in the main server entry point.
    import { registerDiagnosePrint } from "./tools/diagnose-print.js";
  • src/index.ts:50-50 (registration)
    Registration call for the diagnose_print tool in the main server initialization.
    registerDiagnosePrint(server);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the tool's function and output (causes, corrections, settings), but lacks details on limitations, error handling, or response format. It doesn't contradict annotations (none exist), but could be more comprehensive about what the tool does and doesn't do.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose and key outputs. Every word earns its place, with no redundancy or unnecessary elaboration, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description adequately covers the tool's purpose and basic usage but lacks details on behavioral traits, error cases, or output structure. For a diagnostic tool with three parameters, it's minimally viable but could benefit from more context about how results are returned or limitations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds context by mentioning the FDM Bible as the knowledge source and specifying the output types (causes, corrections, settings), which helps understand what the tool does with the inputs. However, it doesn't add specific semantic details beyond the schema's parameter descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: to diagnose print defects based on the FDM Bible, providing probable causes, corrections, and PrusaSlicer adjustments. It specifies the verb ('diagnostiquer') and resource ('défaut d'impression'), and distinguishes itself from siblings like 'check_printability' or 'print_wizard' by focusing on post-print analysis rather than pre-print checks or general guidance.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context: after printing ('post-impression') when a defect is observed, with no explicit exclusions or alternatives mentioned. It doesn't specify when not to use it or name alternative tools, but the context is clear enough for typical use cases without being misleading.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Noosbai/PrusaMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server