Skip to main content
Glama

get_manager_logs

Retrieve Wazuh manager logs with filters for severity level or module tag to troubleshoot issues.

Instructions

Retrieve Wazuh manager logs with optional filtering by severity level or module tag

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of log entries to return (1-100)
offsetNoPagination offset
levelNoFilter by log severity level
tagNoFilter by module/tag name (e.g., 'wazuh-modulesd', 'ossec-analysisd')

Implementation Reference

  • The handler function that executes the get_manager_logs tool logic. It accepts limit, offset, level, and tag parameters, calls client.getManagerLogs(), then maps and returns the results as JSON.
    async ({ limit, offset, level, tag }) => {
      try {
        const params: Record<string, string | number> = { limit, offset };
        if (level) params.level = level;
        if (tag) params.tag = tag;
    
        const response = await client.getManagerLogs(params);
        const data = response.data;
    
        const result = {
          logs: data.affected_items.map((entry) => ({
            timestamp: entry.timestamp,
            tag: entry.tag,
            level: entry.level,
            description: entry.description,
          })),
          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 input schema for get_manager_logs: limit (1-100, default 25), offset (min 0, default 0), level (enum: info/warning/error/critical/debug, optional), tag (string, optional).
    {
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .default(25)
        .describe("Maximum number of log entries to return (1-100)"),
      offset: z
        .number()
        .int()
        .min(0)
        .default(0)
        .describe("Pagination offset"),
      level: z
        .enum(["info", "warning", "error", "critical", "debug"])
        .optional()
        .describe("Filter by log severity level"),
      tag: z
        .string()
        .optional()
        .describe("Filter by module/tag name (e.g., 'wazuh-modulesd', 'ossec-analysisd')"),
    },
  • Tool registration on the McpServer via server.tool('get_manager_logs', ...) inside registerManagerTools().
    server.tool(
      "get_manager_logs",
      "Retrieve Wazuh manager logs with optional filtering by severity level or module tag",
      {
        limit: z
          .number()
          .int()
          .min(1)
          .max(100)
          .default(25)
          .describe("Maximum number of log entries to return (1-100)"),
        offset: z
          .number()
          .int()
          .min(0)
          .default(0)
          .describe("Pagination offset"),
        level: z
          .enum(["info", "warning", "error", "critical", "debug"])
          .optional()
          .describe("Filter by log severity level"),
        tag: z
          .string()
          .optional()
          .describe("Filter by module/tag name (e.g., 'wazuh-modulesd', 'ossec-analysisd')"),
      },
      async ({ limit, offset, level, tag }) => {
        try {
          const params: Record<string, string | number> = { limit, offset };
          if (level) params.level = level;
          if (tag) params.tag = tag;
    
          const response = await client.getManagerLogs(params);
          const data = response.data;
    
          const result = {
            logs: data.affected_items.map((entry) => ({
              timestamp: entry.timestamp,
              tag: entry.tag,
              level: entry.level,
              description: entry.description,
            })),
            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,
          };
        }
      }
    );
  • src/index.ts:48-48 (registration)
    Registration call site: registerManagerTools(server, client) invoked in the main function.
    registerManagerTools(server, client);
  • Client helper method getManagerLogs() that performs the HTTP GET request to /manager/logs with the provided params.
    async getManagerLogs(
      params: Record<string, string | number> = {}
    ): Promise<WazuhApiResponse<WazuhPaginatedData<WazuhManagerLog>>> {
      return this.get("/manager/logs", params);
    }
Behavior3/5

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

Without annotations, the description indicates basic behavior: retrieval with filtering. However, it omits details like default ordering, pagination behavior, or any side effects.

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?

A single, front-loaded sentence of 14 words. Every word is essential, with no redundancy.

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?

The description covers the core purpose and main filters but lacks details about output format, default behavior, or ordering. Given the simple parameters, it is minimally adequate.

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%, so baseline is 3. The description reiterates the filtering capability but adds no additional meaning beyond what the schema already provides.

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 action 'Retrieve' and the resource 'Wazuh manager logs', with optional filtering. It distinguishes from sibling tools which are for agents, alerts, or rules.

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 use for manager logs but provides no explicit guidance on when to use this tool vs alternatives (e.g., search_alerts), nor any exclusions or prerequisites.

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