ansible_inventory
List Ansible inventory hosts and groups from a specified inventory file or host list. Optionally includes host variable keys.
Instructions
List Ansible inventory hosts and groups using the ansible-inventory CLI.
Args: inventory: Optional inventory path or host list (e.g., 'hosts.ini' or 'localhost,'). include_hostvars: If true, include hostvars keys in the response (not the full values). cwd: Optional working directory to run the command in. Returns: Dict with keys: ok, rc, hosts, groups, hostvars_keys (optional), command, stderr
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "ansible_inventory"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| env | No | ||
| inventory | No | ||
| include_hostvars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||