Skip to main content
Glama
scoutapp

Scout Monitoring MCP

Official

get_app_endpoint_traces

Retrieve recent traces for a specific application endpoint to analyze performance issues and identify optimization opportunities within a defined time range.

Instructions

Get recent traces for an app filtered to a specific endpoint. Args: app_id (int): The ID of the Scout APM application. endpoint_id (str): The ID of the endpoint to filter traces. 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
endpoint_idYes
from_Yes
toYes

Implementation Reference

  • MCP tool handler for 'get_app_endpoint_traces'. Registers the tool and implements the logic by converting time parameters to Duration and delegating to the Scout API client to fetch traces for the specified app endpoint.
    @mcp.tool(name="get_app_endpoint_traces") async def get_app_endpoint_traces( app_id: int, from_: str, to: str, endpoint_id: str ) -> list[dict[str, Any]]: """ Get recent traces for an app filtered to a specific endpoint. Args: app_id (int): The ID of the Scout APM application. endpoint_id (str): The ID of the endpoint to filter traces. 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: traces = await scout_client.get_endpoint_traces( app_id, endpoint_id, duration ) return traces except scout_api.ScoutAPMError as e: return [{"error": str(e)}]
  • Core helper method in ScoutAPMAsync that performs API validation and HTTP request to retrieve traces for a specific endpoint.
    async def get_endpoint_traces( self, app_id: int, endpoint_id: str, duration: Duration, ) -> List[Dict[str, Any]]: """Get traces for a specific endpoint.""" self._validate_time_range(duration) # Validate that from_time is not older than 7 days seven_days_ago = datetime.now(tz=timezone.utc) - timedelta(days=7) if duration.start < seven_days_ago: raise ValueError("from_time cannot be older than 7 days") response = await self._make_request( "GET", f"apps/{app_id}/endpoints/{endpoint_id}/traces", params=self._get_duration_params(duration), ) return response.get("results", {}).get("traces", [])
  • Utility function used by the tool handler to convert 'from_' and 'to' ISO datetime strings into a Duration object.
    def make_duration(from_: str, to: str) -> Duration: """Helper to create a Duration object from ISO 8601 strings.""" start = _parse_time(from_) end = _parse_time(to) return Duration(start=start, end=end)

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