Skip to main content
Glama
vsl8
by vsl8

inventory-add-host

Add a host to an Ansible inventory file under a specified group, with option to create the group if missing.

Instructions

Add a host to an inventory file under a specified group.

Args: host_entry: Host definition (e.g., 'dev-test-az1 ansible_host=10.1.1.5') group_name: Target group name (e.g., 'webservers') inventory_file: Path to the inventory file to modify (INI or YAML format) create_group: If True, create the group if it doesn't exist. If False/None and group missing, return error. project_root: Project root folder ansible_cfg_path: Explicit ansible.cfg path inventory_paths: Inventory paths for validation

Returns: Dict with ok, message, and details about the operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_nameYes
host_entryYes
create_groupNo
project_rootNo
inventory_fileYes
inventory_pathsNo
ansible_cfg_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations, the description partially discloses behavior: it mentions that if create_group is False/None and group missing, it returns an error, and that inventory_paths are used for validation. However, it does not disclose whether existing hosts are overwritten or validate host_entry format beyond an example.

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 well-structured with Args and Returns sections, but it is slightly verbose. It front-loads the main purpose and uses examples efficiently. No wasted sentences, but could be trimmed slightly.

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 tool with 7 parameters and an output schema, the description covers all required params with examples, explains optional parameters, and mentions return structure. It is reasonably complete, though it could elaborate on validation details.

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 description coverage is 0%, but the description explains each parameter with examples (e.g., 'dev-test-az1 ansible_host=10.1.1.5' for host_entry). It clarifies the behavior of create_group. However, it could provide more detail on inventory_paths validation and the exact format of host_entry.

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 'Add a host to an inventory file under a specified group,' providing a specific verb and resource. This distinguishes it from sibling tools like inventory-find-host (find host) and inventory-parse (parse inventory).

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 implies usage for adding hosts but does not explicitly state when to use this tool versus alternatives like inventory-find-host or inventory-parse. It also lacks guidance on prerequisites (e.g., inventory file must exist if create_group is False).

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/vsl8/ansible-mcp-server'

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