Skip to main content
Glama

get_agent_network

List network interfaces and their IP addresses from a specified Wazuh agent for security analysis.

Instructions

List network interfaces and their IP addresses on a Wazuh agent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesAgent identifier (e.g., '001')

Implementation Reference

  • The tool "get_agent_network" is registered via server.tool() with an agent_id string parameter, description, and async handler.
    server.tool(
      "get_agent_network",
      "List network interfaces and their IP addresses on a Wazuh agent",
      {
        agent_id: z
          .string()
          .describe("Agent identifier (e.g., '001')"),
      },
      async ({ agent_id }) => {
        try {
          const response = await client.getAgentNetwork(agent_id);
          const data = response.data;
    
          const result = {
            agent_id,
            interfaces: data.affected_items.map((iface) => ({
              name: iface.name,
              type: iface.type,
              state: iface.state,
              mac: iface.mac,
              mtu: iface.mtu,
              ipv4: iface.ipv4,
              ipv6: iface.ipv6,
              tx_packets: iface.tx_packets,
              rx_packets: iface.rx_packets,
            })),
            total: data.total_affected_items,
          };
    
          return {
            content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify({
                  error: error instanceof Error ? error.message : String(error),
                }),
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Handler function that calls client.getAgentNetwork(agent_id), maps the response to a clean interfaces list (name, type, state, mac, mtu, ipv4, ipv6, tx_packets, rx_packets), and returns the result as JSON text content.
    async ({ agent_id }) => {
      try {
        const response = await client.getAgentNetwork(agent_id);
        const data = response.data;
    
        const result = {
          agent_id,
          interfaces: data.affected_items.map((iface) => ({
            name: iface.name,
            type: iface.type,
            state: iface.state,
            mac: iface.mac,
            mtu: iface.mtu,
            ipv4: iface.ipv4,
            ipv6: iface.ipv6,
            tx_packets: iface.tx_packets,
            rx_packets: iface.rx_packets,
          })),
          total: data.total_affected_items,
        };
    
        return {
          content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                error: error instanceof Error ? error.message : String(error),
              }),
            },
          ],
          isError: true,
        };
      }
    }
  • Zod schema for the tool input: a required string agent_id with description.
    {
      agent_id: z
        .string()
        .describe("Agent identifier (e.g., '001')"),
    },
  • Client helper method that makes a GET request to /syscollector/{agentId}/netiface endpoint, returning paginated network interface data.
    async getAgentNetwork(
      agentId: string
    ): Promise<WazuhApiResponse<WazuhPaginatedData<WazuhNetIface>>> {
      return this.get(`/syscollector/${agentId}/netiface`);
    }
Behavior3/5

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

With no annotations, the description carries full burden for transparency. It discloses the core behavior (listing interfaces and IPs) but does not specify error handling, edge cases, or confirm it is read-only, which is minimal but 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?

The description is a single concise sentence with the verb first, containing no extraneous words. Every word earns its place.

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?

For a simple tool with one parameter and no output schema, the description is mostly complete. It names the output components (interfaces and IP addresses) but could hint at the structure. Still, it provides sufficient context for selection.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a clear description for agent_id. The tool description adds no additional meaning beyond what the schema provides, so baseline score of 3 is appropriate.

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 clearly states the verb 'List' and the resource 'network interfaces and their IP addresses' on a Wazuh agent, making it distinct from sibling tools like get_agent_packages or get_agent_ports.

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?

The description implies usage for retrieving network information but provides no explicit guidance on when to use this tool over alternatives or when not to use it, such as prerequisites or limitations.

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/solomonneas/wazuh-mcp'

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