Skip to main content
Glama

tc_window

Control the 1C:Enterprise client window for automated testing: activate or close windows, answer dialogs, execute commands, navigate pages, and read user messages or command interfaces.

Instructions

Actions on the client application window. Also available: tc_field(action="is_visible"), tc_field(action="is_enabled"), tc_field(action="get_context_menu"), tc_app(action="get_parent").

  • marks a required action parameter; the group schema treats action parameters as optional. Pass action="name" and only that action's parameters. Actions:

  • activate_window() Activate the current active window. (1C 8.3.3+)

  • answer_dialog(confirm=True, timeout=5) Wait up to timeout seconds and answer a modal question: confirm=true presses Button0, false Button1. Never presses Button2; inspect the question/window for other choices. Returns answered='Да'/'Нет' and question; both null means no dialog, question alone null means unreadable text. (1C 8.3.3+)

  • choose_user_message(text*) Click the first user message matching text in the active window; * and ? are wildcards. Use get_user_message_texts to read the available messages first. (1C 8.3.3+)

  • close_user_messages_panel() Close the window's user-messages panel. This is also how you tell which messages belong to which action: clear the panel, perform the action, then read the messages. (1C 8.3.6+)

  • close_window(ref=null) Close the window at ref, or the active window if omitted. Returns closed only after verifying that the window disappeared. If it remains open, returns window_not_closed and target; inspect the form or answer its dialog before retrying. Also closes an active local print preview when ref is omitted. (1C 8.3.3+)

  • execute_command(command*) Open a navigation link, e.g. 'e1cib/list/Справочник.Контрагенты', 'e1cib/app/Обработка.Имя' or a URL returned by the command interface. For a button name or title, find it and use click. Returns the resulting window; window_changed=false reuses the previous window description. An opened error window is a failure. (1C 8.3.3+)

  • get_command_interface() Get the window's command interface → collection of buttons/groups. (1C 8.3.3+)

  • get_user_message_texts() Get the user-message texts currently shown in the window → list of strings. They may include earlier actions; the application can also replace the list with identical messages. To judge one action, call tc_window(action="close_user_messages_panel") first, then the action, then this. Messages may appear after the action returns. (1C 8.3.3+)

  • goto_next_window() Go to the next open window from the active main application window. The client returns an error if navigation is unavailable. (1C 8.3.6+)

  • goto_previous_window() Go to the previous open window from the active main application window. The client returns an error if navigation is unavailable. (1C 8.3.6+)

  • goto_start_page() Go to the start page from the active main application window. The client returns an error if navigation is unavailable. (1C 8.3.6+) ref selects the client; otherwise set connection_id when several clients are connected. Use tc_session(action="list_connections"). Success may omit target/connection echoes and shorten window details. Use returned references unchanged in ref; re-find expired elements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNo
textNo
actionYes
commandNo
confirmNo
timeoutNo
connection_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.7.1
    • addedInput schema / properties / ref
      Added value: +{
      +  "default": null,
      +  "title": "Ref",
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv1.5.0
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "activate_window",
      -  "answer_dialog",
      -  "close_user_messages_panel",
      -  "close_window",
      -  "execute_command",
      -  "get_command_interface",
      -  "get_user_message_texts",
      -  "goto_next_window",
      -  "goto_previous_window",
      -  "goto_start_page"
      -]New value: +[
      +  "activate_window",
      +  "answer_dialog",
      +  "choose_user_message",
      +  "close_user_messages_panel",
      +  "close_window",
      +  "execute_command",
      +  "get_command_interface",
      +  "get_user_message_texts",
      +  "goto_next_window",
      +  "goto_previous_window",
      +  "goto_start_page"
      +]
    • addedInput schema / properties / text
      Added value: +{
      +  "default": null,
      +  "title": "Text",
      +  "type": "string"
      +}
  3. First observedv1.0.0

TDQS

A5/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full behavioral burden, and it does so thoroughly. It discloses return values for answer_dialog, close_window, and execute_command; failure conditions such as window_not_closed and opened error windows; timeout behavior; dialog button mapping; wildcard matching; and caveats about omitted return values and expired references. This is unusually rich behavioral context for a mutation-capable tool.

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 long, but the length is justified by the 11-action dispatcher and each action's distinct parameters and return behavior. It is front-loaded with the tool's scope and sibling alternatives, then moves into structured action definitions. Version notes and usage caveats are compact and earn their place.

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

Completeness5/5

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

With no annotations, no output schema, seven parameters, and zero schema description coverage, this description is complete enough for an agent to call the tool correctly. It covers action selection, parameter usage, alternative tools, return semantics, failure modes, and connection targeting. Nothing essential for correct invocation appears to be missing.

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

Parameters5/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, and it does. It explains that action is required and action-specific parameters are passed by name; documents ref and connection_id selection; describes text wildcards; gives command examples; explains confirm and timeout semantics for answer_dialog; and notes the default timeout value. Every parameter is given meaning beyond the bare JSON 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 states that this tool performs actions on the client application window and then enumerates each action with a specific verb and resource, such as activate_window, close_window, execute_command, and answer_dialog. It also distinguishes the tool from siblings by listing related actions available through tc_field, tc_app, etc. An agent can select the correct action without opening another tool.

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

Usage Guidelines5/5

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

The description gives explicit sequencing and alternatives: use get_user_message_texts before choose_user_message, use close_user_messages_panel to isolate messages from one action, use click for button names instead of execute_command, and use tc_session(action="list_connections") when multiple clients are connected. It also explains ref vs connection_id selection. These are concrete when-to-use and when-to-use-alternative instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.