Skip to main content
Glama

analyze_transients

Detect and analyze transient events in your audio project, such as note attacks and drum hits. Returns the count and timing of up to 100 onset events for precise editing.

Instructions

Render the project and detect transient events (note attacks, drum hits, etc.). Returns the count and timing of up to 100 transient onset events.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler for the 'analyze_transients' MCP tool. Renders the project to a temp WAV, uses librosa to detect onset events (note attacks, drum hits), and returns up to 100 onset timestamps.
    def analyze_transients() -> dict:
        """
        Render the project and detect transient events (note attacks, drum hits, etc.).
        Returns the count and timing of up to 100 transient onset events.
        """
        try:
            import librosa
            from reaper_mcp.render_tools import render_to_temp_file
    
            tmp = render_to_temp_file(sample_rate=44100)
            try:
                y, sr = librosa.load(tmp, sr=None, mono=True)
            finally:
                if os.path.exists(tmp):
                    os.unlink(tmp)
    
            onset_frames = librosa.onset.onset_detect(y=y, sr=sr, units="frames")
            onset_times = librosa.frames_to_time(onset_frames, sr=sr).tolist()
            capped = onset_times[:100]
    
            return {
                "success": True,
                "onset_count": len(onset_times),
                "onset_times_seconds": [round(t, 3) for t in capped],
                "note": "Showing up to 100 events" if len(onset_times) > 100 else None,
            }
        except Exception as e:
            return {"success": False, "error": str(e)}
  • The decorator-based schema/registration for the tool. No input parameters; returns a dict with success, onset_count, onset_times_seconds, and optional note.
    @mcp.tool()
    def analyze_transients() -> dict:
  • The tool registration entry point: imports and calls register_tools from analysis_tools.py on the mcp instance in server.py.
    from reaper_mcp.analysis_tools import register_tools as _reg_analysis
    
    _reg_project(mcp)
    _reg_track(mcp)
    _reg_midi(mcp)
    _reg_fx(mcp)
    _reg_audio(mcp)
    _reg_mixing(mcp)
    _reg_render(mcp)
    _reg_mastering(mcp)
    _reg_analysis(mcp)
  • The register_tools function that decorates analyze_transients (and analyze_frequency_spectrum) as MCP tools.
    def register_tools(mcp):
  • Helper function used by analyze_transients to render the project to a temporary WAV file for analysis.
    def render_to_temp_file(sample_rate: int = 48000) -> str:
        """
        Render the current project to a temporary WAV file and return its path.
        Used by analysis and mastering tools. Caller is responsible for deleting the file.
        """
        import tempfile
        tmp = tempfile.mktemp(suffix=".wav")
        _set_render_settings(tmp, "wav", sample_rate, 24, 2, bounds=0)
        RPR.Main_OnCommand(41824, 0)
        return tmp
Behavior3/5

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

Discloses the limit of 100 events and that it renders the project, but does not mention side effects, modification status, or permission requirements. With no annotations, more detail would be beneficial.

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

Conciseness5/5

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

Two concise sentences that front-load the purpose and output value. No extraneous words.

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

Completeness5/5

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

For a simple parameterless tool with no output schema, the description covers the core action, output content, and a throughput limit. Complete for its complexity.

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?

Input schema has zero parameters, so the description does not need to explain parameters. Baseline of 4 is appropriate.

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?

Clearly states the tool detects transient events (note attacks, drum hits) and returns count and timing. This distinguishes it from sibling analysis tools like analyze_dynamics or analyze_frequency_spectrum.

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 explicit guidance on when to use this tool versus alternatives. Does not mention prerequisites or context beyond 'Render the project'.

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/bonfire-audio/reaper-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server