Skip to main content
Glama
AgentWong
by AgentWong

update_module_version

Update Ansible module schemas and documentation to maintain accurate IaC component information in memory storage.

Instructions

Update an existing Ansible module's schema and related information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
module_idYesModule ID
new_schemaYesNew schema
new_versionNoNew version
new_doc_urlNoNew documentation URL

Implementation Reference

  • The core database handler function that executes the UPDATE query to modify an Ansible module's schema, version, and documentation URL in the ansible_modules table.
    def update_module_version(
        db: DatabaseManager,
        module_id: str,
        new_schema: str,
        new_version: Optional[str] = None,
        new_doc_url: Optional[str] = None,
    ) -> bool:
        """Update an Ansible module's schema and optional fields."""
        try:
            with db.get_connection() as conn:
                conn.execute("BEGIN IMMEDIATE")  # Start transaction
                try:
                    updates = ["schema = ?"]
                    params = [new_schema]
    
                    if new_version:
                        updates.append("version = ?")
                        params.append(new_version)
                    if new_doc_url:
                        updates.append("doc_url = ?")
                        params.append(new_doc_url)
    
                    updates.append("updated_at = CURRENT_TIMESTAMP")
                    params.append(module_id)
    
                    cursor = conn.execute(
                        f"""UPDATE ansible_modules
                        SET {', '.join(updates)}
                        WHERE id = ?""",
                        tuple(params),
                    )
                    conn.commit()
                    return cursor.rowcount > 0
                except Exception:
                    conn.rollback()
                    raise
        except sqlite3.Error as e:
            raise DatabaseError(f"Failed to update module version: {str(e)}")
  • JSON schema defining the input parameters for the 'update_module_version' MCP tool, used for validation and tool listing.
    "update_module_version": {
        "type": "object",
        "description": "Update an existing Ansible module's schema and related information",
        "required": ["module_id", "new_schema"],
        "properties": {
            "module_id": {"type": "string", "description": "Module ID"},
            "new_schema": {"type": "string", "description": "New schema"},
            "new_version": {"type": "string", "description": "New version"},
            "new_doc_url": {"type": "string", "description": "New documentation URL"},
        },
    },
  • Wrapper method on DatabaseManager class that imports and delegates to the core update_module_version function from ansible.py.
    def update_module_version(
        self,
        module_id: str,
        new_schema: str,
        new_version: str = None,
        new_doc_url: str = None,
    ) -> bool:
        """Update a module's version and schema."""
        from .ansible import update_module_version
    
        return update_module_version(
            self, module_id, new_schema, new_version, new_doc_url
        )
  • Re-exports the update_module_version function from ansible.py, making it available at the db package level for use by tool handlers.
        add_ansible_collection,
        add_ansible_module,
        get_collection_modules,
        get_module_info,
        update_collection_version,
        update_module_version,
    )
    from .connection import DatabaseError, DatabaseManager, UniqueConstraintError
    from .core import execute_query, execute_write, get_db, reset_database
    from .entities import (
        create_entity,
        delete_entity,
        get_entity,
        get_entity_with_observation,
        update_entity,
    )
    from .resources import (
        get_ansible_collections,
        get_ansible_modules,
        get_entities,
        get_entity_relationships,
        get_terraform_providers,
        get_terraform_resources,
    )
    from .terraform import (
        add_terraform_provider,
        add_terraform_resource,
        get_provider_resources,
        get_resource_info,
        update_provider_version,
        update_resource_schema,
    )
    
    __all__ = [
        "DatabaseManager",
        "DatabaseError",
        "UniqueConstraintError",
        "get_db",
        "execute_query",
        "execute_write",
        "reset_database",
        # Entity operations
        "create_entity",
        "update_entity",
        "delete_entity",
        "get_entity",
        "get_entity_relationships",
        "get_entity_with_observation",
        # Resource operations
        "get_terraform_resources",
        "get_terraform_providers",
        "get_ansible_modules",
        "get_ansible_collections",
        "get_entities",
        # Terraform operations
        "add_terraform_provider",
        "get_provider_resources",
        "update_provider_version",
        "add_terraform_resource",
        "get_resource_info",
        "update_resource_schema",
        # Ansible operations
        "add_ansible_collection",
        "get_collection_modules",
        "update_collection_version",
        "add_ansible_module",
        "get_module_info",
        "update_module_version",
    ]
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions updating schema and related information but doesn't specify whether this is a destructive operation, what happens to existing data, or if there are rate limits or authentication requirements. This is inadequate for a mutation tool with zero annotation coverage.

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's front-loaded and earns its place by clearly conveying the core action, making it highly concise and well-structured.

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 updating a module (a mutation operation) with no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like side effects, error handling, or return values, leaving significant gaps for an AI agent to understand the tool's full context.

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%, so the input schema already documents all parameters. The description doesn't add any additional meaning beyond what the schema provides, such as explaining the format of 'new_schema' or how 'new_version' interacts with existing versions. Baseline 3 is appropriate when the schema handles parameter documentation.

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 action ('Update') and resource ('existing Ansible module's schema and related information'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'update_entity' or 'update_collection_version', which could handle similar updates in different contexts.

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 'update_entity' or 'update_collection_version'. The description lacks context about prerequisites, such as whether the module must exist or if specific permissions are needed, leaving usage unclear.

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