Skip to main content
Glama

get_sca_checks

Retrieve individual SCA compliance check results for a Wazuh agent's policy, with optional filters for result type, limit, and pagination offset.

Instructions

Get individual check results for a specific SCA policy on a Wazuh agent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesAgent identifier (e.g., '001')
policy_idYesSCA policy identifier (e.g., 'cis_debian10')
resultNoFilter by check result: passed, failed, or not applicable
limitNoMaximum number of checks to return (1-500)
offsetNoPagination offset

Implementation Reference

  • The 'get_sca_checks' tool handler. Registers the tool with McpServer, defines Zod input schema (agent_id, policy_id, result, limit, offset), calls client.getScaChecks(), and maps the response to a readable JSON output.
    server.tool(
      "get_sca_checks",
      "Get individual check results for a specific SCA policy on a Wazuh agent",
      {
        agent_id: z
          .string()
          .describe("Agent identifier (e.g., '001')"),
        policy_id: z
          .string()
          .describe("SCA policy identifier (e.g., 'cis_debian10')"),
        result: z
          .enum(["passed", "failed", "not applicable"])
          .optional()
          .describe("Filter by check result: passed, failed, or not applicable"),
        limit: z
          .number()
          .int()
          .min(1)
          .max(500)
          .default(25)
          .describe("Maximum number of checks to return (1-500)"),
        offset: z
          .number()
          .int()
          .min(0)
          .default(0)
          .describe("Pagination offset"),
      },
      async ({ agent_id, policy_id, result, limit, offset }) => {
        try {
          const params: Record<string, string | number> = { limit, offset };
          if (result) params.result = result;
    
          const response = await client.getScaChecks(agent_id, policy_id, params);
          const data = response.data;
    
          const mapped = {
            agent_id,
            policy_id,
            checks: data.affected_items.map((check) => ({
              id: check.id,
              title: check.title,
              description: check.description,
              rationale: check.rationale,
              remediation: check.remediation,
              result: check.result,
              condition: check.condition,
              command: check.command,
              references: check.references,
              compliance: check.compliance,
              reason: check.reason,
            })),
            total: data.total_affected_items,
            limit,
            offset,
          };
    
          return {
            content: [{ type: "text" as const, text: JSON.stringify(mapped, 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_sca_checks tool: agent_id (string), policy_id (string), optional result enum (passed/failed/not applicable), limit (1-500, default 25), offset (min 0, default 0).
      agent_id: z
        .string()
        .describe("Agent identifier (e.g., '001')"),
      policy_id: z
        .string()
        .describe("SCA policy identifier (e.g., 'cis_debian10')"),
      result: z
        .enum(["passed", "failed", "not applicable"])
        .optional()
        .describe("Filter by check result: passed, failed, or not applicable"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(500)
        .default(25)
        .describe("Maximum number of checks to return (1-500)"),
      offset: z
        .number()
        .int()
        .min(0)
        .default(0)
        .describe("Pagination offset"),
    },
  • src/tools/sca.ts:5-133 (registration)
    The registerScaTools function registers both 'get_sca_policies' and 'get_sca_checks' tools on the McpServer. Called from src/index.ts line 44.
    export function registerScaTools(
      server: McpServer,
      client: WazuhClient
    ): void {
      server.tool(
        "get_sca_policies",
        "List Security Configuration Assessment (SCA) policies evaluated on a Wazuh agent",
        {
          agent_id: z
            .string()
            .describe("Agent identifier (e.g., '001')"),
        },
        async ({ agent_id }) => {
          try {
            const response = await client.getScaPolicies(agent_id);
            const data = response.data;
    
            const result = {
              agent_id,
              policies: data.affected_items.map((policy) => ({
                policy_id: policy.policy_id,
                name: policy.name,
                description: policy.description,
                score: policy.score,
                pass: policy.pass,
                fail: policy.fail,
                invalid: policy.invalid,
                total_checks: policy.total_checks,
                hash_file: policy.hash_file,
                end_scan: policy.end_scan,
              })),
              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,
            };
          }
        }
      );
    
      server.tool(
        "get_sca_checks",
        "Get individual check results for a specific SCA policy on a Wazuh agent",
        {
          agent_id: z
            .string()
            .describe("Agent identifier (e.g., '001')"),
          policy_id: z
            .string()
            .describe("SCA policy identifier (e.g., 'cis_debian10')"),
          result: z
            .enum(["passed", "failed", "not applicable"])
            .optional()
            .describe("Filter by check result: passed, failed, or not applicable"),
          limit: z
            .number()
            .int()
            .min(1)
            .max(500)
            .default(25)
            .describe("Maximum number of checks to return (1-500)"),
          offset: z
            .number()
            .int()
            .min(0)
            .default(0)
            .describe("Pagination offset"),
        },
        async ({ agent_id, policy_id, result, limit, offset }) => {
          try {
            const params: Record<string, string | number> = { limit, offset };
            if (result) params.result = result;
    
            const response = await client.getScaChecks(agent_id, policy_id, params);
            const data = response.data;
    
            const mapped = {
              agent_id,
              policy_id,
              checks: data.affected_items.map((check) => ({
                id: check.id,
                title: check.title,
                description: check.description,
                rationale: check.rationale,
                remediation: check.remediation,
                result: check.result,
                condition: check.condition,
                command: check.command,
                references: check.references,
                compliance: check.compliance,
                reason: check.reason,
              })),
              total: data.total_affected_items,
              limit,
              offset,
            };
    
            return {
              content: [{ type: "text" as const, text: JSON.stringify(mapped, null, 2) }],
            };
          } catch (error) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: JSON.stringify({
                    error: error instanceof Error ? error.message : String(error),
                  }),
                },
              ],
              isError: true,
            };
          }
        }
      );
    }
  • Client-side method getScaChecks() that makes the actual HTTP GET request to /sca/{agentId}/checks/{policyId} with query params. Called by the tool handler to fetch SCA check data from the Wazuh API.
    async getScaChecks(
      agentId: string,
      policyId: string,
      params: Record<string, string | number> = {}
    ): Promise<WazuhApiResponse<WazuhPaginatedData<WazuhScaCheck>>> {
      return this.get(`/sca/${agentId}/checks/${policyId}`, params);
    }
  • TypeScript interface WazuhScaCheck defining the shape of an SCA check result returned by the Wazuh API.
    export interface WazuhScaCheck {
      id: number;
      title: string;
      description?: string;
      rationale?: string;
      remediation?: string;
      result: string;
      condition?: string;
      command?: string[];
      references?: string;
      compliance?: Record<string, string[]>;
      rules?: string[];
      file?: string[];
      process?: string[];
      registry?: string[];
      reason?: string;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states the basic purpose and does not disclose pagination behavior, authentication needs, side effects, or return structure.

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 that is front-loaded with key information. 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?

With no output schema and moderate complexity (5 parameters including pagination), the description is adequate but does not inform about return format or pagination specifics. Schema covers limit/offset, but overall context could be richer.

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% (all parameters documented). The description adds no additional parameter meaning beyond the schema, meeting the baseline of 3.

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), resource (individual check results), and context (specific SCA policy on a Wazuh agent). It distinguishes from sibling tools like get_sca_policies by specifying 'check results' vs policies.

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 does not explicitly state when to use this tool vs alternatives, but the context of sibling tools (e.g., get_sca_policies) provides implied usage. No when-not or alternative guidance is given.

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