Skip to main content
Glama

word_format_run

Update formatting of a specific text run in a Word document by paragraph and run index. Set bold, italic, font size, font name, or color individually.

Instructions

Update the formatting of a single run.

Args: path: Path to an existing .docx. paragraph_index: Zero-based index of the paragraph. run_index: Zero-based index of the run inside that paragraph. bold: True / False to set, or None to leave as-is. italic: Same convention as bold. font_size: Point size (int or float) or None. font_name: Font name string or None. color: Hex color string (e.g. "FF0000") or None. folder: Optional base folder for relative paths.

Returns: {"ok": True}.

Special case: If all of bold, italic, font_size, font_name, color are None, the function is a no-op: the file is not re-saved and the SHA256 is preserved (VAL-WORD-039 / VAL-WORD-076).

Raises: OfficeMCPError: ERR_INVALID_PARAMS if indices are out of range or of the wrong type, or color is not a valid hex string. ERR_FILE_NOT_FOUND if the file is missing, ERR_UNSUPPORTED_FMT for non-.docx extensions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
paragraph_indexYes
run_indexYes
boldNo
italicNo
font_sizeNo
font_nameNo
colorNo
folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description fully discloses key behaviors: the no-op case when all formatting parameters are None (preserving SHA256), and specific error conditions (ERR_INVALID_PARAMS, ERR_FILE_NOT_FOUND, ERR_UNSUPPORTED_FMT). This is comprehensive.

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?

The description is well-structured with Args, Returns, Special case, and Raises sections. It is concise yet informative, with no unnecessary words.

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?

Given the tool's complexity (9 parameters, no annotations) and the presence of an output schema, the description covers all aspects: parameter usage, return type, special behavior, and error cases. It is fully complete.

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

Parameters5/5

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

The description explains each parameter's semantics beyond the schema: e.g., 'True/False to set, or None to leave as-is' for bold/italic, and 'Hex color string (e.g. "FF0000")' for color. This compensates for 0% schema description coverage.

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?

The description clearly states 'Update the formatting of a single run' and identifies the tool's scope as operating on a specific run in a .docx file. This purpose is distinct from sibling tools like word_add_paragraph or word_read_paragraph.

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?

The description clearly defines the tool's role but does not explicitly state when to use it instead of alternatives. However, the context makes it reasonably clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gawirable/office-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server