get_project_info
Retrieve current project name, path, tempo, track count, and length to monitor and manage project state.
Instructions
Get information about the current project: name, path, tempo, tracks, length.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/reaper_mcp/project_tools.py:73-106 (handler)The get_project_info() handler function that retrieves current project info (name, path, tempo, time signature, length, track count, markers, regions) via reapy, registered as an MCP tool via @mcp.tool() decorator.
def get_project_info() -> dict: """Get information about the current project: name, path, tempo, tracks, length.""" try: project = get_project() markers = [] try: for i in range(project.n_markers): m = project.markers[i] markers.append({"index": i, "name": m.name, "position": m.position}) except Exception: pass regions = [] try: for i in range(project.n_regions): r = project.regions[i] regions.append({"index": i, "name": r.name, "start": r.start, "end": r.end}) except Exception: pass return { "success": True, "name": project.name, "path": project.path, "tempo": project.bpm, "time_signature": f"{project.time_signature[0]}/{project.time_signature[1]}", "length": project.length, "track_count": project.n_tracks, "markers": markers, "regions": regions, } except Exception as e: logger.error(f"get_project_info failed: {e}") return {"success": False, "error": str(e)} - src/reaper_mcp/project_tools.py:14-16 (registration)The register_tools function that defines get_project_info as an MCP tool using the @mcp.tool() decorator inside the registration function.
def register_tools(mcp): @mcp.tool() - src/reaper_mcp/server.py:10-28 (registration)Server imports register_tools from project_tools (as _reg_project) and calls it on line 20 to register the tool with the FastMCP server.
from reaper_mcp.project_tools import register_tools as _reg_project from reaper_mcp.track_tools import register_tools as _reg_track from reaper_mcp.midi_tools import register_tools as _reg_midi from reaper_mcp.fx_tools import register_tools as _reg_fx from reaper_mcp.audio_tools import register_tools as _reg_audio from reaper_mcp.mixing_tools import register_tools as _reg_mixing from reaper_mcp.render_tools import register_tools as _reg_render from reaper_mcp.mastering_tools import register_tools as _reg_mastering 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) - src/reaper_mcp/connection.py:27-29 (helper)The get_project() helper function used by get_project_info to obtain a reapy.Project instance, ensuring connection to REAPER first.
def get_project() -> reapy.Project: ensure_connected() return reapy.Project() - The return schema/dict shape for get_project_info containing success, name, path, tempo, time_signature, length, track_count, markers, regions (or error).
return { "success": True, "name": project.name, "path": project.path, "tempo": project.bpm, "time_signature": f"{project.time_signature[0]}/{project.time_signature[1]}", "length": project.length, "track_count": project.n_tracks, "markers": markers, "regions": regions, } except Exception as e: logger.error(f"get_project_info failed: {e}") return {"success": False, "error": str(e)}