Skip to main content
Glama
vespo92

TrueNAS Core MCP Server

list_pools

Retrieve and display all available storage pools on TrueNAS Core systems using this tool, enabling efficient storage monitoring and management.

Instructions

List all storage pools

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the list_pools tool. It retrieves pool data from the TrueNAS API, calculates usage statistics, formats sizes, processes topology, and returns a structured response with pools list and metadata.
    async def list_pools(self) -> Dict[str, Any]:
        """
        List all storage pools
        
        Returns:
            Dictionary containing list of pools with their status
        """
        await self.ensure_initialized()
        
        pools = await self.client.get("/pool")
        
        pool_list = []
        for pool in pools:
            # Calculate usage percentage
            size = pool.get("size", 0)
            allocated = pool.get("allocated", 0)
            free = pool.get("free", 0)
            usage_percent = (allocated / size * 100) if size > 0 else 0
            
            pool_info = {
                "name": pool.get("name"),
                "status": pool.get("status"),
                "healthy": pool.get("healthy"),
                "encrypted": pool.get("encrypt", 0) > 0,
                "size": self.format_size(size),
                "allocated": self.format_size(allocated),
                "free": self.format_size(free),
                "usage_percent": round(usage_percent, 2),
                "fragmentation": pool.get("fragmentation"),
                "scan": pool.get("scan", {}).get("state") if pool.get("scan") else None,
                "topology": {
                    "data_vdevs": len(pool.get("topology", {}).get("data", [])),
                    "cache_vdevs": len(pool.get("topology", {}).get("cache", [])),
                    "log_vdevs": len(pool.get("topology", {}).get("log", [])),
                    "spare_vdevs": len(pool.get("topology", {}).get("spare", []))
                }
            }
            pool_list.append(pool_info)
        
        # Calculate totals
        total_size = sum(p.get("size", 0) for p in pools)
        total_allocated = sum(p.get("allocated", 0) for p in pools)
        total_free = sum(p.get("free", 0) for p in pools)
        
        return {
            "success": True,
            "pools": pool_list,
            "metadata": {
                "pool_count": len(pool_list),
                "healthy_pools": sum(1 for p in pool_list if p["healthy"]),
                "degraded_pools": sum(1 for p in pool_list if not p["healthy"]),
                "total_capacity": self.format_size(total_size),
                "total_allocated": self.format_size(total_allocated),
                "total_free": self.format_size(total_free),
                "overall_usage_percent": round((total_allocated / total_size * 100) if total_size > 0 else 0, 2)
            }
        }
  • The get_tool_definitions method registers the list_pools tool (line 15) along with other storage tools. The registration tuple specifies the tool name, handler method, description, and input schema (empty dict for list_pools).
    def get_tool_definitions(self) -> list:
        """Get tool definitions for storage management"""
        return [
            ("list_pools", self.list_pools, "List all storage pools", {}),
            ("get_pool_status", self.get_pool_status, "Get detailed status of a specific pool",
             {"pool_name": {"type": "string", "required": True}}),
            ("list_datasets", self.list_datasets, "List all datasets", {}),
            ("get_dataset", self.get_dataset, "Get detailed information about a dataset",
             {"dataset": {"type": "string", "required": True}}),
            ("create_dataset", self.create_dataset, "Create a new dataset",
             {"pool": {"type": "string", "required": True},
              "name": {"type": "string", "required": True},
              "compression": {"type": "string", "required": False},
              "quota": {"type": "string", "required": False},
              "recordsize": {"type": "string", "required": False}}),
            ("delete_dataset", self.delete_dataset, "Delete a dataset",
             {"dataset": {"type": "string", "required": True},
              "recursive": {"type": "boolean", "required": False}}),
            ("update_dataset", self.update_dataset, "Update dataset properties",
             {"dataset": {"type": "string", "required": True},
              "properties": {"type": "object", "required": True}}),
        ]
  • Input schema for list_pools tool: empty dictionary indicating no required parameters.
    ("list_pools", self.list_pools, "List all storage pools", {}),
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'List all storage pools' implies a read-only operation but doesn't specify whether this returns all pools at once or uses pagination, what format the results are in, or any authentication requirements. For a tool with zero annotation coverage, this is inadequate.

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 communicates the core purpose without any wasted words. It's appropriately sized for a simple list operation and is front-loaded with the 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?

Given no annotations and no output schema, the description is insufficient for a complete understanding. While the purpose is clear, there's no information about what the tool returns (e.g., pool names, IDs, statuses) or behavioral aspects like pagination or error conditions. For a tool in a storage management context, more context is needed.

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 tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description doesn't need to compensate for missing parameter documentation since there are no parameters to document.

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 'List all storage pools' clearly states the verb ('List') and resource ('storage pools'), making the tool's purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_datasets' or 'list_smb_shares' beyond the resource name, which prevents a perfect score.

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. With sibling tools like 'get_pool_status' that might provide more detailed information about pools, there's no indication of when a simple list is sufficient versus when status details are needed.

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

Related 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/vespo92/TrueNasCoreMCP'

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