Skip to main content
Glama

tc_doc

Read, edit, find text, click hyperlinks, and save 1C document fields and spreadsheet areas for automated testing.

Instructions

Actions on document fields and spreadsheet areas. Choose action. 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. ok=true means accepted; verify effects by reading state. target_check: present, unknown (uncheckable), off (disabled); present does not prove an effect. target_hidden=true means the target exists but is invisible; it describes the element, not its ancestors. Its absence says nothing; hidden targets may still act (e.g. activate). Invalid addresses are rejected only where the address can be checked; an unverified empty read may mean a missing target. failure_context describes state/editor/choices; its complete=false means incomplete diagnostics. Actions:

  • begin_edit_current_area(ref*) Start editing the current spreadsheet area; follow with input_text and end_edit_current_area. In view mode this can instead open a drill-down menu, object or field chooser. A menu may leave the active window unchanged; use execute_choice_from_menu to continue.

  • click_formatted_doc_hyperlink(ref*, index*) Click a hyperlink in a formatted-document field by 0-based index (or by its text). On a document without links the platform answers the same and puts up its own error window, and tc_doc(action="get_formatted_string_hyperlinks") cannot be used to check first: for a formatted DOCUMENT it answers with an empty list even when the document does have a link (it lists links only for a formatted-string label). Judge by what the click was supposed to do. (1C 8.3.25+)

  • click_formatted_string_hyperlink(ref*, index*) Click a hyperlink in a formatted string by 0-based index (or by its text). ref may be a label field or a form decoration bearing the formatted string. (1C 8.3.13+)

  • click_html_hyperlink(ref*, index*) Click an HTML link. The platform may open the FIRST link regardless of an in-range index; out-of-range indexes fail. text has no effect. Verify the resulting navigation. (1C 8.3.25+)

  • end_edit_current_area(ref*, cancel=False) Finish editing the current spreadsheet-document area. Set cancel to discard the edit instead of committing it. Returns the cell address and its text before/after finishing; changed compares those values, including when an edit is cancelled.

  • find_text(ref*, text*, match='contains', case_sensitive=False, area=null, start_address=null, max_cells=1000) Find literal spreadsheet text (match=contains/exact, case-insensitive by default); return cell addresses/text without moving the current area. area restricts a cell/rectangle (8.3.25+). max_cells=1..10000 limits scanned positions, not matches. If complete=false, resume with start_address=next_address and unchanged text/match/case_sensitive/area. Empty matches proves absence only in the successfully scanned part. (1C 8.3.13+)

  • get_area_text(ref*, area=null) Get the text of ONE spreadsheet-document area; omit area to read the current one. tc_doc(action="get_current_area_text") is the older form of this same call and answers identically; prefer this one. (1C 8.3.6+)

  • get_current_area_address(ref*) Get the address of the current spreadsheet-document area.

  • get_current_area_field(ref*) Get the field of the current spreadsheet-document area. (1C 8.3.2+)

  • get_current_area_text(ref*, area=null) Get the text of ONE spreadsheet-document area; omit area to read the current one. This is the older form of tc_doc(action="get_area_text"), which the platform deprecated in 8.3.6 in favour of that one; prefer get_area_text.

  • get_doc_area_horizontal_size(ref*) Get the horizontal size (max column number holding data) of a spreadsheet-document. (1C 8.3.13+)

  • get_doc_area_vertical_size(ref*) Get the vertical size (max row number holding data) of a spreadsheet-document. (1C 8.3.13+)

  • get_formatted_string_hyperlinks(ref*) Get a formatted string's hyperlink presentations. (1C 8.3.25+)

  • get_html(ref*) Read the HTML of a formatted/HTML-document field. After the form has put up a menu or a modal choice list, the platform stops returning this field's content until it is written again — an empty answer right after such a window does not mean the field is empty. (1C 8.3.8+)

  • included_in_merged_area(ref*, address*) Return the address of the merged area containing the cell (e.g. 'R1C1'), or None if the cell is not part of a merged area. A null answer is ambiguous in one more way: it also comes back when the document has no such cell or no area by that name — the platform does not distinguish the two, and neither can this action. Only the FORM of the address is checked here (cell, range, area name, intersection); whether it exists is up to the document. (1C 8.3.25+)

  • input_html(ref*, html*, attachments=null) Set HTML/text into a formatted-document field. attachments maps an image name used in the HTML (e.g. -> "p1") to that image as a base64 string; src must exactly match the attachment name. Names must be identifiers (no dots). (1C 8.3.8+)

  • read_document(ref*, start_address=null, max_cells=1000, area=null) Read nonempty spreadsheet cells as rows with cell addresses and merged-cell spans. Optional area is a rectangle such as R2C3:R8C5 (platform 8.3.25+), clipped to the document's data bounds. Intersecting merged cells retain their full address/span, even if they start outside area. If complete=false, pass next_address as start_address with the same area to continue. max_cells limits positions scanned per call (1–10000). Does not move the current area.

  • set_area_text(ref*, address*, text*) Set a spreadsheet cell's text by address, e.g. R2C1. Selects the cell, starts and finishes editing, then reads the result. Empty text clears it. Returns verified, changed and value_before/value_after. Numeric formatting can return verified=null with verification=numeric_equivalent. Rounded output returns value_verification_inconclusive: editing finished, but the exact value is not verified. Requires an editable document.

  • set_current_area(ref*, address*) Set the current area of a spreadsheet-document field (e.g. 'R1C1').

  • text_within_area_bounds(ref*, area=null) Whether the text in a spreadsheet-document area fits within its bounds (True) or is clipped to '#####' (False). Pass area (e.g. 'R1C1'); omit to check the current cell. (1C 8.3.25+)

  • write_content_to_file(ref*, filename=null, file_format=null, filter_index=null, save_as=null) Save HTML/formatted/spreadsheet/text fields (not PDF fields). filename forces Save As, replacing and finally clearing pending dialog answers on 8.3.25+; older versions cannot clear unused answers, so prepare only the next dialog. Spreadsheet file_format: mxl/html/pdf/xls/xlsx/ods/docx; extension alone does not select it. Alternatively use 0-based filter_index; mutually exclusive with file_format, omitted: first type. Without filename, use current name unless save_as=true; predefine possible dialogs before EACH call with tc_app(action="set_file_dialog_result"). ok confirms accepted requests, not completed disk writing. Final cleanup failure separately returns cleanup_error and dialog_answer_cleared=false; the next filename call retries cleanup before saving. (1C 8.3.8+) 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
