Skip to main content
Glama
washyu
by washyu

bulk_discover_and_map

Discover multiple devices via SSH and store them in the network site map database for homelab infrastructure management.

Instructions

Discover multiple devices via SSH and store them in the network site map database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetsYesArray of target device configurations

Implementation Reference

  • The handler function `handle_bulk_discover_and_map` that executes the tool logic. It creates a NetworkSiteMap instance and calls bulk_discover_and_store with the targets array from arguments, returning the result in MCP format.
    async def handle_bulk_discover_and_map(arguments: dict[str, Any]) -> dict[str, Any]:
        """Handle bulk_discover_and_map tool."""
        sitemap = NetworkSiteMap()
        result = await bulk_discover_and_store(sitemap, arguments["targets"])
        return {"content": [{"type": "text", "text": result}]}
  • Tool registration mapping 'bulk_discover_and_map' tool name to its handler function in the TOOL_HANDLERS dictionary.
    "bulk_discover_and_map": handle_bulk_discover_and_map,
  • Schema definition for bulk_discover_and_map tool, specifying the input requires a 'targets' array containing device configuration objects with hostname, username, and optional password, key_path, and port fields.
    "bulk_discover_and_map": {
        "description": "Discover multiple devices via SSH and store them in the network site map database",
        "inputSchema": {
            "type": "object",
            "properties": {
                "targets": {
                    "type": "array",
                    "description": "Array of target device configurations",
                    "items": {
                        "type": "object",
                        "properties": {
                            "hostname": {"type": "string"},
                            "username": {"type": "string"},
                            "password": {"type": "string"},
                            "key_path": {"type": "string"},
                            "port": {"type": "integer", "default": 22},
                        },
                        "required": ["hostname", "username"],
                    },
                }
            },
            "required": ["targets"],
        },
    },
  • The `bulk_discover_and_store` helper function that implements the core logic - iterates through multiple target devices, calls discover_and_store for each, collects results, and returns a consolidated JSON response with all discovery results.
    async def bulk_discover_and_store(sitemap: NetworkSiteMap, targets: list[dict[str, Any]]) -> str:
        """Discover multiple devices and store them in the site map."""
        results = []
    
        for target in targets:
            try:
                result = await discover_and_store(
                    sitemap,
                    target["hostname"],
                    target["username"],
                    target.get("password"),
                    target.get("key_path"),
                    target.get("port", 22),
                )
                results.append(json.loads(result))
            except Exception as e:
                results.append(
                    {
                        "status": "error",
                        "hostname": target.get("hostname", "unknown"),
                        "error": str(e),
                    }
                )
    
        return json.dumps(
            {
                "status": "success",
                "total_targets": len(targets),
                "results": results,
                "completed_at": datetime.now().isoformat(),
            },
            indent=2,
        )
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 the tool discovers devices via SSH and stores them in a database, implying a write operation, but doesn't disclose critical details like authentication requirements, potential side effects (e.g., overwriting existing data), error handling, or performance characteristics (e.g., batch size limits). This leaves significant gaps in understanding the tool's 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 front-loads the core action ('discover multiple devices via SSH') and outcome ('store them in the network site map database'). There's no wasted verbiage, and it directly communicates the tool's function without unnecessary elaboration.

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 the complexity of a bulk SSH discovery and database storage operation with no annotations and no output schema, the description is insufficient. It lacks details on what 'discover' entails (e.g., what device attributes are collected), how results are returned, error conditions, or dependencies. For a tool that likely involves network operations and data persistence, more context is needed for 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%, with the 'targets' parameter well-documented in the schema as an array of device configurations. The description adds no additional parameter semantics beyond what's in the schema, such as explaining the relationship between password and key_path or typical hostname formats. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 tool's purpose with specific verbs ('discover multiple devices via SSH' and 'store them in the network site map database'), making it evident this is a bulk discovery and mapping operation. However, it doesn't explicitly differentiate from sibling tools like 'discover_and_map' (singular) or 'ssh_discover', leaving some ambiguity about when to choose this bulk version over alternatives.

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 'discover_and_map' or 'ssh_discover'. It mentions the action but gives no context about prerequisites, timing, or comparison with sibling tools, leaving the agent to infer usage scenarios without explicit direction.

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/mcp_python_server'

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