Skip to main content
Glama

server_audit

Read-onlyIdempotent

Run a security audit on any server with 457 checks across 30 categories. Returns a score (0-100), per-category scores, and quick wins for hardening.

Instructions

Run a security audit on a server. Scans 30 categories with 457 checks. Returns score (0-100), per-category scores, and quick wins. Formats: 'summary' (compact text), 'json' (full AuditResult), 'score' (number only). Supports compliance filtering (cis-level1, cis-level2, pci-dss, hipaa), category/severity filtering, snapshot save/compare, threshold gate, and profile filtering. Requires SSH access. For health trends use server_doctor instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverNoServer name or IP. Auto-selected if only one server exists.
formatNoOutput format: summary (default), json (full result), score (number only)summary
frameworkNoCompliance framework filter. Returns per-control pass/fail summary alongside audit results.
explainNoWhen true, include why + fix explanation for each failing check in summary format output. Capped at 10 checks.
categoryNoFilter results to a specific category (e.g. 'SSH', 'Firewall', 'Docker').
severityNoFilter checks by severity level.
snapshotNoSave audit snapshot. true for auto-name, string for custom name.
compareNoCompare two snapshots: format before:after (e.g. pre-upgrade:latest)
thresholdNoMinimum passing score (1-100). Returns error if score is below threshold.
profileNoServer profile filter (web-server, database, mail-server).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Resource helper function readServerAudit - provides read-only access to the latest cached audit score for a server via MCP resource kastell://servers/{name}/audit. Registered in server.ts as a resource, distinct from the tool that runs audits.
    export function readServerAudit(serverName: string): ReadResourceResult {
      const server = findServer(serverName);
    
      if (!server) {
        return {
          contents: [{
            uri: `kastell://servers/${serverName}/audit`,
            mimeType: "application/json",
            text: JSON.stringify({ error: `Server not found: ${serverName}` }),
          }],
        };
      }
    
      const history = loadAuditHistory(server.ip);
    
      if (history.length === 0) {
        return {
          contents: [{
            uri: `kastell://servers/${serverName}/audit`,
            mimeType: "application/json",
            text: JSON.stringify({
              serverName,
              latestScore: null,
              message: "No audit run yet. Use server_audit to run a security scan.",
            }),
          }],
        };
      }
    
      const latest = history[history.length - 1];
    
      return {
        contents: [{
          uri: `kastell://servers/${serverName}/audit`,
          mimeType: "application/json",
          text: JSON.stringify({
            serverName,
            latestScore: latest.overallScore,
            latestTimestamp: latest.timestamp,
            categoryScores: latest.categoryScores,
            historyCount: history.length,
          }),
        }],
      };
    }
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=true. The description adds behavioral details: scanning categories, returning scores, supporting multiple formats, and requiring SSH access. It does not contradict annotations and extends transparency beyond structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single paragraph that is front-loaded with the main purpose and then lists features concisely. Every sentence adds value, but the structure could be improved with bullet points for readability. Still efficient overall.

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

Completeness5/5

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

Given the complexity (10 parameters, 100% schema coverage, output schema exists), the description covers all major aspects: security audit scope, output formats, filtering options, snapshot/compare, threshold gate, profile filtering, and prerequisite (SSH). It also references a sibling tool for health trends, making it complete for agent decision-making.

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% and each parameter has a clear description in the schema. The description lists many features but does not add significant new meaning to individual parameters beyond what the schema provides. 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 starts with 'Run a security audit on a server' which clearly states the verb and resource. It distinguishes from sibling tool server_doctor by directing users to that tool for health trends, thus providing clear purpose differentiation.

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

Usage Guidelines4/5

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

The description mentions 'Requires SSH access' as a prerequisite and explicitly points to server_doctor for alternative use case ('For health trends use server_doctor instead'). It does not provide explicit exclusions for other scenarios but gives sufficient context for when to use this tool.

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/kastelldev/kastell'

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