Skip to main content
Glama

get_baseline_rules

Retrieve the complete rule set of a baseline to identify compliance gaps and hardening requirements.

Instructions

[READ] Return all rules of a given baseline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseline_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core implementation of get_baseline_rules. Loads a baseline by ID via load_builtin() and returns a list of {id, title, severity, category} dicts for each rule.
    @vmware_tool(risk_level="low")
    def get_baseline_rules(baseline_id: str) -> list[dict]:
        """[READ] Return all rules of a given baseline."""
        from vmware_harden.baselines.loader import load_builtin
    
        b = load_builtin(baseline_id)
        return [
            {
                "id": r.id,
                "title": r.title,
                "severity": r.severity,
                "category": r.category,
            }
            for r in b.rules
        ]
  • Registers the tool named 'get_baseline_rules' on the FastMCP server, delegating to the handler in vmware_harden.mcp.tools.
    @server.tool(name="get_baseline_rules")
    def _get_baseline_rules_impl(baseline_id: str) -> list[dict]:
        """[READ] Return all rules of a given baseline."""
        return t.get_baseline_rules(baseline_id)
  • Helper function load_builtin() called by the handler. Resolves the baseline name to a .yaml file (user dir first, then built-in) and loads/parses it into a Baseline model.
    def load_builtin(name: str) -> Baseline:
        """Load a baseline by name (without `.yaml` suffix).
    
        Searches user dir (~/.vmware-harden/baselines) first, then the
        package's built-in directory.
        """
        return load_baseline(_resolve_baseline_path(name))
  • The Rule and Baseline Pydantic models that define the structure of the data returned by get_baseline_rules. Rule.id, .title, .severity, .category are used in the handler's output.
    class Rule(BaseModel):
        """A single compliance rule within a baseline."""
    
        model_config = ConfigDict(extra="forbid")
    
        id: str
        title: str
        severity: Severity
        category: str
        rationale: str | None = None
        check: Check = Field(discriminator="type")
        remediation: Remediation
        review_policy: ReviewPolicy = Field(default_factory=ReviewPolicy)
    
    
    class Baseline(BaseModel):
        """A complete baseline of compliance rules."""
    
        model_config = ConfigDict(extra="forbid")
    
        id: str
        name: str
        version: str
        source: str | None = None
        extends: str | None = None
        applies_to: list[NodeType]
        rules: list[Rule]
Behavior2/5

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

With no annotations, the description must carry the full burden. It only indicates a read operation via '[READ]' but fails to disclose other behavioral traits (e.g., pagination, permissions, side effects). This is minimal transparency.

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 with the '[READ]' prefix front-loaded. Every word is necessary and there is no superfluous information, making it highly efficient.

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

Completeness4/5

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

For a simple tool with one parameter and an output schema, the description adequately conveys the core purpose. It could mention that the baseline_id is required, but the schema already specifies that. Overall, it is sufficiently complete given the context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description adds no semantics for the baseline_id parameter beyond its name. It does not explain what constitutes a valid baseline ID or how to obtain it, leaving the agent with no additional context.

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 it is a read operation that returns all rules for a given baseline, using a specific verb and resource. It distinguishes from sibling tools like list_baselines and list_violations by explicitly mentioning 'rules' and 'baseline'.

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. It does not mention any exclusions, prerequisites, or context that would help an agent decide between this and other tools like get_remediation or list_drift_events.

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/zw008/VMware-Harden'

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