Skip to main content
Glama
washyu
by washyu

suggest_deployments

Read-onlyIdempotent

Analyzes network topology and device capabilities to recommend optimal deployment locations for services in your homelab.

Instructions

Suggest optimal deployment locations based on current network topology and device capabilities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'suggest_deployments'. Creates a NetworkSiteMap, calls sitemap.suggest_deployments(), and returns the suggestions as a JSON-formatted MCP content response.
    async def handle_suggest_deployments(arguments: dict[str, Any]) -> dict[str, Any]:
        """Handle suggest_deployments tool."""
        sitemap = NetworkSiteMap()
        suggestions = sitemap.suggest_deployments()
        result = json.dumps({"status": "success", "suggestions": suggestions}, indent=2)
        return {"content": [{"type": "text", "text": result}]}
  • Schema definition for 'suggest_deployments' tool. Describes it as suggesting optimal deployment locations based on network topology, with no required input parameters.
    "suggest_deployments": {
        "description": "Suggest optimal deployment locations based on current network topology and device capabilities",
        "inputSchema": {"type": "object", "properties": {}, "required": []},
  • Registration of 'suggest_deployments' in the TOOL_HANDLERS registry mapping to handle_suggest_deployments.
    "suggest_deployments": handle_suggest_deployments,
  • Core business logic for suggest_deployments. Iterates online devices and categorizes them into load_balancer_candidates, database_candidates, monitoring_targets, and upgrade_recommendations based on CPU cores, memory, and disk usage.
    def suggest_deployments(self) -> dict[str, Any]:
        """Suggest optimal deployment locations based on current network state."""
        devices = self.get_all_devices()
        online_devices = [d for d in devices if d["status"] == "success"]
    
        suggestions: dict[str, list[dict[str, str]]] = {
            "load_balancer_candidates": [],
            "database_candidates": [],
            "monitoring_targets": [],
            "upgrade_recommendations": [],
        }
    
        for device in online_devices:
            hostname = device["hostname"]
    
            # Load balancer candidates (high CPU, good memory)
            # Phase 35 D-10/D-13: skip devices with null cpu_cores or memory_total
            # rather than coercing to 0/"" (which produces false negatives here and
            # false positives in the upgrade_recommendations path below).
            if not _has_threshold_data(device, "cpu_cores", "memory_total"):
                logger.debug(
                    "Skipping device %s in deployment suggestion: missing cpu_cores or memory_total",
                    hostname,
                )
            else:
                cpu_cores = device["cpu_cores"]
                if cpu_cores >= 4:
                    memory_gb = self._parse_memory_gb(str(device["memory_total"]))
                    if memory_gb >= 4:
                        suggestions["load_balancer_candidates"].append(
                            {
                                "hostname": hostname,
                                "reason": f"{cpu_cores} cores, {device['memory_total']} RAM",
                            }
                        )
    
            # Database candidates (good disk space, memory)
            if device.get("disk_use_percent"):
                try:
                    disk_usage = int(device["disk_use_percent"].rstrip("%"))
                    if disk_usage < 50:  # Plenty of disk space
                        memory_total = device.get("memory_total")
                        memory_gb = self._parse_memory_gb(str(memory_total) if memory_total else "")
    
                        if memory_gb >= 8:
                            suggestions["database_candidates"].append(
                                {
                                    "hostname": hostname,
                                    "reason": f"Low disk usage ({device['disk_use_percent']}), {device['memory_total']} RAM",
                                }
                            )
                except (ValueError, AttributeError):
                    logger.debug("Skipping device %s for deployment suggestion: unable to parse disk usage", hostname)
    
            # Monitoring targets (all online devices should be monitored)
            suggestions["monitoring_targets"].append(
                {
                    "hostname": hostname,
                    "connection_ip": device["connection_ip"],
                    "os": device.get("os_info", "Unknown"),
                }
            )
    
            # Upgrade recommendations
            # Phase 35 D-10/D-13: skip devices with null cpu_cores or memory_total;
            # prior behavior coerced None -> 0 and flagged every null-cpu device as a
            # low-resource upgrade candidate (false positive).
            if not _has_threshold_data(device, "cpu_cores", "memory_total"):
                logger.debug(
                    "Skipping device %s in upgrade recommendation: missing cpu_cores or memory_total",
                    hostname,
                )
            else:
                cpu_cores = device["cpu_cores"]
                if cpu_cores <= 2:
                    memory_gb = self._parse_memory_gb(str(device["memory_total"]))
                    if memory_gb <= 4:
                        suggestions["upgrade_recommendations"].append(
                            {
                                "hostname": hostname,
                                "reason": f"Limited resources: {cpu_cores} cores, {device['memory_total']} RAM",
                            }
                        )
    
        return suggestions
  • Listed as a standalone tool (works without external infrastructure) in the OpenAPI REST app.
    "suggest_deployments",
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, so the tool is clearly a safe, non-mutating suggestion. The description adds little beyond the annotations, merely specifying the input context. With strong annotations, a 3 is appropriate.

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, well-structured sentence of 14 words. It is concise, front-loaded with the verb and resource, and every word adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description adequately states the tool's purpose and basis, but given zero parameters and no output schema, it leaves ambiguity about what 'suggest' entails (e.g., return format, how optimal is determined). The large sibling set suggests a need for clearer differentiation, which is missing. A score of 3 reflects acceptable but incomplete guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, and schema description coverage is 100%, so the description does not need to explain parameters. No additional parameter info is required, earning a baseline score of 4.

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 uses the specific verb 'suggest' on the resource 'deployment locations' and mentions the basis ('current network topology and device capabilities'), making the purpose clear. However, it lacks specificity about what 'optimal' means and what the output format is, preventing a score of 5.

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 'analyze_network_topology' or 'deploy_infrastructure'. No explicit context, exclusions, or when-not conditions are given.

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