Skip to main content
Glama
vespo92

TrueNAS Core MCP Server

list_smb_shares

Identify and display all SMB shares available on the TrueNAS Core MCP Server to manage storage access and sharing configurations efficiently.

Instructions

List all SMB shares

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'list_smb_shares' tool. It fetches SMB shares from the TrueNAS API (/sharing/smb), extracts and formats key fields into a list of dictionaries, computes metadata statistics, and returns a success response with shares and metadata.
    @tool_handler
    async def list_smb_shares(self) -> Dict[str, Any]:
        """
        List all SMB shares
        
        Returns:
            Dictionary containing list of SMB shares
        """
        await self.ensure_initialized()
        
        shares = await self.client.get("/sharing/smb")
        
        share_list = []
        for share in shares:
            share_info = {
                "id": share.get("id"),
                "name": share.get("name"),
                "path": share.get("path"),
                "comment": share.get("comment"),
                "enabled": share.get("enabled", True),
                "read_only": share.get("ro", False),
                "browsable": share.get("browsable", True),
                "guest_ok": share.get("guestok", False),
                "hosts_allow": share.get("hostsallow", []),
                "hosts_deny": share.get("hostsdeny", []),
                "home": share.get("home", False),
                "timemachine": share.get("timemachine", False),
                "recyclebin": share.get("recyclebin", False),
                "audit": share.get("audit", {})
            }
            share_list.append(share_info)
        
        return {
            "success": True,
            "shares": share_list,
            "metadata": {
                "total_shares": len(share_list),
                "enabled_shares": sum(1 for s in share_list if s["enabled"]),
                "read_only_shares": sum(1 for s in share_list if s["read_only"]),
                "guest_shares": sum(1 for s in share_list if s["guest_ok"]),
                "timemachine_shares": sum(1 for s in share_list if s["timemachine"])
            }
        }
  • Local registration of the 'list_smb_shares' tool within the SharingTools.get_tool_definitions() method, specifying the handler function, description, and empty input schema.
    ("list_smb_shares", self.list_smb_shares, "List all SMB shares", {}),
  • Server-level registration includes SharingTools class, which provides the 'list_smb_shares' tool among others, by instantiating tool classes and registering their methods via MCP.tool().
    UserTools,
    StorageTools,
    SharingTools,
    SnapshotTools
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'List all SMB shares' but doesn't clarify if this is a read-only operation, what the output format might be, or any limitations (e.g., pagination, rate limits). For a tool with zero annotation coverage, this leaves significant gaps in understanding its 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: 'List all SMB shares.' It is front-loaded with the core action and resource, with zero wasted words. This is appropriately sized for a simple list tool.

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?

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on behavior, usage context, or output. For a simple list operation, this might suffice, but it doesn't fully compensate for the absence of annotations or output schema.

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, and the input schema has 100% description coverage (though empty). The description doesn't need to add parameter details, so it meets the baseline for tools with no parameters. No additional semantic value is required or provided.

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 SMB shares' clearly states the verb ('List') and resource ('SMB shares'), making the tool's purpose immediately understandable. It doesn't differentiate from siblings like 'list_datasets' or 'list_pools', but the resource specificity is adequate. No tautology with the name 'list_smb_shares' since it adds the resource type.

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. It doesn't mention prerequisites, context, or exclusions, such as whether it requires specific permissions or differs from other list tools. With siblings like 'list_datasets' and 'list_pools', some differentiation would be helpful.

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