Skip to main content
Glama
SaloQT

imgui-mcp

by SaloQT

imgui_set_callback

Set declarative callback actions that fire automatically on widget events such as clicks, changes, or hovers. Trigger visibility toggles, value updates, or scene switches without polling round-trips.

Instructions

Set a declarative callback action that fires automatically when a widget event occurs. Actions: toggle_visibility, set_visibility, set_value, switch_scene. No polling round-trip needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform
paramsNoAction parameters. toggle_visibility/set_visibility: {"widget": "id", "visible": true}. set_value: {"widget": "id", "value": 0.5}. switch_scene: {"scene": "name"}.
windowYesWindow containing the trigger widget
trigger_eventNoEvent that fires the action (default: clicked)
trigger_widgetYesWidget id that triggers the action
Behavior3/5

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

With no annotations provided, the description carries the full disclosure burden. It explains the tool registers a declarative callback (side-effect: registering a handler) and lists supported actions, but doesn't disclose whether callbacks can be removed (imgui_remove_callback exists as sibling), whether multiple callbacks on the same widget can stack or overwrite, or what happens on unload/clear_all. It does provide the 'no polling round-trip' performance framing which is useful context.

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?

Two sentences with zero waste. The description is front-loaded with the core purpose, then lists actions and adds the performance benefit. It's appropriately short given the schema already documents parameters. Minor miss: it doesn't mention trigger_event or that params/trigger_event are optional, but that's covered in the schema.

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

Completeness3/5

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

The tool has 5 parameters (3 required), no output schema, and 2 enums — moderate complexity. The description plus 100% schema coverage covers the core usage well. However, for a tool with side-effect behavior (registering persistent callbacks) and no output schema, the description doesn't fully address what happens on invocation (immediate effect? just registration?), callback lifecycle, or interaction with imgui_remove_callback. There's decent coverage but meaningful gaps remain for a stateful registration API.

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 description coverage is 100%, so the schema documents all parameters. However, the description adds meaningful semantic value by explaining the declarative action model and summarizing the action→params mapping ('toggle_visibility/set_visibility: {"widget", "visible": true}...'). The trigger_event default (clicked) is noted in the schema. The nested params object semantics are reasonably explained, though the description could clarify that trigger_event and params are optional.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Set a declarative callback action that fires automatically when a widget event occurs' — a specific verb+resource with clear scope. It lists the four action types, distinguishing it from related sibling tools like imgui_remove_callback and imgui_bind. However, it doesn't explicitly contrast with siblings like imgui_bind/unbind or imgui_get_canvas_events, leaving some ambiguity about the 'declarative' nature relative to event polling.

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 conveys that this is for declarative callbacks that fire automatically, contrasting with 'no polling round-trip needed' — implying an alternative to manual event polling. However, it doesn't explicitly name alternative tools or state when NOT to use this tool. The context (vs imgui_bind, imgui_remove_callback) is implied but never made explicit.

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