Skip to main content
Glama
fredriksknese

mcp-infoblox

create_fixed_address

Reserve a specific IP address for a device by binding it to a MAC address in Infoblox DHCP. This ensures consistent network connectivity and simplifies device management.

Instructions

Create a DHCP fixed address (reservation) in Infoblox

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipv4addrYesIPv4 address to reserve
macYesMAC address of the client (e.g., 00:11:22:33:44:55)
nameNoName for the fixed address
commentNoDescription
network_viewNoNetwork view
match_clientNoClient matching methodMAC_ADDRESS
optionsNoDHCP options

Implementation Reference

  • The handler function for 'create_fixed_address' tool. It builds the data object from input parameters and calls client.create('fixedaddress', data) to create a DHCP fixed address reservation in Infoblox. Returns success message with reference or error message.
      async ({
        ipv4addr,
        mac,
        name,
        comment,
        network_view,
        match_client,
        options,
      }) => {
        const data: Record<string, unknown> = { ipv4addr, mac };
        if (name) data.name = name;
        if (comment) data.comment = comment;
        if (network_view) data.network_view = network_view;
        if (match_client) data.match_client = match_client;
        if (options) data.options = options;
    
        try {
          const ref = await client.create("fixedaddress", data);
          return toolResult(
            `Fixed address created successfully.\nReference: ${ref}`,
          );
        } catch (error) {
          return toolResult(
            `Error creating fixed address: ${error}`,
            true,
          );
        }
      },
    );
  • Zod schema definition for 'create_fixed_address' tool inputs. Defines validation for ipv4addr (required), mac (required), name, comment, network_view, match_client (enum with default), and options (array of DHCP option objects).
    {
      ipv4addr: z.string().describe("IPv4 address to reserve"),
      mac: z
        .string()
        .describe(
          "MAC address of the client (e.g., 00:11:22:33:44:55)",
        ),
      name: z
        .string()
        .optional()
        .describe("Name for the fixed address"),
      comment: z
        .string()
        .optional()
        .describe("Description"),
      network_view: z
        .string()
        .optional()
        .describe("Network view"),
      match_client: z
        .enum([
          "MAC_ADDRESS",
          "CLIENT_ID",
          "CIRCUIT_ID",
          "REMOTE_ID",
        ])
        .optional()
        .default("MAC_ADDRESS")
        .describe("Client matching method"),
      options: z
        .array(
          z.object({
            name: z.string().describe("Option name"),
            num: z.number().describe("Option number"),
            use_option: z.boolean().default(true),
            value: z.string().describe("Option value"),
            vendor_class: z.string().default("DHCP"),
          }),
        )
        .optional()
        .describe("DHCP options"),
    },
  • Registration of 'create_fixed_address' tool using server.tool(). Includes tool name, description, input schema, and handler function. Part of the registerDhcpTools function that registers all DHCP-related tools.
    server.tool(
      "create_fixed_address",
      "Create a DHCP fixed address (reservation) in Infoblox",
      {
        ipv4addr: z.string().describe("IPv4 address to reserve"),
        mac: z
          .string()
          .describe(
            "MAC address of the client (e.g., 00:11:22:33:44:55)",
          ),
        name: z
          .string()
          .optional()
          .describe("Name for the fixed address"),
        comment: z
          .string()
          .optional()
          .describe("Description"),
        network_view: z
          .string()
          .optional()
          .describe("Network view"),
        match_client: z
          .enum([
            "MAC_ADDRESS",
            "CLIENT_ID",
            "CIRCUIT_ID",
            "REMOTE_ID",
          ])
          .optional()
          .default("MAC_ADDRESS")
          .describe("Client matching method"),
        options: z
          .array(
            z.object({
              name: z.string().describe("Option name"),
              num: z.number().describe("Option number"),
              use_option: z.boolean().default(true),
              value: z.string().describe("Option value"),
              vendor_class: z.string().default("DHCP"),
            }),
          )
          .optional()
          .describe("DHCP options"),
      },
      async ({
        ipv4addr,
        mac,
        name,
        comment,
        network_view,
        match_client,
        options,
      }) => {
        const data: Record<string, unknown> = { ipv4addr, mac };
        if (name) data.name = name;
        if (comment) data.comment = comment;
        if (network_view) data.network_view = network_view;
        if (match_client) data.match_client = match_client;
        if (options) data.options = options;
    
        try {
          const ref = await client.create("fixedaddress", data);
          return toolResult(
            `Fixed address created successfully.\nReference: ${ref}`,
          );
        } catch (error) {
          return toolResult(
            `Error creating fixed address: ${error}`,
            true,
          );
        }
      },
    );
  • InfobloxClient.create() method used by the handler to make the actual API call. Sends a POST request to create the fixed address object in Infoblox and returns the reference string.
    async create(
      objectType: string,
      data: Record<string, unknown>,
    ): Promise<string> {
      return this.request("POST", objectType, data) as Promise<string>;
    }
  • src/index.ts:44-44 (registration)
    Main entry point calls registerDhcpTools(server, client) to register all DHCP tools including 'create_fixed_address'.
    registerDhcpTools(server, client);

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/fredriksknese/mcp-infoblox'

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