Skip to main content
Glama

wpf_set_text

Set the text of WPF UI elements like TextBox or ComboBox using UI Automation or keyboard simulation. Handles different input methods automatically or on demand.

Instructions

Set the text/value of a UI element (TextBox, ComboBox, etc.). By default uses UI Automation IValueProvider.SetValue (clean, no focus needed, raises proper events). Falls back to setting TextBox.Text or PasswordBox.Password directly, or a reflected string 'Text' property. Set physical=true to focus the element and type via OS keyboard input (clears existing text with Ctrl+A/Delete first, then types each character; moves window focus). STATE-CHANGING.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
physicalNo
element_handleYes
Behavior4/5

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

With no annotations provided, the description carries full burden and details behavioral traits: default uses IValueProvider.SetValue (clean, no focus, raises events), fallback to direct property setting, and physical mode's focus, clear, and type behavior. It also declares 'STATE-CHANGING.' Missing details on potential side effects or error conditions, but sufficiently transparent.

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?

The description is information-dense and front-loaded with the primary purpose. It efficiently covers default behavior, fallbacks, and the physical mode in a readable structure. Some minor redundancy could be trimmed, but overall concise.

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 text-setting tool with no output schema, the description covers the main behaviors, fallback mechanism, and physical typing mode. It does not explain return values or error handling, but given the tool's expected behavior, it provides enough context for an agent to use it correctly.

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 0%, so the description must compensate. It explains the 'text' parameter as the value to set, 'physical' as a boolean for OS keyboard input, and 'element_handle' by context as the target element. While element_handle is not explicitly defined, the purpose is clear. The description adds meaning beyond the bare schema.

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 clearly states the tool sets text/value of UI elements like TextBox and ComboBox, naming the primary method (IValueProvider.SetValue) and fallbacks. It distinguishes itself from sibling tools focusing on clicking, selecting, or sending keys.

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 explains when to use the default mode vs physical=true (focused typing), providing clear context for choosing between them. However, it does not explicitly contrast with sibling tools like wpf_send_keys or wpf_set_property, leaving some ambiguity about when to prefer this tool over alternatives.

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/faze79/WPFVisualTreeMcp'

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