Skip to content
ASTra

MCP tools

The ASTra MCP server gives your agent 19 tools. They are listed here in the order an agent uses them. This page is generated from the running server, so the names and parameters are always current.

Typical flow: open_document → inspect_document → search_content (optional) → execute_batch → save_document → close_document. For full examples of inputs and outputs, see the MCP Specification.

Open, create and save

Every job starts by opening or creating a document and ends by saving it.

open_document

Open a .docx into a session and get a session ID.

ParameterTypeRequiredDescription
pathstringYesNone
sessionIdstringNoDEPRECATED: session ids are server-minted (sess_<uuid>); omit sessionId and use the returned id.
summaryOnlybooleanNoNone
allowMacrosbooleanNoNone
stripMacrosbooleanNoNone
authorstringNoNone

new_document

Create a blank report or memo.

ParameterTypeRequiredDescription
outPathstringYesNone
templatestringNoNone
forcebooleanNoNone
styleGuidestringNoNone
authorstringNoNone
sessionIdstringNoDEPRECATED: session ids are server-minted (sess_<uuid>); omit sessionId and use the returned id.

save_document

Validate, then write the file. A broken package is refused with a remedy.

ParameterTypeRequiredDescription
sessionIdstringYesNone
outPathstringNoNone
messagestringNoNone
authorstringNoNone
allowMacrosbooleanNoNone
stripMacrosbooleanNoNone

close_document

Release a session.

ParameterTypeRequiredDescription
sessionIdstringYesNone

Read

Look at a document without changing it.

inspect_document

Read the document as compact rows with node IDs and styles.

ParameterTypeRequiredDescription
sessionIdstringYesNone
fidelitystringNoNone
sectionIdstringNoNone
maxTextLengthintegerNoNone
offsetintegerNoNone
limitintegerNoNone
aroundNodestringNoNone
windowintegerNoNone
maxTokensintegerNoNone

search_content

Find text and get back the node IDs that contain it.

ParameterTypeRequiredDescription
sessionIdstringYesNone
querystringYesNone
regexbooleanNoNone

get_stats

Word, paragraph, table and image counts, cheaply.

ParameterTypeRequiredDescription
sessionIdstringYesNone

visual_inspect

Render pages so the agent can check its own layout.

ParameterTypeRequiredDescription
sessionIdstringYesNone
pagesarrayNoNone
withVisualbooleanNoNone
formatstringNoNone
jpegQualityintegerNoNone
dpiintegerNoNone
outputDirstringNoNone

Change

Edit the document in the session. Nothing reaches disk until save_document.

execute_batch

Apply up to 500 typed operations, all or nothing.

ParameterTypeRequiredDescription
sessionIdstringYesNone
operationsarrayYesNone
sequentialbooleanNoNone
rollbackOnErrorbooleanNoNone
maxStepsintegerNoNone
allowedDirstringNoNone
styleGuidestringNoNone

compose_document

Build a whole document from Markdown, with charts, tables and callouts.

ParameterTypeRequiredDescription
sessionIdstringYesNone
markdownstringYesNone
allowedDirstringNoNone
templatestringNoNone
styleGuidestringNoNone
dollarMathbooleanNoNone

import_document

Bring a Markdown file on disk into the open session.

ParameterTypeRequiredDescription
sessionIdstringYesNone
pathstringYesNone
allowedDirstringNoNone
templatestringNoNone
styleGuidestringNoNone
dollarMathbooleanNoNone

normalize_document

Repair known structural problems, then re-validate.

ParameterTypeRequiredDescription
sessionIdstringYesNone

sanitize_document

Strip authors, comments, revisions, metadata and personal data.

ParameterTypeRequiredDescription
sessionIdstringYesNone
zeroRetentionbooleanNoNone
purgeRSIDsbooleanNoNone
purgeAuthorsbooleanNoNone
purgeExifbooleanNoNone
purgePIIbooleanNoNone
acceptAllRevisionsbooleanNoNone
stripCommentsbooleanNoNone
replacementAuthorstringNoNone
allowMacrosbooleanNoNone
stripMacrosbooleanNoNone

Check and export

Validate the document or write it out in another format.

validate_document

Run the save-time checks without writing anything.

ParameterTypeRequiredDescription
sessionIdstringYesNone

export_document

Export to HTML, Markdown or PDF.

ParameterTypeRequiredDescription
sessionIdstringYesActive document session ID returned by open_document
formatstringYesTarget export format: "html", "markdown", "md", or "pdf"
outPathstringNoOptional output destination path (must reside inside allowed directory)
tagged_pdfbooleanNoPDF only: tagged (accessible) render (default true)
taggedbooleanNoAlias of tagged_pdf
strictbooleanNoPDF only: fail closed on preflight blockers (default false, warn-only)

History

Go back to an earlier saved revision and forward again.

get_document_history

List saved revisions, newest first.

ParameterTypeRequiredDescription
sessionIdstringYesNone
limitintegerNoNone
offsetintegerNoNone

preview_revert

See what a revert would change before doing it.

ParameterTypeRequiredDescription
sessionIdstringYesNone
stepsintegerNoNone
commitOidstringNoNone

revert_document

Restore an earlier saved revision as a new one.

ParameterTypeRequiredDescription
sessionIdstringYesNone
stepsintegerNoNone
commitOidstringNoNone
discardUnsavedbooleanNoNone
messagestringNoNone
authorstringNoNone
reasonstringNoNone

redo_document

Re-apply a revision that was reverted.

ParameterTypeRequiredDescription
sessionIdstringYesNone
messagestringNoNone
authorstringNoNone
reasonstringNoNone