Skip to main content
Glama
AgentWong

IAC Memory MCP Server

by AgentWong

get_ansible_module_info

Retrieve comprehensive schema and documentation for Ansible modules to understand their usage and parameters.

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

  • The primary handler function that implements the core logic for the 'get_ansible_module_info' tool. It fetches module data from the database using get_module_by_name, handles errors if not found, formats the output including schema, and returns it as TextContent.
    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, specifying required fields collection_name and module_name as strings.
    "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"},
        },
    },
  • Dictionary mapping tool names to their handler functions for Ansible tools, registering '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,
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves information, implying a read-only operation, but doesn't cover aspects like rate limits, authentication needs, error handling, or what 'comprehensive information' entails in terms of format or depth. This is a significant gap for a tool with no annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and every part earns its place, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of retrieving module information, the lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'comprehensive information' includes, how results are structured, or any behavioral traits like pagination or errors. This leaves gaps for effective tool use by an agent.

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

Parameters3/5

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

The input schema has 100% description coverage, with clear documentation for both parameters ('collection_name' and 'module_name'). The description adds no additional parameter semantics beyond what's in the schema, such as examples or constraints. Given the high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'retrieve' and the resource 'comprehensive information about an Ansible module including schema and documentation', which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'get_ansible_collection_info' or 'get_module_version_compatibility', which reduces it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or exclusions, such as whether it's for lookup versus other info-retrieval tools like 'get_ansible_collection_info'. This leaves the agent without clear usage direction.

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

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