Skip to main content
Glama
jamesbrink

MCP Server for Coroot

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic functionality. It doesn't disclose whether this is a mutating operation (implied by 'configure'), what permissions are required, whether changes are reversible, or any rate limits/constraints. For a configuration tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement followed by a bullet-point style parameter explanation. Every sentence adds value, though the formatting with 'Args:' could be slightly more polished for natural language understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there's an output schema (which handles return values), the description covers the basic purpose and parameters adequately. However, for a configuration/mutation tool with no annotations, it should provide more behavioral context about what 'configure' entails operationally.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides clear semantic meaning for all 4 parameters: identifies project_id and app_id as identifiers, explains enabled as a boolean toggle, and specifies sample_rate as optional with a valid range (0.0-1.0). This adds significant value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('configure CPU and memory profiling'), the resource ('for an application'), and distinguishes it from sibling tools like 'configure_logs' or 'configure_tracing' by focusing on profiling rather than logging or tracing functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_application_profiling' (for reading) or other configuration tools. The description only states what it does, not when it's appropriate or what prerequisites might be needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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