Skip to main content
Glama
vespo92

TrueNAS Core MCP Server

list_users

Retrieve a list of all users configured on a TrueNAS Core system using the TrueNAS Core MCP Server, enabling efficient user management and system administration.

Instructions

List all users in TrueNAS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the list_users tool: fetches users from TrueNAS /user API, formats and filters data, categorizes into system/regular users, adds metadata.
    async def list_users(self) -> Dict[str, Any]:
        """
        List all users in TrueNAS
        
        Returns:
            Dictionary containing list of users and metadata
        """
        await self.ensure_initialized()
        
        users = await self.client.get("/user")
        
        # Filter and format user data
        user_list = []
        for user in users:
            user_info = {
                "id": user.get("id"),
                "username": user.get("username"),
                "full_name": user.get("full_name"),
                "email": user.get("email"),
                "uid": user.get("uid"),
                "groups": user.get("groups", []),
                "shell": user.get("shell"),
                "home": user.get("home"),
                "locked": user.get("locked", False),
                "sudo": user.get("sudo", False),
                "builtin": user.get("builtin", False)
            }
            user_list.append(user_info)
        
        # Categorize users
        system_users = [u for u in user_list if u["builtin"]]
        regular_users = [u for u in user_list if not u["builtin"]]
        
        return {
            "success": True,
            "users": user_list,
            "metadata": {
                "total_count": len(user_list),
                "system_users": len(system_users),
                "regular_users": len(regular_users),
                "locked_users": sum(1 for u in user_list if u["locked"])
            }
        }
  • UserTools.get_tool_definitions() defines the list_users tool registration including its handler reference, description, and input schema {}.
    def get_tool_definitions(self) -> list:
        """Get tool definitions for user management"""
        return [
            ("list_users", self.list_users, "List all users in TrueNAS", {}),
            ("get_user", self.get_user, "Get detailed information about a specific user", 
             {"username": {"type": "string", "required": True}}),
            ("create_user", self.create_user, "Create a new user",
             {"username": {"type": "string", "required": True},
              "full_name": {"type": "string", "required": False},
              "email": {"type": "string", "required": False},
              "password": {"type": "string", "required": True},
              "shell": {"type": "string", "required": False},
              "home": {"type": "string", "required": False},
              "groups": {"type": "array", "required": False}}),
            ("update_user", self.update_user, "Update an existing user",
             {"username": {"type": "string", "required": True},
              "updates": {"type": "object", "required": True}}),
            ("delete_user", self.delete_user, "Delete a user",
             {"username": {"type": "string", "required": True}}),
        ]
  • Input schema for list_users tool: empty dict indicating no parameters required.
    ("list_users", self.list_users, "List all users in TrueNAS", {}),
  • Registers all tools from UserTools (including list_users) with the FastMCP server instance using dynamic tool definitions.
    def _register_tool_methods(self, tool_instance):
        """Register individual tool methods from a tool instance"""
        # Get all methods that should be exposed as MCP tools
        tool_methods = tool_instance.get_tool_definitions()
        
        for method_name, method_func, method_description, method_params in tool_methods:
            # Register with MCP
            self.mcp.tool(name=method_name, description=method_description)(method_func)
            logger.debug(f"Registered tool: {method_name}")
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 but only states the action without details on permissions, rate limits, pagination, or output format. It lacks critical information like whether this requires admin access or returns all users at once.

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, clear sentence with no wasted words. It's front-loaded and efficiently conveys the core purpose without any fluff or redundancy.

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?

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., list format, user attributes) or behavioral aspects like permissions, making it inadequate for an agent to use confidently without additional context.

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 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a high baseline score for not adding unnecessary information.

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 verb ('List') and resource ('all users in TrueNAS'), making the purpose unambiguous. However, it doesn't distinguish itself from sibling tools like 'get_user' (which likely retrieves a single user), leaving room for minor improvement.

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 sibling tools like 'get_user' for retrieving specific users or clarify if this is the primary method for user enumeration, leaving the agent without contextual usage cues.

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