areaNo
htmlNo
textNo
indexNo
matchNo
actionYes
cancelNo
addressNo
save_asNo
filenameNo
max_cellsNo
attachmentsNo
file_formatNo
filter_indexNo
connection_idNo
start_addressNo
case_sensitiveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.4.0
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "begin_edit_current_area",
      -  "click_formatted_doc_hyperlink",
      -  "click_formatted_string_hyperlink",
      -  "click_html_hyperlink",
      -  "end_edit_current_area",
      -  "get_area_text",
      -  "get_current_area_address",
      -  "get_current_area_field",
      -  "get_current_area_text",
      -  "get_doc_area_horizontal_size",
      -  "get_doc_area_vertical_size",
      -  "get_formatted_string_hyperlinks",
      -  "get_html",
      -  "included_in_merged_area",
      -  "input_html",
      -  "read_document",
      -  "set_area_text",
      -  "set_current_area",
      -  "text_within_area_bounds",
      -  "write_content_to_file"
      -]New value: +[
      +  "begin_edit_current_area",
      +  "click_formatted_doc_hyperlink",
      +  "click_formatted_string_hyperlink",
      +  "click_html_hyperlink",
      +  "end_edit_current_area",
      +  "find_text",
      +  "get_area_text",
      +  "get_current_area_address",
      +  "get_current_area_field",
      +  "get_current_area_text",
      +  "get_doc_area_horizontal_size",
      +  "get_doc_area_vertical_size",
      +  "get_formatted_string_hyperlinks",
      +  "get_html",
      +  "included_in_merged_area",
      +  "input_html",
      +  "read_document",
      +  "set_area_text",
      +  "set_current_area",
      +  "text_within_area_bounds",
      +  "write_content_to_file"
      +]
    • addedInput schema / properties / case_sensitive
      Added value: +{
      +  "default": null,
      +  "title": "Case Sensitive",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / match
      Added value: +{
      +  "default": null,
      +  "enum": [
      +    "contains",
      +    "exact"
      +  ],
      +  "title": "Match",
      +  "type": "string"
      +}
  2. First observedv1.0.0

TDQS

A4.3/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 does so extensively. It discloses verification semantics for ok=true, target_check states, target_hidden behavior, incomplete failure_context, invalid-address checking limits, and action-specific caveats for hyperlink clicks, edits, document reads, and file saving.

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 long and dense, but the tool supports 21 actions with many platform-specific caveats, so much of the length is earned. Structure is front-loaded with purpose and global rules before the action list, though some verbosity could be trimmed without losing essential information.

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?

Given no annotations, no output schema, 18 parameters, and 21 actions, the description is remarkably complete. It documents mutation behavior, return values for several actions, continuation semantics, deprecation alternatives, and error/verification caveats that an agent would otherwise have to guess.

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 for 18 parameters. It explains each parameter in context: ref, area, html, text, index, match, action, cancel, address, save_as, filename, max_cells, attachments, file_format, filter_index, connection_id, start_address, and case_sensitive all receive concrete meaning, examples, or constraints.

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 opening sentence states a specific verb+resource domain: actions on document fields and spreadsheet areas, with a dispatcher action parameter. It lists all supported actions, so the agent knows exactly what the tool can do, though it does not sharply distinguish the umbrella boundary from siblings such as tc_field and tc_table.

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 gives per-action guidance such as following begin_edit_current_area with input_text and end_edit_current_area, preferring get_area_text over the deprecated get_current_area_text, and using tc_session to list connections. It also notes sibling alternatives like tc_field and tc_app actions. However, there is no explicit general rule for when to choose tc_doc over siblings such as tc_field or tc_table, so usage guidance remains implied rather than decisive.

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