Skip to main content
Glama

get_application_logs

Retrieve application logs with pattern detection and filtering by time range, search query, and severity level for monitoring and troubleshooting.

Instructions

Get application logs with pattern analysis.

Retrieves application logs with automatic pattern detection and grouping. Supports filtering by time range, search query, and severity level.

Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) from_timestamp: Start timestamp (optional) to_timestamp: End timestamp (optional) query: Log search query (optional) severity: Filter by severity level (optional)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
app_idYes
from_timestampNo
to_timestampNo
queryNo
severityNo

Implementation Reference

  • Primary MCP tool handler for get_application_logs, registered via @mcp.tool() decorator. Defines input schema via type hints and docstring, calls implementation function.
    async def get_application_logs( project_id: str, app_id: str, from_timestamp: int | None = None, to_timestamp: int | None = None, query: str | None = None, severity: str | None = None, ) -> dict[str, Any]: """Get application logs with pattern analysis. Retrieves application logs with automatic pattern detection and grouping. Supports filtering by time range, search query, and severity level. Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) from_timestamp: Start timestamp (optional) to_timestamp: End timestamp (optional) query: Log search query (optional) severity: Filter by severity level (optional) """ return await get_application_logs_impl( # type: ignore[no-any-return] project_id, app_id, from_timestamp, to_timestamp, query, severity )
  • Core handler implementation that encodes the app_id and invokes the CorootClient to fetch application logs from the API.
    @handle_errors async def get_application_logs_impl( project_id: str, app_id: str, from_timestamp: int | None = None, to_timestamp: int | None = None, query: str | None = None, severity: str | None = None, ) -> dict[str, Any]: """Get application logs.""" # URL encode the app_id since it contains slashes encoded_app_id = quote(app_id, safe="") logs = await get_client().get_application_logs( project_id, encoded_app_id, from_timestamp, to_timestamp, query, severity ) return { "success": True, "logs": logs, }
  • CorootClient helper method that makes the HTTP request to the Coroot API endpoint for application logs.
    async def get_application_logs( self, project_id: str, app_id: str, from_timestamp: int | None = None, to_timestamp: int | None = None, query: str | None = None, severity: str | None = None, ) -> dict[str, Any]: """Get application logs. Args: project_id: Project ID. app_id: Application ID. from_timestamp: Start timestamp. to_timestamp: End timestamp. query: Log search query. severity: Filter by severity level. Returns: Application logs and patterns. """ params = {} if from_timestamp: params["from"] = str(from_timestamp) if to_timestamp: params["to"] = str(to_timestamp) if query: params["query"] = query if severity: params["severity"] = severity response = await self._request( "GET", f"/api/project/{project_id}/app/{app_id}/logs", params=params, ) data: dict[str, Any] = response.json() return data
  • Input schema and documentation for the get_application_logs tool, defining parameters and their descriptions.
    """Get application logs with pattern analysis. Retrieves application logs with automatic pattern detection and grouping. Supports filtering by time range, search query, and severity level. Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) from_timestamp: Start timestamp (optional) to_timestamp: End timestamp (optional) query: Log search query (optional) severity: Filter by severity level (optional) """

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/jamesbrink/mcp-coroot'

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