Skip to main content
Glama
AgentWong
by AgentWong

get_ansible_module_info

Retrieve Ansible module documentation and schema details to understand module functionality and parameters for Infrastructure-as-Code automation.

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 handler function that implements the core logic for the get_ansible_module_info tool. Fetches module data from the database and returns formatted text output 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 defining the input parameters for the get_ansible_module_info tool (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 handler 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,
    }
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. It mentions retrieving 'comprehensive information' but doesn't disclose behavioral traits such as whether this is a read-only operation, potential rate limits, authentication needs, or error handling. The description is vague and lacks operational context.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, though it could be slightly more structured by separating key aspects like schema vs. documentation retrieval.

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 no annotations, no output schema, and a read-focused tool with 2 parameters, the description is incomplete. It lacks details on return values, error cases, or how the retrieved information is formatted, leaving gaps for the agent to understand the tool's full behavior and output.

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?

Schema description coverage is 100%, with clear parameter descriptions in the schema. The description adds no additional meaning beyond the schema's 'Retrieve comprehensive information about an Ansible module including schema and documentation', which mirrors the input schema description. Baseline 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 resource 'comprehensive information about an Ansible module including schema and documentation', making the purpose evident. It distinguishes from siblings like 'get_ansible_collection_info' by specifying modules rather than collections, though it doesn't explicitly contrast with 'get_module_version_compatibility' or 'update_module_version'.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_module_version_compatibility' or 'update_module_version'. The description implies usage for retrieving module details but lacks explicit context, prerequisites, or exclusions, leaving the agent to infer based on tool names alone.

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-project'

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