get_metrics_options
Retrieve available metric categories and options. Filter by category name, standard or custom type, and paginate results.
Instructions
Get available metric categories and options.
Args: category_name: Filter by specific category name is_standard: Filter by standard vs custom metrics page: Page number for pagination (default: 1) per_page: Results per page (default: 100, max: 100)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category_name | No | ||
| is_standard | No | ||
| page | No | ||
| per_page | No |
Implementation Reference
- src/tools.py:135-156 (handler)MCP tool handler for get_metrics_options. Decorated with @mcp.tool, accepts optional parameters (category_name, is_standard, page, per_page) and delegates to client.get_metrics_options(). The decorator automatically registers it as an MCP tool named 'get_metrics_options'.
@mcp.tool async def get_metrics_options( category_name: str | None = None, is_standard: bool | None = None, page: int = 1, per_page: int = 100, ) -> PaginatedMetricOptions: """Get available metric categories and options. Args: category_name: Filter by specific category name is_standard: Filter by standard vs custom metrics page: Page number for pagination (default: 1) per_page: Results per page (default: 100, max: 100) """ async with StandardMetrics() as client: return await client.get_metrics_options( category_name=category_name, is_standard=is_standard, page=page, page_size=per_page, ) - src/server.py:78-78 (registration)The wildcard import `from src.tools import *` registers all tools (including get_metrics_options) on the FastMCP server instance via the @mcp.tool decorator.
from src.tools import * # noqa: F403 - need to register all of the tools - src/_client.py:168-183 (helper)Client method `get_metrics_options` on the StandardMetrics class. Makes a GET request to 'v1/metrics/options/' with optional query params (category_name, is_standard, page, page_size) and returns a PaginatedMetricOptions model.
async def get_metrics_options( self, *, category_name: str | None = None, is_standard: bool | None = None, page: int = 1, page_size: int = 100, ) -> PaginatedMetricOptions: """Get available metric categories and options.""" params: dict[str, Any] = {"page": page, "page_size": page_size} if category_name: params["category_name"] = category_name if is_standard is not None: params["is_standard"] = is_standard response = await self._request("GET", "v1/metrics/options/", params=params) return PaginatedMetricOptions.model_validate(response) - src/_types.py:151-160 (schema)MetricOption Pydantic model schema defining the shape of each metric option returned (category_name, category_id, is_standard, type, is_point_in_time, is_archived, description, is_multiple, choices).
class MetricOption(pydantic.BaseModel): category_name: str category_id: str is_standard: bool type: str is_point_in_time: bool is_archived: bool description: str = "" is_multiple: bool choices: list[str] | None = None - src/_types.py:277-277 (schema)PaginatedMetricOptions type alias: PaginatedResponse[MetricOption] - the generic paginated wrapper for the list of MetricOption items.
PaginatedMetricOptions = PaginatedResponse[MetricOption]