Skip to main content
Glama

get_application_logs

Retrieve and analyze application logs with pattern detection via time range, search query, and severity level filters to streamline troubleshooting and monitoring processes.

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
app_idYes
from_timestampNo
project_idYes
queryNo
severityNo
to_timestampNo

Implementation Reference

  • Primary MCP handler and registration for the 'get_application_logs' tool using @mcp.tool() decorator. Includes schema via type hints and docstring. Thin wrapper around helper implementation.
    @mcp.tool() 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 )
  • Helper implementation that URL-encodes app_id and calls the CorootClient.get_application_logs method.
    @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 method that executes the actual HTTP request to fetch application logs from the Coroot API server.
    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

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