MCPInstall

word-documents

Create, modify, and manage Word documents.

Installs
130
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/aws-samples/sample-strands-agent-with-agentcore --skill word-documents
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads word-documents automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Word Documents

When to Use

ToolUse When
create_word_documentUser asks to create/generate a NEW Word document
modify_word_documentUser asks to edit/update an EXISTING document or add content
list_my_word_documentsUser asks what documents are available
read_word_documentUser wants to download a document or read its comments
preview_word_pageCheck actual page appearance (charts, images, complex layouts)

Workflow

  1. Before modifying: call preview_word_page to check current layout.
  2. After creation/modification: call preview_word_page to verify.
  3. Run tools sequentially (never parallel) to prevent file race conditions.

Page Setup

python-docx defaults to A4. For US Letter size:

from docx.shared import Inches
section = doc.sections[0]
section.page_width = Inches(8.5)
section.page_height = Inches(11)
# Set 1-inch margins
section.top_margin = Inches(1)
section.bottom_margin = Inches(1)
section.left_margin = Inches(1)
section.right_margin = Inches(1)

Professional Formatting

  • Font: Arial as default. Set via style.font.name = 'Arial'.
  • Headings: Use proper heading styles for TOC compatibility: doc.add_heading('Title', level=1) or doc.add_paragraph(style='Heading 1').
  • Bullet lists: doc.add_paragraph(style='List Bullet'). NEVER insert unicode bullet characters.
  • Numbered lists: doc.add_paragraph(style='List Number').
  • Always preserve existing styles, fonts, and colors when modifying.

Images

from docx.shared import Inches
paragraph = doc.add_paragraph()
run = paragraph.add_run()
run.add_picture('file.png', width=Inches(6))

Code Rules

  • The document is pre-initialized as doc = Document() (create) or loaded as doc (modify). Do NOT include Document() or doc.save().
  • Available libraries: python-docx, matplotlib, pandas, numpy (seaborn NOT available)
  • Use add_paragraph(style='List Bullet') for bullet lists. NEVER insert unicode bullet characters.
  • NEVER use paragraph.text = 'new text' (destroys formatting). Use runs instead.
  • Filenames: letters, numbers, hyphens only.

Tool Reference

create_word_document

Create a new Word document using python-docx code.

ParameterTypeRequiredDescription
python_codestrYesPython code using python-docx (see Code Rules above)
document_namestrYesFilename without extension (letters, numbers, hyphens only)

Example tool_input:

{
  "python_code": "doc.add_heading('Quarterly Report', 0)\ndoc.add_paragraph('This report summarizes Q4 performance.')\ndoc.add_heading('Revenue', level=1)\ndoc.add_paragraph('Total revenue: $1.2M')",
  "document_name": "quarterly-report"
}

WARNING: Parameter is document_name, NOT filename or name.

modify_word_document

Modify an existing Word document and save with a new name.

ParameterTypeRequiredDescription
source_namestrYesExisting document name (without .docx)
output_namestrYesNew output name (MUST differ from source)
python_codestrYesPython code to modify the document

Example tool_input:

{
  "source_name": "quarterly-report",
  "output_name": "quarterly-report-v2",
  "python_code": "doc.add_paragraph('Additional notes added.')"
}

list_my_word_documents

List all Word documents in workspace. No parameters needed.

read_word_document

Read document content. With include_comments=True, also shows all comments with author, date, text, and which paragraph they're attached to.

ParameterTypeRequiredDescription
document_namestrYesDocument name without extension
include_commentsboolNoIf true, extract and display comments with paragraph mapping (default: false)

preview_word_page

Get page screenshots for visual inspection before editing.

ParameterTypeRequiredDescription
document_namestrYesDocument name without extension
page_numberslist[int]Yes1-based page numbers to preview

UI Guidance (from tools-config)

Sequential Execution Required: Run modification tools sequentially, never in parallel (prevents race conditions on S3 file read/write).

When to Use:

  • create_word_document: User asks to create/generate a NEW Word document
  • modify_word_document: User asks to edit/modify/update an EXISTING document or add content to existing document
  • list_my_word_documents: User asks what documents are available
  • read_word_document: User wants to download a document
  • preview_word_page: Check actual page appearance when editing (charts, images, complex layouts)

Before Modifying: Always use preview_word_page first to see the current layout.

Page Setup:

  • python-docx defaults to A4. For US Letter: section.page_width = Inches(8.5); section.page_height = Inches(11)
  • Set 1" margins: section.top_margin = section.bottom_margin = section.left_margin = section.right_margin = Inches(1)

Professional Formatting:

  • Font: Arial as default. Set via style.font.name = 'Arial'
  • Use proper heading styles for TOC compatibility: document.add_heading('Title', level=1) or add_paragraph(style='Heading 1')
  • Lists: use add_paragraph(style='List Bullet') or add_paragraph(style='List Number'). NEVER insert unicode bullet characters manually.

Formatting Preservation:

  • ALWAYS preserve existing styles, fonts, colors
  • NEVER use paragraph.text = 'new text' (destroys formatting)
  • Use runs to modify text while preserving formatting

Filenames: Letters, numbers, hyphens only (e.g., "sales-report.docx")

Available Libraries: python-docx, matplotlib, pandas, numpy (seaborn NOT available)

Images: If workspace has relevant images: run.add_picture('file.png', width=Inches(6))

QA: Always use preview_word_page after creation to verify appearance.

FAQ

What does the word-documents skill do?

Create, modify, and manage Word documents.

How do I install word-documents?

Run npx skills add https://github.com/aws-samples/sample-strands-agent-with-agentcore --skill word-documents in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/word-documents/ (personal) or .claude/skills/word-documents/ (project).

Which AI agents can use word-documents?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is word-documents safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains word-documents?

It is published by aws-samples in aws-samples/sample-strands-agent-with-agentcore. It has 130 recorded installs.

More from aws-samples/sample-strands-agent-with-agentcore

View all →

financial-news

aws-samples/sample-strands-agent-with-agentcore

Open the skill to read its SKILL.md instructions.

Business & Finance260 installs

code-interpreter

aws-samples/sample-strands-agent-with-agentcore

Test and prototype code in a sandboxed environment. Use for debugging, verifying logic, or installing packages.

DevOps & Cloud158 installs

google-maps

aws-samples/sample-strands-agent-with-agentcore

Place search, directions, geocoding, and interactive maps

DevOps & Cloud96 installs

wikipedia-search

aws-samples/sample-strands-agent-with-agentcore

Open the skill to read its SKILL.md instructions.

DevOps & Cloud79 installs

arxiv-search

aws-samples/sample-strands-agent-with-agentcore

Open the skill to read its SKILL.md instructions.

powerpoint-presentations

aws-samples/sample-strands-agent-with-agentcore

Open the skill to read its SKILL.md instructions.

Docs & Writing68 installs

Popular docs & writing skills

View category →

grill-with-docs

mattpocock/skills

A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

Docs & Writing1.2M installs

lark-markdown

open.feishu.cn

飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。

Docs & Writing778.7K installs

writing-beats

mattpocock/skills

Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.

Docs & Writing490.7K installs

writing-shape

mattpocock/skills

Writing, exploit: shape raw material into an article, paragraph by paragraph.

Docs & Writing490.2K installs

writing-fragments

mattpocock/skills

Writing, explore: mine raw fragments, no structure yet.

Docs & Writing489.6K installs

writing-for-agents

mattpocock/skills

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

Docs & Writing479.3K installs