Skip to main content
Glama

styleset_export

Export a document's style definitions as JSON to copy its look to another .docx via styleset.install; optionally save to a file without overwriting.

Instructions

Export the document's style definitions (all, the styles named, or custom_only) as a JSON style set, returned and also written to out when given (never overwrites an existing file). Feed it to styleset.install on another document to copy the look; styleset.export_dotx writes a Word template instead. The document is not changed.

Input Schema

NameRequiredDescriptionDefault
docYesPath to the .docx.
outNoAlso write the JSON here.
nameNoSet name.
stylesNoOnly these styles (ids or names).
custom_onlyNoOnly user-defined styles.

Output Schema

NameRequiredDescriptionDefault
okYesAlways true on success.
opYesThe operation that ran.
apiYesAPI version (1.0).
docNoThe document read or written: path, sha256 and paragraph count.
nextYesCursor for the next page (pass as cursor), or null.
resultYesWhat the operation returns.
warningsYesThings to know about the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.2
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "api": {
      +      "description": "API version (1.0).",
      +      "type": "string"
      +    },
      +    "doc": {
      +      "description": "The document read or written: path, sha256 and paragraph count.",
      +      "properties": {
      +        "characters": {
      +          "description": "text.normalize of a text string: its length.",
      +          "type": "integer"
      +        },
      +        "paragraphs": {
      +          "description": "Body paragraphs.",
      +          "type": "integer"
      +        },
      +        "path": {
      +          "description": "Path of the document.",
      +          "type": "string"
      +        },
      +        "sha256": {
      +          "description": "sha256 of the file (pass as expect.sha256 to a write).",
      +          "type": "string"
      +        },
      +        "source": {
      +          "description": "A .txt/.md/.odt source's format, encoding and split mode; \"text\" for a text string (text.normalize).",
      +          "type": [
      +            "object",
      +            "string"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "next": {
      +      "description": "Cursor for the next page (pass as cursor), or null.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "ok": {
      +      "description": "Always true on success.",
      +      "type": "boolean"
      +    },
      +    "op": {
      +      "description": "The operation that ran.",
      +      "type": "string"
      +    },
      +    "result": {
      +      "description": "What the operation returns.",
      +      "properties": {
      +        "count": {
      +          "description": "Styles exported.",
      +          "type": "integer"
      +        },
      +        "path": {
      +          "description": "With out: the file written.",
      +          "type": "string"
      +        },
      +        "styleset": {
      +          "description": "The style set (styleset.install takes it as is).",
      +          "properties": {
      +            "styles": {
      +              "description": "The styles.",
      +              "items": {
      +                "description": "A style.",
      +                "properties": {
      +                  "based_on": {
      +                    "description": "Parent style id.",
      +                    "type": "string"
      +                  },
      +                  "custom": {
      +                    "description": "User-defined.",
      +                    "type": "boolean"
      +                  },
      +                  "default": {
      +                    "description": "Default style of its type.",
      +                    "type": "boolean"
      +                  },
      +                  "id": {
      +                    "description": "Style id.",
      +                    "type": "string"
      +                  },
      +                  "link": {
      +                    "description": "Linked style.",
      +                    "type": "string"
      +                  },
      +                  "name": {
      +                    "description": "Display name.",
      +                    "type": "string"
      +                  },
      +                  "next": {
      +                    "description": "Style of the next paragraph.",
      +                    "type": "string"
      +                  },
      +                  "paragraph": {
      +                    "description": "Paragraph properties.",
      +                    "type": "object"
      +                  },
      +                  "quick": {
      +                    "description": "In the quick gallery.",
      +                    "type": "boolean"
      +                  },
      +                  "run": {
      +                    "description": "Run properties.",
      +                    "type": "object"
      +                  },
      +                  "type": {
      +                    "description": "paragraph, character, table or numbering.",
      +                    "type": "string"
      +                  }
      +                },
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "styleset": {
      +              "description": "Its name.",
      +              "type": "string"
      +            },
      +            "version": {
      +              "description": "Format version.",
      +              "type": "integer"
      +            }
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "styleset",
      +        "count"
      +      ],
      +      "type": "object"
      +    },
      +    "warnings": {
      +      "description": "Things to know about the result.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "api",
      +    "ok",
      +    "op",
      +    "result",
      +    "warnings",
      +    "next"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false), the description discloses output behavior ('returned and also written to `out`'), a non-overwrite safety guarantee, and that the source document is unchanged. This resolves the ambiguity of readOnlyHint=false by clarifying that only the output file is written.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences, front-loaded with the core action, followed by the routing guidance and the safety note. No redundant or filler text; every clause carries distinct 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?

With an output schema present, the description needn't explain return values, and it covers the remaining essentials: scoping modes, output-file behavior, sibling routing, and non-mutation guarantee. Complete for a 5-parameter export tool.

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, but the description adds meaningful semantics by framing the export mode selection ('all, the `styles` named, or custom_only') and explaining the `out` write behavior, which enriches the plain schema by describing how parameters interact.

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's style definitions) with the exact scope options (all, `styles`, custom_only). It explicitly distinguishes itself from siblings by naming styleset.install and styleset.export_dotx and their different purposes.

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

Usage Guidelines5/5

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

Gives explicit usage direction: 'Feed it to styleset.install on another document to copy the look' and contrasts with 'styleset.export_dotx writes a Word template instead.' The agent knows both when to use this tool and which alternative fits a different need.

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