Skip to main content
Glama
AgentWong

IAC Memory MCP Server

by AgentWong

update_provider_version

Update Terraform provider version details and documentation links in the IAC Memory MCP Server cache to maintain accurate infrastructure-as-code information.

Instructions

Update an existing Terraform provider's version information and documentation links

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
provider_nameYesName of the provider
new_versionYesNew version
new_source_urlNoNew source URL
new_doc_urlNoNew documentation URL

Implementation Reference

  • MCP tool handler that validates input arguments, calls the database helper to update provider version, and returns success or error TextContent.
    async def handle_update_provider_version(
        db: Any, arguments: Dict[str, Any], operation_id: str
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        """Handle update_provider_version tool."""
        try:
            logger.info(
                "Updating provider version",
                extra={
                    "provider_name": arguments["provider_name"],
                    "new_version": arguments["new_version"],
                    "operation_id": operation_id,
                },
            )
    
            # Validate version format (x.y.z)
            version_pattern = re.compile(r'^\d+\.\d+\.\d+$')
            if not version_pattern.match(arguments["new_version"]):
                error_msg = "Invalid version format. Version must be in x.y.z format (e.g. 1.0.0)"
                logger.error(error_msg, extra={"operation_id": operation_id})
                return [types.TextContent(type="text", text=error_msg)]
    
            # Update provider version
            success = update_provider_version(
                db,
                arguments["provider_name"],
                arguments["new_version"],
                arguments.get("new_source_url"),
                arguments.get("new_doc_url"),
            )
    
            if success:
                return [types.TextContent(
                    type="text",
                    text=f"Successfully updated provider {arguments['provider_name']} to version {arguments['new_version']}"
                )]
            else:
                error_msg = f"Provider {arguments['provider_name']} not found"
                logger.error(error_msg, extra={"operation_id": operation_id})
                return [types.TextContent(type="text", text=error_msg)]
    
        except Exception as e:
            error_msg = f"Failed to update provider version: {str(e)}"
            logger.error(error_msg, extra={"operation_id": operation_id})
            return [types.TextContent(type="text", text=error_msg)]
  • Local registration dictionary mapping the 'update_provider_version' tool name to its handler function, which is later combined into global tool handlers.
    terraform_tool_handlers = {
        "get_terraform_provider_info": handle_get_terraform_provider_info,
        "list_provider_resources": handle_list_provider_resources,
        "get_terraform_resource_info": handle_get_terraform_resource_info,
        "add_terraform_provider": handle_add_terraform_provider,
        "add_terraform_resource": handle_add_terraform_resource,
        "update_provider_version": handle_update_provider_version,
        "update_resource_schema": handle_update_resource_schema,
    }
  • JSON schema definition for the update_provider_version tool inputs, used for validation and tool listing.
    "update_provider_version": {
        "type": "object",
        "description": "Update an existing Terraform provider's version information and documentation links",
        "required": ["provider_name", "new_version"],
        "properties": {
            "provider_name": {"type": "string", "description": "Name of the provider"},
            "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"},
        },
    },
  • Database helper function that executes the SQL UPDATE on terraform_providers table to update version and optional URLs, returning success boolean.
    def update_provider_version(
        db: DatabaseManager,
        provider_name: str,
        new_version: str,
        new_source_url: Optional[str] = None,
        new_doc_url: Optional[str] = None,
    ) -> bool:
        """Update a Terraform provider's version and optional URLs."""
        logger.info(
            "Updating provider version",
            extra={
                "provider_name": provider_name,
                "new_version": new_version,
                "has_source_url": bool(new_source_url),
                "has_doc_url": bool(new_doc_url),
                "operation": "update_provider_version",
            },
        )
        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(provider_name)
    
            with db.get_connection() as conn:
                cursor = conn.execute(
                    f"""UPDATE terraform_providers
                    SET {', '.join(updates)}
                    WHERE name = ?""",
                    tuple(params),
                )
                return cursor.rowcount > 0
        except sqlite3.Error as e:
            error_msg = f"Failed to update provider version: {str(e)}"
            logger.error(error_msg)
            raise DatabaseError(error_msg)
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 this is an update operation, implying mutation, but doesn't cover critical aspects like permissions required, whether changes are reversible, error handling, or rate limits. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 redundancy. It's front-loaded with the core action and target, making it easy to parse quickly, with no wasted words.

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 this is a mutation tool with no annotations and no output schema, the description is insufficiently complete. It lacks details on behavioral traits (e.g., side effects, error responses), usage context, and output expectations, which are critical for an agent to invoke it correctly in a Terraform provider management system.

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 descriptions for all parameters in the input schema. The description adds no additional parameter semantics beyond what's already documented in the schema, such as format examples or constraints. Baseline 3 is appropriate when the schema handles parameter documentation effectively.

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 target ('existing Terraform provider's version information and documentation links'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'update_collection_version' or 'update_entity', which would require mentioning the specific domain (Terraform providers) to distinguish it.

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 (e.g., the provider must exist), exclusions, or compare it to siblings like 'add_terraform_provider' or 'update_entity', leaving the agent to infer usage from context 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'

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