Skip to main content
Glama
Red5d

Beszel MCP Server

by Red5d

list_containers

Retrieve and filter monitored container data from Beszel's system monitoring tool to view infrastructure status and manage container information.

Instructions

List all monitored containers in Beszel.

Args: page: Page number (default: 1) per_page: Number of results per page (default: 50) filter: PocketBase filter string sort: Sort order

Returns: Dictionary containing paginated list of containers running on monitored systems

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
per_pageNo
filterNo
sortNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The @mcp.tool()-decorated async handler function implementing the list_containers tool. It fetches a paginated list of containers from the Beszel PocketBase 'containers' collection using the PocketBaseClient.
    @mcp.tool()
    async def list_containers(
        page: int = 1,
        per_page: int = 50,
        filter: Optional[str] = None,
        sort: Optional[str] = None,
    ) -> dict:
        """List all monitored containers in Beszel.
        
        Args:
            page: Page number (default: 1)
            per_page: Number of results per page (default: 50)
            filter: PocketBase filter string
            sort: Sort order
        
        Returns:
            Dictionary containing paginated list of containers running on monitored systems
        """
        client = get_client()
        await ensure_authenticated(client)
        
        return await client.get_list(
            collection="containers",
            page=page,
            per_page=per_page,
            filter=filter,
            sort=sort,
        )
  • The PocketBaseClient.get_list method called by the list_containers handler to retrieve paginated records from the PocketBase API.
    async def get_list(
        self,
        collection: str,
        page: int = 1,
        per_page: int = 50,
        filter: Optional[str] = None,
        sort: Optional[str] = None,
        expand: Optional[str] = None,
    ) -> dict[str, Any]:
        """Get a paginated list of records from a collection.
        
        Args:
            collection: The collection name
            page: Page number (default: 1)
            per_page: Number of records per page (default: 50)
            filter: PocketBase filter string
            sort: Sort order (e.g., "-created")
            expand: Fields to expand (e.g., "relField1,relField2")
            
        Returns:
            Dictionary containing paginated results
        """
        params = {
            "page": page,
            "perPage": per_page,
        }
        
        if filter:
            params["filter"] = filter
        if sort:
            params["sort"] = sort
        if expand:
            params["expand"] = expand
    
        try:
            response = await self.client.get(
                f"{self.base_url}/api/collections/{collection}/records",
                params=params,
                headers=self._get_headers(),
            )
            response.raise_for_status()
            return response.json()
        except httpx.HTTPStatusError as e:
            raise Exception(f"Failed to get records from {collection}: {e.response.text}")
        except Exception as e:
            raise Exception(f"Failed to get records from {collection}: {e}")
  • Utility function to get or initialize the global PocketBaseClient instance used in the list_containers handler.
    def get_client() -> PocketBaseClient:
        """Get or create the PocketBase client."""
        global pb_client
        
        if pb_client is None:
            base_url = os.environ.get("BESZEL_URL")
            if not base_url:
                raise ValueError("BESZEL_URL environment variable is required")
            
            email = os.environ.get("BESZEL_EMAIL")
            password = os.environ.get("BESZEL_PASSWORD")
            
            pb_client = PocketBaseClient(base_url, email, password)
        
        return pb_client
  • Utility function to ensure the PocketBase client is authenticated before use in list_containers.
    async def ensure_authenticated(client: PocketBaseClient) -> None:
        """Ensure the client is authenticated."""
        if client.email and client.password and not client.token:
            await client.authenticate()
Behavior3/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 reveals this is a read operation (listing), mentions pagination behavior, and indicates it returns a dictionary with paginated results. However, it doesn't disclose important behavioral aspects like authentication requirements, rate limits, error conditions, or what 'monitored containers' specifically entails.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Args, Returns) and front-loaded the core purpose. Each sentence earns its place by providing essential information. It could be slightly more concise by integrating the purpose statement with the parameter explanations, but overall it's efficient.

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

Completeness4/5

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

Given the tool's moderate complexity (4 parameters, no annotations, but has output schema), the description is reasonably complete. It covers the purpose, all parameters with semantics, and the return structure. The output schema existence means it doesn't need to detail return values. However, it lacks context about what 'monitored containers' means and how this differs from sibling tools.

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?

With 0% schema description coverage, the description must compensate, which it does effectively. It explains all four parameters (page, per_page, filter, sort) with clear semantics beyond just their names, including defaults and the nature of 'filter' as a PocketBase filter string. This adds significant value beyond the bare schema.

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 monitored containers in Beszel'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'query_container_stats' or 'list_systems', which might also involve container-related operations.

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 'query_container_stats' or 'list_systems'. It mentions filtering and sorting capabilities but doesn't explain when these features should be preferred over other tools that might provide container data.

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/Red5d/beszel-mcp'

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