Skip to main content
Glama
SaloQT

imgui-mcp

by SaloQT

imgui_add_hit_region

Add invisible interactive hit regions to Dear ImGui windows to detect hover, click, drag, double-click, and wheel events. Define shapes as rect, circle, ellipse, or polygon for flexible input capture.

Instructions

Add an interactive hit region to a window. Hit regions are invisible shapes that detect mouse hover, click, drag, double-click, and wheel events. Use with imgui_get_canvas_events to read interactions. Shapes: rect, circle, ellipse, polygon.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUnique hit region identifier
p1NoRect: min corner [x,y]. Circle/Ellipse: center [x,y]
p2NoRect: max corner [x,y]. Circle: [radius, 0]. Ellipse: [rx, ry]
shapeYesHit region shape type
pointsNoPolygon vertices as [[x,y], ...] (for polygon shape)
windowYesTarget window id
transformNoTransform applied to the hit region shape
draw_layerNoOptional associated draw layer widget id
interactionsNoEnabled interaction types (default: hover + click)
Behavior2/5

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

No annotations are provided, so the description carries full behavioral disclosure burden. It states hit regions are invisible and detect listed events, which is helpful, but it does not disclose mutation implications, whether adding a hit region requires a parent window to already exist, layering/ordering behavior among overlapping regions, or whether coordinates are window-local vs global. For a mutation tool with zero annotation coverage this is a notable gap.

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?

Three sentences, efficient and front-loaded with the core purpose. The shape and interaction lists add value without redundancy. Slightly more could be said about coordinate systems or prerequisites, but as written it is compact and non-wasteful.

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?

For a tool with 9 parameters, a 100%-coverage schema, and rich enum/nested-object definitions, the description reasonably covers the main behavioral points: invisible interaction detection, the companion read function, and the supported shapes. The main omissions are coordinate space semantics and prerequisite constraints (window existence), but given the schema's strength and the 4 straightforward shape params, the description is moderately complete.

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?

Schema coverage is 100%, so the schema documents all 9 parameters well, including per-shape meaning of p1/p2 and the interaction enum. The description adds the interaction-type list and shape set, but these are largely restated from the schema enum and field descriptions. It adds modest value (default interactions, 'detects wheel/drag/double-click') beyond the schema baseline.

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?

Defines a specific verb+resource ('Add an interactive hit region'), lists supported shapes explicitly, and distinguishes the tool from siblings by naming the companion reading function (imgui_get_canvas_events) and sibling mutation tools (imgui_update_hit_region, imgui_remove_hit_region). The scope is clear and unique.

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

Usage Guidelines3/5

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

The description states it pairs with imgui_get_canvas_events for reading interactions, which gives usage context. However, it does not contrast against the sibling hit-region tools (update/remove) or clarify when to choose this over imgui_click_widget, nor does it mention required companion steps like creating a window first.

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/SaloQT/imgui-mcp'

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