get_endpoint_metrics
Retrieve performance metrics for specific application endpoints to monitor response times, throughput, and identify performance issues within a defined time range.
Instructions
Get a single timeseries metric for a specific endpoint in an application.
Args:
app_id (int): The ID of the Scout APM application.
endpoint (str): The endpoint path (e.g., "/users", "/orders").
metric (str): The metric to retrieve (e.g., "response_time", "throughput").
from_ (str): The start datetime in ISO 8601 format.
to (str): The end datetime in ISO 8601 format.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | ||
| endpoint | Yes | ||
| metric | Yes | ||
| from_ | Yes | ||
| to | Yes |
Implementation Reference
- scout_mcp/server.py:225-261 (handler)The handler function for the 'get_endpoint_metrics' tool. It is decorated with @mcp.tool(name="get_endpoint_metrics") and implements the logic to retrieve timeseries metric data for a specific endpoint in a Scout APM application using the ScoutAPI client.@mcp.tool(name="get_endpoint_metrics") async def get_endpoint_metric( app_id: int, endpoint: str, metric: str, from_: str, to: str ) -> dict[str, Any]: """ Get a single timeseries metric for a specific endpoint in an application. Args: app_id (int): The ID of the Scout APM application. endpoint (str): The endpoint path (e.g., "/users", "/orders"). metric (str): The metric to retrieve (e.g., "response_time", "throughput"). from_ (str): The start datetime in ISO 8601 format. to (str): The end datetime in ISO 8601 format. """ try: duration = scout_api.make_duration(from_, to) async with api_client as scout_client: data = await scout_client.get_endpoint_metric( app_id, endpoint, metric, duration ) except Exception as e: return {"error": str(e)} if metric not in data or not data[metric]: return { "error": f"No data available for endpoint {endpoint} and metric {metric}" } series = data[metric] return { "app_id": app_id, "endpoint": endpoint, "metric": metric, "duration": f"{from_} to {to}", "data_points": len(series), "series": series, }