Skip to main content
Glama

Typebar (formerly SuperDocs)

export_document

Round-trips the document through the original docx renderer, preserving tables, borders, shading, alternating row colors, headers, footers, fonts, inline styling, and embedded images. Two modes: pass html directly to export ad-hoc content, OR pass session_id to export the session's current state. Format options: 'docx' (default, native Open XML, best for programmatic processing or mail merge), 'pdf', 'html', 'markdown', or 'txt' ('doc' is a legacy Word-compatible HTML alias). Fidelity is the differentiator vs naive HTML to docx converters. When called as an MCP tool, binary formats (docx/pdf/doc) are returned as a short-lived signed download_url in a JSON envelope (fetch it to get the file); text formats (html/markdown/txt) are returned inline.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "export_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlNoHTML content to export inline. Used instead of the session document if provided.
formatNoExport format. One of docx (default), pdf, html, markdown, txt.docx
optionsNoCustomization (paper, margins, filename, watermark, etc.).
filenameNoDEPRECATED. Use options.filename. Top-level kept for legacy callers.
upload_idNoID returned by /v1/uploads (large-document upload flow, for payloads above ~25 MB). When set, the route fetches the HTML body from the uploaded payload instead of using the html field.
session_idNoSession ID to export from (the document is taken from the session). Required if html is omitted.
document_idNoWith html (or upload_id) and session_id: the id of the session's document this HTML is a copy of (the document open in the editor). The export then keeps that document's original Word styles. Optional; ignored when the document has none.
source_filenameNoThe document's original/source filename (e.g. the name it was uploaded under). Used as the default export filename when no explicit options.filename is set, taking precedence over the first heading.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and mostly delivers: it discloses that binary formats (docx/pdf/doc) come back as a short-lived signed download_url in a JSON envelope while html/markdown/txt are returned inline, which is critical non-obvious behavior. It omits auth/prerequisite requirements and any note on whether export mutates or locks the session document.

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?

Front-loaded with the fidelity/preservation claim, then modes, then formats, then return-shape — a sensible ordering with no duplicated schema text. The 'Fidelity is the differentiator vs naive HTML to docx converters' sentence is mildly promotional but does help tool selection, so it mostly earns its place.

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

Completeness4/5

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

For an 8-parameter tool with a nested options object and no output schema, the description covers the return envelope, format list, and both input modes well. The gaps are edge behavior: all parameters are optional yet no error/precedence rule is stated for the 'neither html nor session_id nor upload_id' case, and the large-upload flow is only described inside the schema.

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

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, and the description earns an extra point by clarifying the precedence between the two input modes ("Used instead of the session document if provided" logic restated as 'pass html directly ... OR pass session_id'). Format-mode semantics and the legacy 'doc' alias are also explained beyond the enum listing.

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?

States a specific verb (export) and resource (document) and immediately scopes it: a round-trip through the original docx renderer, with two input modes and a set of output formats. No sibling tool exports documents, so the risk of confusion is low, and the fidelity claim plus format list makes the tool's identity unmistakable.

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

Usage Guidelines4/5

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

Explicitly names the two invocation paths — pass `html` for ad-hoc content or `session_id` to export the session's current state — which is exactly the when-to-use decision an agent faces. It does not, however, address adjacent alternatives (e.g. request_download_url or process_uploaded_document) or say what happens when neither html nor session_id is supplied.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.