Skip to main content
Glama

get_ansible_module_info

Retrieve detailed Ansible module schema and documentation by specifying collection and module names, enhancing IaC management with precise module insights.

Instructions

Retrieve comprehensive information about an Ansible module including schema and documentation

Input Schema

NameRequiredDescriptionDefault
collection_nameYesName of the Ansible collection
module_nameYesName of the module

Input Schema (JSON Schema)

{ "description": "Retrieve comprehensive information about an Ansible module including schema and documentation", "properties": { "collection_name": { "description": "Name of the Ansible collection", "type": "string" }, "module_name": { "description": "Name of the module", "type": "string" } }, "required": [ "collection_name", "module_name" ], "type": "object" }

Implementation Reference

  • The primary handler function that implements the core logic for the get_ansible_module_info tool, querying the database and formatting the response.
    async def handle_get_ansible_module_info( db: Any, arguments: Dict[str, Any], operation_id: str ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]: """Handle get_ansible_module_info tool.""" try: logger.info( "Getting Ansible module info", extra={ "collection_name": arguments["collection_name"], "module_name": arguments["module_name"], "operation_id": operation_id, }, ) # Get module info module = get_module_by_name( db, arguments["collection_name"], arguments["module_name"] ) if not module: raise McpError( types.ErrorData( code=types.METHOD_NOT_FOUND, message=f"Module '{arguments['module_name']}' not found in collection '{arguments['collection_name']}'", data={ "tool": "get_ansible_module_info", "collection": arguments["collection_name"], "module": arguments["module_name"], "operation_id": operation_id, }, ) ) # Format output output = [ f"Module: {module['name']}", f"Collection: {module['collection_name']} v{module['collection_version']}", f"Type: {module['type']}", f"Version: {module['version']}", f"Documentation: {module['doc_url']}", "\nSchema:", module["schema"], ] return [TextContent(type="text", text="\n".join(output))] except Exception as e: error_msg = f"Failed to get module info: {str(e)}" logger.error(error_msg, extra={"operation_id": operation_id}) raise McpError( types.ErrorData( code=types.INTERNAL_ERROR, message=error_msg, data={ "tool": "get_ansible_module_info", "operation_id": operation_id, }, ) )
  • JSON schema defining the input parameters and validation rules for the get_ansible_module_info tool.
    "get_ansible_module_info": { "type": "object", "description": "Retrieve comprehensive information about an Ansible module including schema and documentation", "required": ["collection_name", "module_name"], "properties": { "collection_name": { "type": "string", "description": "Name of the Ansible collection", }, "module_name": {"type": "string", "description": "Name of the module"}, }, },
  • Registration dictionary mapping the get_ansible_module_info tool name to its handler function, along with other Ansible tools.
    ansible_tool_handlers = { "get_ansible_collection_info": handle_get_ansible_collection_info, "list_ansible_collections": handle_list_ansible_collections, "get_collection_version_history": handle_get_collection_version_history, "get_ansible_module_info": handle_get_ansible_module_info, "list_collection_modules": handle_list_collection_modules, "get_module_version_compatibility": handle_get_module_version_compatibility, "add_ansible_collection": handle_add_ansible_collection, "add_ansible_module": handle_add_ansible_module, }
  • Top-level aggregation of all tool handlers, including the Ansible handlers which contain get_ansible_module_info.
    tool_handlers = { **terraform_tool_handlers, **ansible_tool_handlers, **entity_tool_handlers, }

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/AgentWong/iac-memory-mcp-server-project'

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