Skip to main content
Glama

update_collection_version

Update version details and documentation links for existing Ansible collections to maintain accurate Infrastructure-as-Code component tracking.

Instructions

Update an existing Ansible collection's version information and documentation links

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idYesCollection ID
new_versionYesNew version
new_source_urlNoNew source URL
new_doc_urlNoNew documentation URL

Implementation Reference

  • Core implementation of update_collection_version: updates the version and optional URLs of an Ansible collection in the database using SQL UPDATE.
    def update_collection_version( db: DatabaseManager, collection_id: str, new_version: str, new_source_url: Optional[str] = None, new_doc_url: Optional[str] = None, ) -> bool: """Update an Ansible collection's version and optional URLs.""" try: updates = ["version = ?"] params = [new_version] if new_source_url: updates.append("source_url = ?") params.append(new_source_url) if new_doc_url: updates.append("doc_url = ?") params.append(new_doc_url) updates.append("updated_at = CURRENT_TIMESTAMP") params.append(collection_id) with db.get_connection() as conn: # Set busy timeout before any operations conn.execute( "PRAGMA busy_timeout = 5000" ) # 5 second timeout per testing rules conn.execute("BEGIN IMMEDIATE") # Start transaction try: cursor = conn.execute( f"""UPDATE ansible_collections SET {', '.join(updates)} WHERE id = ?""", tuple(params), ) success = cursor.rowcount > 0 conn.commit() return success except Exception: conn.rollback() raise except sqlite3.Error as e: raise DatabaseError( f"Failed to update collection version: {str(e)}. " f"Operation timed out after 5 seconds." )
  • JSON schema defining the input parameters for the MCP tool 'update_collection_version'.
    "update_collection_version": { "type": "object", "description": "Update an existing Ansible collection's version information and documentation links", "required": ["collection_id", "new_version"], "properties": { "collection_id": {"type": "string", "description": "Collection ID"}, "new_version": {"type": "string", "description": "New version"}, "new_source_url": {"type": "string", "description": "New source URL"}, "new_doc_url": {"type": "string", "description": "New documentation URL"}, }, },
  • Wrapper method on DatabaseManager that imports and delegates to the ansible.py implementation.
    def update_collection_version( self, collection_id: str, new_version: str, new_source_url: str = None, new_doc_url: str = None, ) -> bool: """Update a collection's version.""" from .ansible import update_collection_version return update_collection_version( self, collection_id, new_version, new_source_url, new_doc_url )
  • Registers the generic MCP tool call handler and list_tools, which uses TOOL_SCHEMAS including update_collection_version schema.
    def register_tools(server: Server) -> None: """Register all tool handlers with the server.""" @server.call_tool() async def call_tool( name: str, arguments: Dict[str, Any], ctx: RequestContext | None = None ): return await handle_call_tool(name, arguments, ctx) @server.list_tools() async def list_tools(ctx: RequestContext = None): return await handle_list_tools(ctx)
  • Exports update_collection_version function from ansible.py for use across the package.
    add_ansible_collection, add_ansible_module, get_collection_modules, get_module_info, update_collection_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-project'

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