Skip to main content
Glama

get_inventory

Retrieve complete hardware inventory for Cisco C-Series servers, including CPUs, memory, PCI cards, network adapters, and storage controllers.

Instructions

Complete hardware inventory: CPUs, DIMMs, PCI cards, network adapters, and storage controllers. Answers 'What hardware is in this server?'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that fetches complete hardware inventory (CPUs, DIMMs, PCI cards, network adapters, storage controllers, firmware versions) from CIMC using resolveClass queries and returns formatted JSON
    export async function getInventory(): Promise<string> {
      // Sequential calls
      const cpus = await resolveClass("processorUnit");
      const dimms = await resolveClass("memoryUnit");
      const pci = await resolveClass("pciEquipSlot");
      const adapters = await resolveClass("adaptorUnit");
      const controllers = await resolveClass("storageController");
      const firmware = await resolveClass("firmwareRunning");
    
      return JSON.stringify(
        {
          cpus: cpus.map((c) => ({
            dn: c.dn,
            id: c.id,
            model: c.model,
            vendor: c.vendor,
            arch: c.arch,
            cores: c.cores,
            coresEnabled: c.coresEnabled,
            threads: c.threads,
            speed: c.speed,
            operability: c.operability,
            presence: c.presence,
          })),
          memory: dimms
            .filter((d) => d.presence === "equipped")
            .map((d) => ({
              dn: d.dn,
              id: d.id,
              model: d.model,
              vendor: d.vendor,
              serial: d.serial,
              capacityMB: d.capacity,
              clockMHz: d.clock,
              type: d.type,
              formFactor: d.formFactor,
              location: d.location,
              operState: d.operState,
            })),
          pciSlots: pci.map((p) => ({
            dn: p.dn,
            id: p.id,
            model: p.model,
            vendor: p.vendor,
            controllerReported: p.controllerReported,
          })),
          networkAdapters: adapters.map((a) => ({
            dn: a.dn,
            id: a.id,
            model: a.model,
            vendor: a.vendor,
            serial: a.serial,
            presence: a.presence,
          })),
          storageControllers: controllers.map((c) => ({
            dn: c.dn,
            id: c.id,
            model: c.model,
            vendor: c.vendor,
            serial: c.serial,
            raidSupport: c.raidSupport,
            type: c.type,
            presence: c.presence,
          })),
          firmwareVersions: firmware.map((f) => ({
            dn: f.dn,
            type: f.type,
            version: f.version,
            deployment: f.deployment,
          })),
        },
        null,
        2,
      );
    }
  • Tool definition with name 'get_inventory', description, and empty input schema (no parameters required)
    export const getInventoryDef = {
      name: "get_inventory",
      description:
        "Complete hardware inventory: CPUs, DIMMs, PCI cards, network adapters, and storage controllers. Answers 'What hardware is in this server?'",
      inputSchema: z.object({}),
    };
  • src/index.ts:102-107 (registration)
    Registers the get_inventory tool with the MCP server using the definition metadata and wrapped handler
    server.tool(
      getInventoryDef.name,
      getInventoryDef.description,
      getInventoryDef.inputSchema.shape,
      wrapHandler(getInventory),
    );
  • Helper function used by getInventory to query all objects of a specific class from CIMC (e.g., processorUnit, memoryUnit, adaptorUnit)
    export async function resolveClass(
      classId: string,
      hierarchical = false,
    ): Promise<Record<string, string>[]> {
      const xml = `<configResolveClass cookie="{cookie}" inHierarchical="${hierarchical}" classId="${classId}"/>`;
      const result = await authenticatedRequest(xml);
      return extractOutConfigs(result, "configResolveClass");
    }

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/schwarztim/cimc-mcp'

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