Skip to main content
Glama

configure_profiling

Enable or disable continuous profiling for applications and configure CPU and memory sampling rates within the observability platform to enhance performance monitoring and analysis.

Instructions

Configure CPU and memory profiling for an application.

Enables or disables continuous profiling and sets the sampling rate for collecting CPU and memory profiles.

Args: project_id: The project ID app_id: The application ID enabled: Whether to enable profiling sample_rate: Optional sampling rate (0.0-1.0)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
enabledYes
project_idYes
sample_rateNo

Implementation Reference

  • The main handler function for the 'configure_profiling' MCP tool. It is decorated with @mcp.tool() which registers it, and delegates to the _impl helper.
    @mcp.tool() async def configure_profiling( project_id: str, app_id: str, enabled: bool, sample_rate: Any = None ) -> dict[str, Any]: """ Configure CPU and memory profiling for an application. Enables or disables continuous profiling and sets the sampling rate for collecting CPU and memory profiles. Args: project_id: The project ID app_id: The application ID enabled: Whether to enable profiling sample_rate: Optional sampling rate (0.0-1.0) """ return await configure_profiling_impl(project_id, app_id, enabled, sample_rate)
  • The core implementation logic that handles parameter validation, type conversion workarounds for FastMCP, and calls the CorootClient.configure_profiling method.
    async def configure_profiling_impl( project_id: str, app_id: str, enabled: bool, sample_rate: Any = None ) -> dict[str, Any]: """Implementation for configure_profiling tool.""" try: client = get_client() config = {"enabled": enabled} # Handle FastMCP type conversion issue if sample_rate is not None: if isinstance(sample_rate, str): try: sample_rate = float(sample_rate) except ValueError: return { "success": False, "error": f"Invalid sample_rate: {sample_rate}", } config["sample_rate"] = sample_rate result = await client.configure_profiling(project_id, app_id, config) return { "success": True, "message": "Profiling 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)}"}

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