Skip to main content
Glama

List Materials

list_materials

List all 3D printing material types from the database, including PLA, PETG, ABS, TPU, and Nylon, with filament counts and typical print settings.

Instructions

List all material types available in the database (PLA, PETG, ABS, TPU, Nylon, etc.) with filament counts and typical print settings. No inputs required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The registerListMaterials function registers the 'list_materials' tool on the MCP server. The handler (lines 16-41) invokes listMaterials(db), sorts results by filament count descending, and formats them into a markdown table as text output.
    export function registerListMaterials(
      server: McpServer,
      db: Database.Database,
    ): void {
      server.registerTool(
        'list_materials',
        {
          title: 'List Materials',
          description:
            'List all material types available in the database (PLA, PETG, ABS, TPU, Nylon, etc.) with filament counts and typical print settings. No inputs required.',
        },
        async () => {
          const materials = listMaterials(db);
    
          // Sort by count descending
          materials.sort((a, b) => b.filament_count - a.filament_count);
    
          const lines: string[] = [];
          lines.push(
            `${materials.length} material type${materials.length === 1 ? '' : 's'}:\n`,
          );
    
          lines.push('| Material | Filaments | Density | Extruder Temp | Bed Temp |');
          lines.push('|---|---|---|---|---|');
          for (const m of materials) {
            const density = m.density != null ? `${m.density} g/cm³` : '-';
            const extruder = m.extruder_temp != null ? `${m.extruder_temp}°C` : '-';
            const bed = m.bed_temp != null ? `${m.bed_temp}°C` : '-';
            lines.push(
              `| ${m.name} | ${m.filament_count} | ${density} | ${extruder} | ${bed} |`,
            );
          }
    
          return {
            content: [{ type: 'text' as const, text: lines.join('\n') }],
          };
        },
      );
  • The tool schema defines 'title' and 'description' metadata, with no input parameters. It states the tool lists material types with filament counts and print settings.
    {
      title: 'List Materials',
      description:
        'List all material types available in the database (PLA, PETG, ABS, TPU, Nylon, etc.) with filament counts and typical print settings. No inputs required.',
    },
  • src/server.ts:46-46 (registration)
    The tool is registered on the server in createServer() by calling registerListMaterials(server, db).
    registerListMaterials(server, db);
  • The listMaterials function in db.ts is the data access layer. It queries the database joining 'materials' with 'filaments' to get each material's filament count, returning MaterialRow objects sorted by name.
    export function listMaterials(db: Database.Database): MaterialRow[] {
      return db
        .prepare(
          `SELECT mat.*, COUNT(f.id) AS filament_count
           FROM materials mat
           JOIN filaments f ON f.material_id = mat.id
           GROUP BY mat.id
           ORDER BY mat.name`,
        )
        .all() as MaterialRow[];
    }
  • The MaterialRow interface defines the shape of data returned by the helper: id, name, density, extruder_temp, bed_temp, and filament_count.
    export interface MaterialRow {
      id: number;
      name: string;
      density: number | null;
      extruder_temp: number | null;
      bed_temp: number | null;
      filament_count: number;
    }
Behavior4/5

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

No annotations provided, but the description implies a read-only list operation. It does not explicitly state no side effects, but the verb 'list' and examples of returned data make behavior sufficiently clear.

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?

Two concise sentences, front-loading the purpose. Every word adds value with no redundancy.

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

Completeness4/5

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

Given no annotations or output schema, the description adequately describes return content (material types, counts, settings). It could mention use case or format, but is sufficient for a simple list tool.

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?

No parameters exist, so schema coverage is 100%. The description adds value by stating 'No inputs required', confirming the simplicity.

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 uses specific verb 'list' and resource 'material types' with concrete examples (PLA, PETG, etc.) and states it returns filament counts and print settings. This clearly distinguishes it from siblings like 'get_material_profile' or 'recommend_material'.

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?

It explicitly states 'No inputs required', making it clear when to invoke. However, it does not contrast with siblings or mention when not to use it, which would push it to a 5.

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

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