Skip to main content
Glama

configure_logs

Set up and manage log collection for an application by enabling/disabling collection, defining minimum log levels, and excluding specific patterns via regex on the MCP Server for Coroot.

Instructions

Configure log collection settings for an application.

Controls which logs are collected and processed, including log level filtering and pattern exclusions.

Args: project_id: The project ID app_id: The application ID enabled: Whether to enable log collection level: Optional minimum log level (debug, info, warn, error) excluded_patterns: Optional regex patterns to exclude

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
enabledYes
excluded_patternsNo
levelNo
project_idYes

Implementation Reference

  • Primary MCP tool handler for 'configure_logs', including registration via @mcp.tool() decorator and input schema definition through parameters and docstring. Calls internal implementation.
    @mcp.tool() async def configure_logs( project_id: str, app_id: str, enabled: bool, level: str | None = None, excluded_patterns: list[str] | None = None, ) -> dict[str, Any]: """ Configure log collection settings for an application. Controls which logs are collected and processed, including log level filtering and pattern exclusions. Args: project_id: The project ID app_id: The application ID enabled: Whether to enable log collection level: Optional minimum log level (debug, info, warn, error) excluded_patterns: Optional regex patterns to exclude """ return await configure_logs_impl( project_id, app_id, enabled, level, excluded_patterns )
  • Internal helper implementation that builds the configuration dictionary and invokes the CorootClient.configure_logs method, with error handling.
    async def configure_logs_impl( project_id: str, app_id: str, enabled: bool, level: str | None = None, excluded_patterns: list[str] | None = None, ) -> dict[str, Any]: """Implementation for configure_logs tool.""" try: client = get_client() config: dict[str, Any] = {"enabled": enabled} if level: config["level"] = level if excluded_patterns: config["excluded_patterns"] = excluded_patterns result = await client.configure_logs(project_id, app_id, config) return { "success": True, "message": "Log collection configuration updated successfully", "config": result, } except ValueError as e: return {"success": False, "error": str(e)} except Exception as e: return {"success": False, "error": f"Unexpected error: {str(e)}"}
  • CorootClient method that performs the actual HTTP POST request to the Coroot API to configure log collection for the specified application.
    async def configure_logs( self, project_id: str, app_id: str, config: dict[str, Any] ) -> dict[str, Any]: """Configure log collection for an application. Args: project_id: The project ID app_id: The application ID config: Log collection configuration Returns: Dict containing updated configuration """ # URL encode the app_id in case it contains slashes encoded_app_id = quote(app_id, safe="") response = await self._request( "POST", f"/api/project/{project_id}/app/{encoded_app_id}/logs", json=config ) return self._parse_json_response(response)

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