Skip to main content
Glama

edit_rule

Update a Karabiner remapping rule by changing only specified parameters such as key codes, modifiers, or app conditions.

Instructions

Edit an existing rule. Updates both the asset file and karabiner.json. Only pass the parameters you want to change.

To see a rule's current configuration, use list_rules first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_ifNoNew app_if bundle IDs. None = keep current. Pass [] to clear.
device_ifNoNew device_if identifiers. None = keep current. Pass [] to clear.
app_unlessNoNew app_unless bundle IDs. None = keep current. Pass [] to clear.
descriptionYesExact description of the rule to edit.
to_key_codeNoNew output key code. None = keep current.
to_modifiersNoNew output modifiers (with to_key_code). None = keep current.
device_unlessNoNew device_unless identifiers. None = keep current. Pass [] to clear.
from_key_codeNoNew trigger key code. None = keep current.
new_descriptionNoNew description. None = keep current.
to_shell_commandNoNew shell command. None = keep current.
from_pointing_buttonNoNew trigger mouse button. None = keep current.
to_if_alone_key_codeNoNew tap key code. None = keep current.
from_optional_modifiersNoNew optional modifiers. None = keep current.
from_mandatory_modifiersNoNew mandatory modifiers. None = keep current.
to_if_held_down_key_codeNoNew hold key code. None = keep current.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of disclosing behavioral traits. It explicitly reveals the side effect of updating both the asset file and karabiner.json, and implies partial update behavior via 'Only pass the parameters you want to change.' It does not cover error handling or reversibility, but the key mutation behavior is transparent.

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?

The description is concise and well-structured, with the primary action stated first, followed by the side effect and a usage tip. It is organized into two short paragraphs, and every sentence adds value without verbosity.

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?

The description provides essential context for a complex mutation tool: its purpose, the files it modifies, the partial-update model, and a recommended pre-step. It does not enumerate all potential constraints, but the schema covers parameter specifics. Overall, it is sufficiently complete for an AI agent to use the tool correctly.

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

Parameters3/5

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

The input schema has 100% description coverage, with each parameter clearly stating 'None = keep current' or 'Pass [] to clear.' The description's general rule about passing only changed parameters reinforces these semantics but does not add per-parameter information. Since schema coverage is high, the baseline of 3 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?

The description states 'Edit an existing rule' with a specific verb and resource, clearly distinguishing it from sibling tools like add_rule, toggle_rule, and remove_rule. It also specifies that it updates both the asset file and karabiner.json, which adds precision to the purpose.

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

Usage Guidelines4/5

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

The description provides a clear usage recommendation: 'To see a rule's current configuration, use list_rules first.' It also instructs to 'Only pass the parameters you want to change,' which operationalizes the tool. It does not explicitly contrast with add_rule or toggle_rule, but the sibling names make this implicit.

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/jason-weddington/karabiner-mcp'

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