Skip to main content
Glama
AgentWong

IAC Memory MCP Server

by AgentWong

get_ansible_module_info

Retrieve detailed Ansible module information, including schema and documentation, to simplify IaC management and enhance automation workflows on the IAC Memory MCP Server.

Instructions

Retrieve comprehensive information about an Ansible module including schema and documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_nameYesName of the Ansible collection
module_nameYesName of the module

Implementation Reference

  • Main execution handler for the get_ansible_module_info tool. Retrieves Ansible module details from the database using get_module_by_name and returns formatted text content including schema.
    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 definition for the get_ansible_module_info tool inputs, specifying required parameters collection_name and module_name.
    "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 of the tool handler in the ansible_tool_handlers dictionary, mapping 'get_ansible_module_info' to its handle_get_ansible_module_info function.
    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, "update_collection_version": handle_update_collection_version, "update_module_version": handle_update_module_version, }

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'

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