Word documentation

Deckary Word AI agent tool reference

Reference the reading, writing, formatting, review, and run-control operations used by Deckary's Word AI agent.

Last verified: 2026-09-04

Deckary's Word AI agent uses a closed set of document tools plus shared run-control tools. The model chooses an operation, but the Word add-in resolves the live selection or target, enforces destructive-edit policy, performs the Word JavaScript API call, and returns host-observed evidence.

Read tools#

ToolPurpose
read_selectionRead the current Word selection and its fingerprint
read_document_summaryRead a bounded summary of the active document
read_paragraphsRead bounded paragraphs and create current target references
search_doc_textFind text occurrences and return current targets
read_doc_sectionRead a section and expose paragraph or section references

Search and read results authorize later targeted work. A dependent target write must wait until the agent has observed the returned references.

Write tools#

ToolPurpose
edit_doc_textPerform a unique mechanical document find-and-replace
apply_doc_editsApply a preflighted batch of exact target replacements
replace_selectionReplace the current selection with one plain-text paragraph
insert_textInsert plain text at the verified current selection or cursor
insert_blocksInsert native headings, paragraphs, or list items
replace_selection_with_blocksReplace selected whole paragraphs with native structured blocks
apply_styleApply a built-in Word style
apply_text_formatFormat selected or targeted text with optional paragraph-role filters
add_commentAdd a Word comment to a verified target

Destructive selection and target replacements may require allow_destructive_edit. That flag is supplied only after the user approves the pending operation; it is not a general permission to rewrite the document.

Review tool#

verify_doc_structure checks supported document-structure conditions in the Word host. The current tool accepts document scope; unsupported selection, recent-mutation, or target-reference scopes are rejected instead of being approximated.

Shared run tools#

ToolPurpose
ask_userAsk for a decision required to continue safely
resolve_pendingResume or resolve a pending approved operation
finish_runClose the run only after required outcomes and evidence are settled

The shared Office run treats conversation text as context, not proof that a document changed. A mutation must have a host-observed artifact before finish_run can support a completion claim.

See Editing and review for workflow examples.