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
| Name | Required | Description | Default |
|---|---|---|---|
| material | Yes | Material type name (e.g., "PLA", "PETG", "ABS", "TPU") |
Implementation Reference
- src/tools/get-material-profile.ts:25-71 (handler)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")'), }, - src/tools/get-material-profile.ts:9-72 (registration)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') }] }; }, ); - src/data/db.ts:254-262 (handler)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; }