Skip to main content
Glama
washyu
by washyu

refresh_terraform_service

Idempotent

Refresh Terraform state for a specified service to detect configuration drift using SSH connection.

Instructions

Refresh Terraform state and detect configuration drift

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_nameYesName of the service to refresh
hostnameYesHostname or IP address of the device
usernameNoSSH username (use 'mcp_admin' for passwordless access after setup)mcp_admin
passwordNoSSH password (not needed for mcp_admin after setup)

Implementation Reference

  • Handler function for refresh_terraform_service. Creates a ServiceInstaller and calls installer.refresh_terraform_service(**arguments), returning the JSON-serialized result.
    async def handle_refresh_terraform_service(arguments: dict[str, Any]) -> dict[str, Any]:
        """Handle refresh_terraform_service tool."""
        installer = ServiceInstaller()
        refresh_result = await installer.refresh_terraform_service(**arguments)
        return {"content": [{"type": "text", "text": json.dumps(refresh_result, indent=2)}]}
  • Input schema for refresh_terraform_service tool. Defines description, properties (service_name, hostname, username, password) with required fields service_name and hostname.
    "refresh_terraform_service": {
        "description": "Refresh Terraform state and detect configuration drift",
        "inputSchema": {
            "type": "object",
            "properties": {
                "service_name": {
                    "type": "string",
                    "description": "Name of the service to refresh",
                },
                "hostname": {
                    "type": "string",
                    "description": "Hostname or IP address of the device",
                },
                "username": {
                    "type": "string",
                    "description": "SSH username (use 'mcp_admin' for passwordless access after setup)",
                    "default": "mcp_admin",
                },
                "password": {
                    "type": "string",
                    "description": "SSH password (not needed for mcp_admin after setup)",
                },
            },
            "required": ["service_name", "hostname"],
        },
    },
  • Registration mapping tool name 'refresh_terraform_service' to handler handle_refresh_terraform_service in the tool handler registry.
    "refresh_terraform_service": handle_refresh_terraform_service,
  • Tool listed in _SERVICE_TOOLS_WITH_HOST tuple for OpenAPI app registration.
    "refresh_terraform_service",
  • Tool annotation for refresh_terraform_service marking it as idempotent (idempotentHint=True), not read-only, and not destructive.
    "refresh_terraform_service": ToolAnnotations(
        readOnlyHint=False,
        destructiveHint=False,
        idempotentHint=True,
    ),
Behavior3/5

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

Annotations already indicate idempotentHint=true and readOnlyHint=false. The description adds context about drift detection but doesn't disclose details like whether state is overwritten, if it affects running services, or what happens on drift found. Adequate with annotations.

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?

Single sentence, no fluff. Front-loaded with the action. Every word earns its place.

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?

Despite moderate complexity (4 params, no output schema), the description lacks behavioral details, preconditions, error handling, or what happens after refresh. Insufficient for an agent to fully understand tool consequences.

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 documentation covers all parameters at 100%. The description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly uses specific verb 'refresh' and resource 'Terraform state', and adds 'detect configuration drift' which distinguishes it from siblings like 'plan_terraform_service' or 'destroy_terraform_service'.

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 on when to use this tool versus alternatives. It doesn't mention prerequisites, when to avoid, or how it relates to similar tools like 'plan_terraform_service' or 'scan_infrastructure_drift'.

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/washyu/homelab_mcp'

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