Skip to main content
Glama

Inventory structure and vars

ansible_inventory
Read-onlyIdempotent

Inspect Ansible inventory groups, hosts, and vars with secrets redacted; dynamic sources skipped unless explicitly enabled.

Instructions

Groups, hosts and inventory-level vars (ansible-inventory --graph/--list/--host), always redacted: vault values, secret-like names and secret-shaped values are hidden, templates are shown unrendered. Script and plugin inventory sources run code, so they are skipped unless ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY=1 (which can also call cloud APIs); vault secrets are never supplied, so whole-file vaults degrade to a per-file view.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirNoAnsible project directory. Default: ANSIBLE_MCP_DIR, else the server's working directory.
hostNoShow one host's vars (--host)
varsNonone | names | values (default: names for the list, values for host)
groupNoRoot the graph at this group
limitNoMax hosts listed (default 200)
inventoryNoInventory source relative to dir (default: ansible.cfg's)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description goes well beyond them: always-redacted output, hidden vault/secret-shaped values, unrendered templates, the dynamic-inventory env-var gate (with a cloud-API caveat), and per-file vault degradation. This is unusually rich behavioral disclosure.

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?

Front-loaded with the resource and operations, and every clause carries information (redaction, gating, degradation). It is a dense run-on paragraph, but little is wasted; a slight structure split would improve scanability.

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?

With no output schema, the description carries return-value burden and does explain what is included, what is redacted, and how vaults/dynamic sources degrade. It falls short of describing the concrete output shape or how 'limit' truncation surfaces, but is otherwise complete for a 6-param, no-required-param tool.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description maps parameters to CLI modes (--graph roots via group, --host targets a host, --list drives vars), adding meaning beyond the schema. It reinforces defaults ('names for the list, values for host') already in the schema, but the mode mapping is genuine added value.

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 states a specific resource (inventory: groups, hosts, inventory-level vars) and the exact operations it maps to (--graph/--list/--host). This clearly distinguishes it from siblings like ansible_playbook_structure and ansible_project_info, which cover different artifacts.

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?

Usage context is implied rather than explicit: the note that script/plugin sources are skipped unless ANSIBLE_MCP_ALLOW_DYNAMIC_INVENTORY=1 tells the agent when dynamic inventories apply. However, there is no explicit when-to-use-this vs. an alternative sibling (e.g., project_info) guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.