list_apps
Retrieve Scout APM applications with optional filtering by activity date to identify monitored applications and their reporting status.
Instructions
List available Scout APM applications. Provide an optional `active_since` ISO 8601
to filter to only apps that have reported data since that time. Defaults to the
metric retention period of thirty days.
Args:
active_since (str): ISO 8601 datetime string to filter apps active since that
time.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| active_since | No |
Implementation Reference
- scout_mcp/server.py:122-122 (registration)Registration of the 'list_apps' tool using the @mcp.tool decorator.@mcp.tool(name="list_apps")
- scout_mcp/server.py:123-159 (handler)The main handler function for the 'list_apps' tool. It fetches all Scout APM applications using the API client, filters them based on the optional 'active_since' parameter (defaulting to 30 days ago), and returns the filtered list or an error.async def list_scout_apps(active_since: str | None = None) -> list[dict[str, Any]]: """ List available Scout APM applications. Provide an optional `active_since` ISO 8601 to filter to only apps that have reported data since that time. Defaults to the metric retention period of thirty days. Args: active_since (str): ISO 8601 datetime string to filter apps active since that time. """ active_time = ( scout_api._parse_time(active_since) if active_since else datetime.now(tz=timezone.utc) - timedelta(days=30) ) def parse_reported_at(reported_at: str) -> datetime: parsed = ( scout_api._parse_time(reported_at) if reported_at else datetime.min.replace(tzinfo=timezone.utc) ) return parsed try: async with api_client as scout_client: apps = await scout_client.get_apps() filtered = [ app for app in apps if parse_reported_at(app["last_reported_at"]) >= active_time ] return filtered except scout_api.ScoutAPMError as e: return [{"error": str(e)}]