Skip to main content
Glama
scoutapp

Scout Monitoring MCP

Official

get_app_metrics

Retrieve performance metrics for a specific application to analyze response times, throughput, and other key indicators within a defined time period.

Instructions

Get individual metric data for a specific application.

Args:
    app_id (int): The ID of the Scout APM application.
    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
NameRequiredDescriptionDefault
app_idYes
metricYes
from_Yes
toYes

Implementation Reference

  • MCP tool handler implementation for 'get_app_metrics'. Uses Scout API to fetch metric data for a specific app, validates metric, handles errors, and formats response with series data.
    @mcp.tool(name="get_app_metrics")
    async def get_app_metric(
        app_id: int, metric: str, from_: str, to: str
    ) -> dict[str, Any]:
        """Get individual metric data for a specific application.
    
        Args:
            app_id (int): The ID of the Scout APM application.
            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.
    
        """
        if metric not in scout_api.VALID_METRICS:
            return {
                "error": f"Invalid metric '{metric}'. "
                f"Valid metrics are: {', '.join(scout_api.VALID_METRICS)}"
            }
        try:
            async with api_client as scout_client:
                data = await scout_client.get_metric_data(app_id, metric, from_, to)
        except scout_api.ScoutAPMError as e:
            return {"error": str(e)}
    
        if metric not in data or not data[metric]:
            return {"error": f"No data available for metric {metric}"}
    
        series = data[metric]
        return {
            "app_id": app_id,
            "metric": metric,
            "duration": f"{from_} to {to}",
            "data_points": len(series),
            "series": series,
        }

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/scoutapp/scout-mcp-local'

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