Skip to main content
Glama

List Manufacturers

list_manufacturers

Retrieve a list of filament manufacturers with their filament counts, optionally filtered by material type like PLA or PETG.

Instructions

List all filament manufacturers in the database, with filament counts. Optionally filter to manufacturers that produce a specific material type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
materialNoFilter to manufacturers that produce this material type (e.g., "PLA", "PETG")

Implementation Reference

  • The handler callback for the 'list_manufacturers' tool. Accepts an optional 'material' input, calls listManufacturers(db, material), formats results as a markdown table, and returns them as text content.
      async ({ material }) => {
        const manufacturers = listManufacturers(db, material);
        const lines: string[] = [];
    
        if (material) {
          lines.push(
            `${manufacturers.length} manufacturer${manufacturers.length === 1 ? '' : 's'} producing ${material}:\n`,
          );
        } else {
          lines.push(
            `${manufacturers.length} manufacturer${manufacturers.length === 1 ? '' : 's'}:\n`,
          );
        }
    
        lines.push('| Manufacturer | Filaments |');
        lines.push('|---|---|');
        for (const m of manufacturers) {
          lines.push(`| ${m.name} | ${m.filament_count} |`);
        }
    
        return {
          content: [{ type: 'text' as const, text: lines.join('\n') }],
        };
      },
    );
  • Input schema for 'list_manufacturers': optional 'material' string to filter manufacturers by material type.
    {
      title: 'List Manufacturers',
      description:
        'List all filament manufacturers in the database, with filament counts. Optionally filter to manufacturers that produce a specific material type.',
      inputSchema: {
        material: z
          .string()
          .optional()
          .describe(
            'Filter to manufacturers that produce this material type (e.g., "PLA", "PETG")',
          ),
      },
  • Function 'registerListManufacturers' that registers the tool with the McpServer under the name 'list_manufacturers'.
    export function registerListManufacturers(
      server: McpServer,
      db: Database.Database,
    ): void {
      server.registerTool(
        'list_manufacturers',
        {
          title: 'List Manufacturers',
          description:
            'List all filament manufacturers in the database, with filament counts. Optionally filter to manufacturers that produce a specific material type.',
          inputSchema: {
            material: z
              .string()
              .optional()
              .describe(
                'Filter to manufacturers that produce this material type (e.g., "PLA", "PETG")',
              ),
          },
        },
        async ({ material }) => {
          const manufacturers = listManufacturers(db, material);
          const lines: string[] = [];
    
          if (material) {
            lines.push(
              `${manufacturers.length} manufacturer${manufacturers.length === 1 ? '' : 's'} producing ${material}:\n`,
            );
          } else {
            lines.push(
              `${manufacturers.length} manufacturer${manufacturers.length === 1 ? '' : 's'}:\n`,
            );
          }
    
          lines.push('| Manufacturer | Filaments |');
          lines.push('|---|---|');
          for (const m of manufacturers) {
            lines.push(`| ${m.name} | ${m.filament_count} |`);
          }
    
          return {
            content: [{ type: 'text' as const, text: lines.join('\n') }],
          };
        },
      );
  • src/server.ts:45-50 (registration)
    Registration call in the server: registerListManufacturers(server, db) wires the tool to the server.
    registerListManufacturers(server, db);
    registerListMaterials(server, db);
    registerGetMaterialProfile(server, db);
    registerCompareMaterials(server, db);
    registerRecommendMaterial(server, db);
    registerDiagnosePrintIssue(server, db);
  • The 'listManufacturers' helper function that queries the database (with optional material filter) and returns ManufacturerRow[]. Also shows the ManufacturerRow interface.
    export interface ManufacturerRow {
      id: number;
      name: string;
      website: string | null;
      country: string | null;
      filament_count: number;
    }
    
    export function listManufacturers(
      db: Database.Database,
      materialFilter?: string,
    ): ManufacturerRow[] {
      if (materialFilter) {
        return db
          .prepare(
            `SELECT m.*, COUNT(f.id) AS filament_count
             FROM manufacturers m
             JOIN filaments f ON f.manufacturer_id = m.id
             WHERE f.material_name = ?
             GROUP BY m.id
             ORDER BY m.name`,
          )
          .all(materialFilter) as ManufacturerRow[];
      }
      return db
        .prepare(
          `SELECT m.*, COUNT(f.id) AS filament_count
           FROM manufacturers m
           JOIN filaments f ON f.manufacturer_id = m.id
           GROUP BY m.id
           ORDER BY m.name`,
        )
        .all() as ManufacturerRow[];
    }
Behavior3/5

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

No annotations provided, so description carries the burden. It implies a read operation but doesn't disclose limits, pagination, or authentication. Adequate for a simple list tool.

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-loaded with main action. No extraneous information.

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

Completeness5/5

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

For a simple list tool with one optional parameter and no output schema, the description fully covers what the tool does and how to use it.

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?

Single parameter 'material' with schema description 'Filter to manufacturers that produce this material type'. Description adds examples 'PLA', 'PETG', enhancing clarity beyond schema.

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?

Description clearly states the verb 'list' and resource 'all filament manufacturers', with added detail 'with filament counts' and optional filter. It distinguishes from siblings like 'list_materials' and 'get_filament'.

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

Usage Guidelines3/5

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

No explicit when or when-not to use, nor alternatives. The usage is implied from the description, but not guided for complex scenarios.

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