Skip to main content
Glama

get_material_profile

Retrieve detailed material science profiles for 3D printing filaments including strength, flexibility, UV resistance, food safety, and nozzle requirements to inform material selection decisions.

Instructions

Get a detailed material science profile for a specific material type. Includes strength, flexibility, UV resistance, food safety, moisture sensitivity, difficulty level, typical uses, pros/cons, and nozzle requirements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
materialYesMaterial type name (e.g., "PLA", "PETG", "ABS", "TPU")

Implementation Reference

  • The tool handler for 'get_material_profile', which fetches the material profile from the database and formats it into a text response.
    async ({ material }) => {
      // Try exact match first, then uppercase
      let profile = getMaterialProfile(db, material);
      if (!profile) {
        profile = getMaterialProfile(db, material.toUpperCase());
      }
    
      if (!profile) {
        const available = getAvailableMaterialNames(db);
        return {
          isError: true,
          content: [
            {
              type: 'text' as const,
              text: `Material "${material}" not found. Available materials: ${available.join(', ')}`,
            },
          ],
        };
      }
    
      const lines = [
        `# ${profile.material_name} Material Profile`,
        '',
        '## Temperature Settings',
        `- Print Temperature: ${profile.print_temp_min}-${profile.print_temp_max}°C`,
        `- Bed Temperature: ${profile.bed_temp_min}-${profile.bed_temp_max}°C`,
        '',
        '## Properties',
        `- Strength: ${profile.strength}`,
        `- Flexibility: ${profile.flexibility}`,
        `- UV Resistance: ${profile.uv_resistance}`,
        `- Food Safe: ${profile.food_safe}`,
        `- Moisture Sensitivity: ${profile.moisture_sensitivity}`,
        '',
        '## Printing',
        `- Difficulty: ${profile.difficulty}`,
        `- Nozzle: ${profile.nozzle_notes ?? 'No special requirements'}`,
        `- Enclosure Needed: ${profile.enclosure_needed ? 'Yes' : 'No'}`,
        '',
        '## Usage',
        `- Typical Uses: ${profile.typical_uses}`,
        `- Pros: ${profile.pros}`,
        `- Cons: ${profile.cons}`,
      ];
    
      return { content: [{ type: 'text' as const, text: lines.join('\n') }] };
    },
  • The input schema for 'get_material_profile', requiring a material name string.
    inputSchema: {
      material: z
        .string()
        .describe('Material type name (e.g., "PLA", "PETG", "ABS", "TPU")'),
    },
  • The registration function that defines the 'get_material_profile' tool on the MCP server.
    export function registerGetMaterialProfile(
      server: McpServer,
      db: Database.Database,
    ): void {
      server.registerTool(
        'get_material_profile',
        {
          title: 'Get Material Profile',
          description:
            'Get a detailed material science profile for a specific material type. Includes strength, flexibility, UV resistance, food safety, moisture sensitivity, difficulty level, typical uses, pros/cons, and nozzle requirements.',
          inputSchema: {
            material: z
              .string()
              .describe('Material type name (e.g., "PLA", "PETG", "ABS", "TPU")'),
          },
        },
        async ({ material }) => {
          // Try exact match first, then uppercase
          let profile = getMaterialProfile(db, material);
          if (!profile) {
            profile = getMaterialProfile(db, material.toUpperCase());
          }
    
          if (!profile) {
            const available = getAvailableMaterialNames(db);
            return {
              isError: true,
              content: [
                {
                  type: 'text' as const,
                  text: `Material "${material}" not found. Available materials: ${available.join(', ')}`,
                },
              ],
            };
          }
    
          const lines = [
            `# ${profile.material_name} Material Profile`,
            '',
            '## Temperature Settings',
            `- Print Temperature: ${profile.print_temp_min}-${profile.print_temp_max}°C`,
            `- Bed Temperature: ${profile.bed_temp_min}-${profile.bed_temp_max}°C`,
            '',
            '## Properties',
            `- Strength: ${profile.strength}`,
            `- Flexibility: ${profile.flexibility}`,
            `- UV Resistance: ${profile.uv_resistance}`,
            `- Food Safe: ${profile.food_safe}`,
            `- Moisture Sensitivity: ${profile.moisture_sensitivity}`,
            '',
            '## Printing',
            `- Difficulty: ${profile.difficulty}`,
            `- Nozzle: ${profile.nozzle_notes ?? 'No special requirements'}`,
            `- Enclosure Needed: ${profile.enclosure_needed ? 'Yes' : 'No'}`,
            '',
            '## Usage',
            `- Typical Uses: ${profile.typical_uses}`,
            `- Pros: ${profile.pros}`,
            `- Cons: ${profile.cons}`,
          ];
    
          return { content: [{ type: 'text' as const, text: lines.join('\n') }] };
        },
      );
  • The underlying database function that retrieves a material profile by name.
    export function getMaterialProfile(
      db: Database.Database,
      name: string,
    ): MaterialProfileRow | null {
      const row = db
        .prepare('SELECT * FROM material_profiles WHERE material_name = ?')
        .get(name) as MaterialProfileRow | undefined;
      return row ?? null;
    }

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/gregario/3dprint-oracle'

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