Skip to main content
Glama
AgentWong
by AgentWong

update_provider_version

Update Terraform provider version details and documentation links to maintain accurate infrastructure-as-code component tracking.

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 function that performs input validation, invokes the database helper, handles errors, and returns formatted success or error messages.
    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)]
  • JSON schema defining the input parameters, requirements, and descriptions for the update_provider_version tool.
    "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"},
        },
    },
  • Dictionary mapping tool names to their handler functions, registering update_provider_version with its handler.
    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,
    }
  • Core database helper function that executes the SQL UPDATE statement to modify the provider's version and optional fields in the terraform_providers table.
    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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is an update operation, implying mutation, but doesn't mention permission requirements, whether changes are reversible, potential side effects, or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 with the core action and resource, making it easy to parse quickly. Every word earns its place in conveying essential information.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like authentication needs, error handling, or what the tool returns. Given the complexity of updating provider versions and the lack of structured metadata, the description should provide more context to guide safe and effective use.

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 fully documents all four parameters. The description adds no additional parameter semantics beyond what's already in the schema (e.g., format expectations, constraints, or examples). The baseline score of 3 reflects adequate but minimal value added by the description over the structured schema.

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 Terraform provider's version information and documentation links'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'update_entity' or 'update_collection_version', which could handle similar update operations on different resource types.

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 like 'update_entity' or 'add_terraform_provider'. It doesn't mention prerequisites (e.g., the provider must already exist), exclusions, or contextual constraints, leaving the agent to infer usage from the tool name 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