Skip to main content
Glama

get_agent_os

Retrieve operating system information collected from a Wazuh agent using its agent ID.

Instructions

Get operating system information collected from a Wazuh agent

Input Schema

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

Implementation Reference

  • The handler function that executes the 'get_agent_os' tool logic. It receives the agent_id, calls client.getAgentOs(agent_id), extracts affected_items, and returns formatted JSON response with error handling.
    async ({ agent_id }) => {
      try {
        const response = await client.getAgentOs(agent_id);
        const items = response.data.affected_items;
    
        const result = {
          agent_id,
          os: items[0] ?? null,
        };
    
        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,
        };
      }
    }
  • Input schema for the 'get_agent_os' tool. It defines a single required parameter 'agent_id' as a string with description 'Agent identifier (e.g., '001')'.
    {
      agent_id: z
        .string()
        .describe("Agent identifier (e.g., '001')"),
    },
  • The tool is registered via server.tool('get_agent_os', ...) inside the registerSyscollectorTools function. The registration includes the tool name, description, input schema (agent_id), and the handler callback.
    server.tool(
      "get_agent_os",
      "Get operating system information collected from a Wazuh agent",
      {
        agent_id: z
          .string()
          .describe("Agent identifier (e.g., '001')"),
      },
      async ({ agent_id }) => {
        try {
          const response = await client.getAgentOs(agent_id);
          const items = response.data.affected_items;
    
          const result = {
            agent_id,
            os: items[0] ?? null,
          };
    
          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:45-45 (registration)
    The registerSyscollectorTools function is invoked from the main index.ts file, wiring up the syscollector tools (including get_agent_os) to the MCP server.
    registerSyscollectorTools(server, client);
  • The WazuhClient.getAgentOs method is the helper that makes the actual API call to the Wazuh /syscollector/{agent_id}/os endpoint and returns parsed response data.
    async getAgentOs(
      agentId: string
    ): Promise<WazuhApiResponse<WazuhPaginatedData<WazuhOsInfo>>> {
      return this.get(`/syscollector/${agentId}/os`);
    }
Behavior2/5

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

No annotations are present, and the description does not disclose behavioral traits such as read-only nature, required permissions, or side effects. The description carries the full burden for transparency but adds minimal context.

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 sentence that is concise and to the point, with no unnecessary words.

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?

For a simple one-parameter tool with no output schema, the description is adequate but lacks details on return value, possible errors, or additional context about the OS information.

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 description coverage is 100% for the single 'agent_id' parameter. The tool description does not add additional meaning beyond the schema's description, so the 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 'Get', the resource 'operating system information', and the context 'collected from a Wazuh agent'. It distinguishes from sibling tools like get_agent_network and get_agent_packages.

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?

No guidance is provided on when to use this tool versus alternatives, nor any prerequisites or conditions for use.

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