Skip to main content
Glama
Red5d

Beszel MCP Server

by Red5d

query_container_stats

Retrieve time-series statistics for container CPU, memory, and network usage by specifying container ID and optional time range parameters.

Instructions

Query statistics for a specific container.

Args: container_id: The container ID to query statistics for start_time: Start time in ISO 8601 format (e.g., '2024-01-01T00:00:00Z') end_time: End time in ISO 8601 format page: Page number (default: 1) per_page: Number of results per page (default: 100)

Returns: Dictionary containing time-series data for container CPU, memory, and network usage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
container_idYes
start_timeNo
end_timeNo
pageNo
per_pageNo

Implementation Reference

  • The @mcp.tool()-decorated handler function implementing the query_container_stats tool. It processes input parameters for container ID and optional time range/pagination, authenticates the PocketBase client, builds PocketBase filters, and queries the 'container_stats' collection for time-series data on CPU, memory, and network usage.
    @mcp.tool() async def query_container_stats( container_id: str, start_time: Optional[str] = None, end_time: Optional[str] = None, page: int = 1, per_page: int = 100, ) -> dict: """Query statistics for a specific container. Args: container_id: The container ID to query statistics for start_time: Start time in ISO 8601 format (e.g., '2024-01-01T00:00:00Z') end_time: End time in ISO 8601 format page: Page number (default: 1) per_page: Number of results per page (default: 100) Returns: Dictionary containing time-series data for container CPU, memory, and network usage """ client = get_client() await ensure_authenticated(client) # Build filter for container and time range filters = [f"container = '{container_id}'"] time_filter = client.build_time_filter("created", start_time, end_time) if time_filter: filters.append(time_filter) return await client.query_stats( collection="container_stats", filter=" && ".join(filters), page=page, per_page=per_page, sort="-created", )

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