Skip to main content
Glama

insert_midi_event

Insert MIDI control, pitch-bend, or program-change events into REAPER projects to automate parameters and modify instrument settings during music production.

Instructions

Insert a MIDI CC, pitch-bend, or program-change event into a MIDI item.

  • event_type: 'cc' | 'pitch_bend' | 'program_change'

  • ppq: position in PPQ ticks

  • channel: 0-15

  • cc: provide cc_number (0-127) and value (0-127)

  • pitch_bend: provide bend (-8192 to 8191, 0 = center)

  • program_change: provide program (0-127)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
track_indexYes
item_indexYes
event_typeYes
ppqYes
channelNo
cc_numberNo
valueNo
bendNo
programNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the insert_midi_event logic in the Reaper adapter, which calls the underlying client.
    def insert_midi_event(
        self,
        track_index: int,
        item_index: int,
        event_type: str,
        ppq: int,
        channel: int = 0,
        cc_number: int | None = None,
        value: int | None = None,
        bend: int | None = None,
        program: int | None = None,
    ) -> dict[str, Any]:
        return self._client.call(
            "insert_midi_event",
            track_index=track_index,
            item_index=item_index,
            event_type=event_type,
            ppq=ppq,
            channel=channel,
            cc_number=cc_number,
            value=value,
            bend=bend,
            program=program,
        )
  • The MCP tool registration for insert_midi_event in the server, which maps the request to the adapter.
    @mcp.tool()
    def insert_midi_event(
        track_index: int,
        item_index: int,
        event_type: str,
        ppq: int,
        channel: int = 0,
        cc_number: int | None = None,
        value: int | None = None,
        bend: int | None = None,
        program: int | None = None,
    ) -> dict[str, Any]:
        """
        Insert a MIDI CC, pitch-bend, or program-change event into a MIDI item.
        - event_type: 'cc' | 'pitch_bend' | 'program_change'
        - ppq: position in PPQ ticks
        - channel: 0-15
        - cc: provide cc_number (0-127) and value (0-127)
        - pitch_bend: provide bend (-8192 to 8191, 0 = center)
        - program_change: provide program (0-127)
        """
        try:
            return _wrap(
                adapter.insert_midi_event(
Behavior3/5

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

No annotations provided, so description carries full burden. Documents parameter constraints (ranges like 0-127, -8192 to 8191) but lacks critical behavioral details: side effects, whether events are overwritten, failure modes, or what the output schema contains.

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?

Efficient bullet-point structure front-loaded with the core purpose. Parameter documentation is necessary given schema lacks descriptions. No redundant text, though parameter docs in description are unconventional.

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

Completeness4/5

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

Handles 9-parameter complexity and conditional logic (different fields per event_type) effectively. Since output schema exists, description needn't explain returns. Lacks only prerequisite context (how to obtain indices).

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 has 0% description coverage (only titles). Description compensates well by documenting valid enum values for event_type, explaining PPQ semantics, and specifying conditional parameter requirements (cc/value vs bend vs program). Minor gap: track_index and item_index semantics not explained.

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?

Specific verb 'Insert' + specific resource 'MIDI CC, pitch-bend, or program-change event' + target 'into a MIDI item'. Distinguishes from siblings like set_midi_note (handles note events) and insert_audio_file by specifying event types.

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?

Lists applicable event types (CC, pitch-bend, program-change) but provides no explicit when-to-use guidance, prerequisites (e.g., item must exist), or contrast with alternatives like set_midi_note or insert_envelope_point.

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/danielkinahan/ReaMCP'

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