Skip to main content
Glama

configure_profiling

Configure CPU and memory profiling settings for applications in Coroot projects. Enable or disable continuous profiling and adjust sampling rates to collect performance data.

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
project_idYes
app_idYes
enabledYes
sample_rateNo

Implementation Reference

  • Core handler function for the configure_profiling MCP tool. Processes arguments, handles FastMCP string-to-float conversion for sample_rate, constructs config dict, calls CorootClient.configure_profiling, and returns standardized success/error response.
    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)}"}
  • MCP tool registration using @mcp.tool(). Defines the tool interface, parameters, and docstring schema for the configure_profiling tool. Delegates to the impl function.
    @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)
  • Input schema and documentation for the configure_profiling tool, defining parameters and their descriptions used for validation and tool calling.
    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)
  • Supporting client method that makes the actual HTTP POST request to Coroot API to configure profiling, handling app_id encoding and response parsing.
    async def configure_profiling( self, project_id: str, app_id: str, config: dict[str, Any] ) -> dict[str, Any]: """Configure profiling for an application. Args: project_id: The project ID app_id: The application ID config: Profiling 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}/profiling", json=config, ) 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