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.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | None |
sessionId | string | No | DEPRECATED: session ids are server-minted (sess_<uuid>); omit sessionId and use the returned id. |
summaryOnly | boolean | No | None |
allowMacros | boolean | No | None |
stripMacros | boolean | No | None |
author | string | No | None |
new_document
Create a blank report or memo.
| Parameter | Type | Required | Description |
|---|---|---|---|
outPath | string | Yes | None |
template | string | No | None |
force | boolean | No | None |
styleGuide | string | No | None |
author | string | No | None |
sessionId | string | No | DEPRECATED: 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
outPath | string | No | None |
message | string | No | None |
author | string | No | None |
allowMacros | boolean | No | None |
stripMacros | boolean | No | None |
close_document
Release a session.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
Read
Look at a document without changing it.
inspect_document
Read the document as compact rows with node IDs and styles.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
fidelity | string | No | None |
sectionId | string | No | None |
maxTextLength | integer | No | None |
offset | integer | No | None |
limit | integer | No | None |
aroundNode | string | No | None |
window | integer | No | None |
maxTokens | integer | No | None |
search_content
Find text and get back the node IDs that contain it.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
query | string | Yes | None |
regex | boolean | No | None |
get_stats
Word, paragraph, table and image counts, cheaply.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
visual_inspect
Render pages so the agent can check its own layout.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
pages | array | No | None |
withVisual | boolean | No | None |
format | string | No | None |
jpegQuality | integer | No | None |
dpi | integer | No | None |
outputDir | string | No | None |
Change
Edit the document in the session. Nothing reaches disk until save_document.
execute_batch
Apply up to 500 typed operations, all or nothing.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
operations | array | Yes | None |
sequential | boolean | No | None |
rollbackOnError | boolean | No | None |
maxSteps | integer | No | None |
allowedDir | string | No | None |
styleGuide | string | No | None |
compose_document
Build a whole document from Markdown, with charts, tables and callouts.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
markdown | string | Yes | None |
allowedDir | string | No | None |
template | string | No | None |
styleGuide | string | No | None |
dollarMath | boolean | No | None |
import_document
Bring a Markdown file on disk into the open session.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
path | string | Yes | None |
allowedDir | string | No | None |
template | string | No | None |
styleGuide | string | No | None |
dollarMath | boolean | No | None |
normalize_document
Repair known structural problems, then re-validate.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
sanitize_document
Strip authors, comments, revisions, metadata and personal data.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
zeroRetention | boolean | No | None |
purgeRSIDs | boolean | No | None |
purgeAuthors | boolean | No | None |
purgeExif | boolean | No | None |
purgePII | boolean | No | None |
acceptAllRevisions | boolean | No | None |
stripComments | boolean | No | None |
replacementAuthor | string | No | None |
allowMacros | boolean | No | None |
stripMacros | boolean | No | None |
Check and export
Validate the document or write it out in another format.
validate_document
Run the save-time checks without writing anything.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
export_document
Export to HTML, Markdown or PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | Active document session ID returned by open_document |
format | string | Yes | Target export format: "html", "markdown", "md", or "pdf" |
outPath | string | No | Optional output destination path (must reside inside allowed directory) |
tagged_pdf | boolean | No | PDF only: tagged (accessible) render (default true) |
tagged | boolean | No | Alias of tagged_pdf |
strict | boolean | No | PDF 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
limit | integer | No | None |
offset | integer | No | None |
preview_revert
See what a revert would change before doing it.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
steps | integer | No | None |
commitOid | string | No | None |
revert_document
Restore an earlier saved revision as a new one.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
steps | integer | No | None |
commitOid | string | No | None |
discardUnsaved | boolean | No | None |
message | string | No | None |
author | string | No | None |
reason | string | No | None |
redo_document
Re-apply a revision that was reverted.
| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | None |
message | string | No | None |
author | string | No | None |
reason | string | No | None |