Skip to main content
Glama

list_groups

Retrieve a paginated list of all Wazuh agent groups. Use limit and offset parameters to control the number of results.

Instructions

List all Wazuh agent groups

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of groups to return (1-100)
offsetNoPagination offset

Implementation Reference

  • The async handler function that executes the list_groups tool logic. Calls client.getGroups() with limit/offset params, maps the response items to a simplified result object, and returns JSON-formatted text content.
    async ({ limit, offset }) => {
      try {
        const response = await client.getGroups({ limit, offset });
        const data = response.data;
    
        const result = {
          groups: data.affected_items.map((group) => ({
            name: group.name,
            count: group.count,
            config_sum: group.configSum,
            merged_sum: group.mergedSum,
          })),
          total: data.total_affected_items,
          limit,
          offset,
        };
    
        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,
        };
      }
    }
  • The registerGroupTools function registers the 'list_groups' tool (and other group tools) on the MCP server via server.tool().
    export function registerGroupTools(
      server: McpServer,
      client: WazuhClient
    ): void {
      server.tool(
        "list_groups",
        "List all Wazuh agent groups",
        {
          limit: z
            .number()
            .int()
            .min(1)
            .max(100)
            .default(25)
            .describe("Maximum number of groups to return (1-100)"),
          offset: z
            .number()
            .int()
            .min(0)
            .default(0)
            .describe("Pagination offset"),
        },
        async ({ limit, offset }) => {
          try {
            const response = await client.getGroups({ limit, offset });
            const data = response.data;
    
            const result = {
              groups: data.affected_items.map((group) => ({
                name: group.name,
                count: group.count,
                config_sum: group.configSum,
                merged_sum: group.mergedSum,
              })),
              total: data.total_affected_items,
              limit,
              offset,
            };
    
            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 defining the input parameters for list_groups: 'limit' (int 1-100, default 25) and 'offset' (int min 0, default 0) for pagination.
    {
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .default(25)
        .describe("Maximum number of groups to return (1-100)"),
      offset: z
        .number()
        .int()
        .min(0)
        .default(0)
        .describe("Pagination offset"),
    },
  • The client.getGroups() helper method that makes the actual API GET request to the Wazuh '/groups' endpoint with query parameters.
    async getGroups(
      params: Record<string, string | number> = {}
    ): Promise<WazuhApiResponse<WazuhPaginatedData<WazuhGroup>>> {
      return this.get("/groups", params);
    }
  • The WazuhGroup type interface defining the shape of group data returned by the API (name, count, configSum, mergedSum).
    export interface WazuhGroup {
      name: string;
      count?: number;
      configSum?: string;
      mergedSum?: string;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of disclosing behavioral traits. While 'List' implies a read operation, the description does not mention pagination behavior beyond the schema parameters, rate limits, or whether results are ordered. It adds no value beyond the obvious.

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, focused sentence that conveys the essential purpose without any extraneous words. It is properly front-loaded and efficient.

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

Completeness3/5

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

Given the tool's low complexity (2 optional params, no output schema, no annotations), the description is minimally adequate. However, it does not explain return value structure or any default sorting, leaving some gaps that an agent might need to infer.

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?

The input schema has 100% description coverage for both parameters (limit, offset) with defaults and ranges. The description adds no additional information beyond what the schema already provides, so a 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 'Wazuh agent groups', making the tool's action and target unambiguous. It effectively distinguishes from sibling tools like 'list_agents' which lists agents, not groups.

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

Usage Guidelines2/5

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

The description provides no explicit guidance on when to use this tool versus alternatives like 'list_agents' or 'get_group_agents'. There is no mention of prerequisites, context, or exclusions, leaving the agent to infer usage.

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