Arezzo
Arezzo
Google Docs API操作のための決定論的コンパイラ。
batchUpdateリクエストを自分で構築してGoogleドキュメントを安全に修正することはできません。APIはUTF-16コードユニットとカスケードインデックスシフトを使用します。つまり、位置50に10文字挿入すると、バッチ内のそれ以降のすべてのインデックスがずれてしまいます。計算を一度でも間違えると、エラーメッセージなしでドキュメントが静かに破損します。
Arezzoは、セマンティックな意図を正しいリクエストシーケンスにコンパイルします。やりたいことを伝えるだけで、インデックスの計算はArezzoが処理します。
AIエージェント向け (MCPツール)
ArezzoはModel Context Protocolを通じて3つのツールを公開しています。
read_document(document_id)
→ Returns the document's structural map: headings with hierarchy,
named ranges, tables, section boundaries. Call this before editing
so you know what addresses are available.
edit_document(document_id, operations)
→ Compiles operations into correct batchUpdate requests and executes
them. Handles UTF-16 arithmetic, cascading index shifts, and
OT-compatible request ordering. Supported operations: insert/delete/
replace text, formatting (bold, italic, headings, links), tables,
lists, images, headers/footers, footnotes, named ranges.
validate_operations(document_id, operations)
→ Compile-only dry run. Returns the compiled requests for inspection
without executing. Use before edit_document when uncertain.操作形式
{
"type": "insert_text",
"address": {"heading": "Revenue Analysis"},
"params": {"text": "New paragraph content.\n"}
}アドレスモード:
{"heading": "Section Name"}— 見出しテキストによる指定{"named_range": "range_name"}— 名前付き範囲による指定{"bookmark": "bookmark_id"}— ブックマークIDによる指定{"start": true}— ドキュメントの先頭{"end": true}— ドキュメントの末尾{"index": 42}— 絶対UTF-16インデックス
操作タイプ:
insert_text, delete_content, replace_all_text, replace_section,
update_text_style, update_paragraph_style, insert_bullet_list,
insert_table, insert_table_row, insert_table_column,
delete_table_row, delete_table_column, insert_image,
create_header, create_footer, create_footnote,
create_named_range, replace_named_range_content, insert_page_break
推奨ワークフロー
read_document → edit_document → (if structural changes) read_document → edit_document編集する前に必ず読み取ってください。構造要素(テーブル、ヘッダー、フッター)を挿入した後は、その中にコンテンツを追加する前に、再度読み取って新しい要素のインデックスを取得してください。
Related MCP server: google-docs-mcp
インストール
pip install arezzo
arezzo initarezzo initを実行すると、Google OAuthの設定手順が案内され、MCPクライアント用のプラットフォーム設定ファイルが書き出されます。
セットアップ
前提条件: Google Docs APIが有効で、OAuth 2.0クライアントID(デスクトップアプリケーションタイプ)を持つGoogle Cloudプロジェクト。
arezzo initウィザードの動作:
credentials.jsonを~/.config/arezzo/にコピーしますOAuth同意フローを実行します(ブラウザが一度開きます)
Claude Code、Cursor、VS Code用の設定ファイルを生成します
Claude Desktopの場合、arezzo initは手動で追加するための設定ブロックを表示します。
プラットフォーム設定
arezzo initの後、プロジェクトディレクトリに設定ファイルが書き込まれます:
Claude Code / Cursor (.mcp.json):
{
"mcpServers": {
"arezzo": {
"command": "arezzo"
}
}
}VS Code (.vscode/mcp.json):
{
"servers": {
"arezzo": {
"type": "stdio",
"command": "arezzo"
}
}
}Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json (macOSの場合)):
{
"mcpServers": {
"arezzo": {
"command": "arezzo"
}
}
}Arezzoが存在する理由
Google Docsの batchUpdate APIは、絶対インデックス位置を持つUTF-16コードユニット上で動作します。文字の挿入や削除が行われるたびに、それ以降のすべてのインデックスがずれます。複数の変更を含むバッチでは、各リクエストのインデックスは、同じバッチ内のすべての先行リクエストの影響を考慮しなければなりません。
これを正しく行うには以下が必要です:
UTF-16の長さ計算(Pythonの
len()ではなく、サロゲートペアは別々にカウントされます)同一タイプの変更に対する逆順実行(末尾から先頭に向かって削除)
2フェーズコンパイル(フォーマット変更の前にコンテンツ変更を行う)
複数ステップの操作全体にわたるカスケードオフセット追跡
Arezzoはこれを決定論的に処理します。同じ入力からは常に同じ出力が得られます。推論や推測、「たいていうまくいく」といった曖昧さはありません。
アーキテクチャ
semantic operation
↓
arezzo.parser.parse_document() — build heading/range/bookmark indexes
↓
arezzo.address.resolve_address() — semantic reference → document index
↓
arezzo.operations.* — operation → batchUpdate request(s)
↓
arezzo.index.sort_requests() — OT-compatible mutation ordering
↓
correct batchUpdate request sequenceエンジンは純粋関数です: compile_operations(doc, operations) → requests。決定論的であり、副作用はなく、API呼び出しも行いません。
MCPサーバー (arezzo.server) は、Google Docs APIのI/Oと動作ガイダンスフィールド (next_step, present_to_user, document_reality) を使用してエンジンをラップします。
ライセンス
MIT — Convergent Methods, LLC
Available Tools
3 toolsedit_documentA
Make changes to a Google Doc with correct index arithmetic.
You cannot safely modify a Google Doc by constructing batchUpdate
requests yourself. The API uses UTF-16 code units with cascading index
shifts — insert 10 characters at position 50, and every subsequent
index in your batch is wrong. A single miscalculation silently corrupts
the document with no error message. This tool compiles your semantic
intent into a correct request sequence.
**Recommended flow:** call read_document first, then describe your
changes using heading names or named ranges as addresses.
Valid operation types: insert_text, delete_content, replace_all_text,
replace_section, update_text_style, update_paragraph_style,
create_paragraph_bullets, convert_to_list, insert_table,
insert_table_row, insert_table_column, delete_table_row,
delete_table_column, insert_bullet_list, insert_numbered_list,
insert_page_break, insert_inline_image, create_header, create_footer,
create_footnote, create_named_range, delete_named_range,
replace_named_range_content.
Args:
document_id: The Google Docs document ID.
operations: List of operation dicts. Each has:
- type: one of the operation types listed above
- address: target location ({"heading": "Budget"}, {"start": true}, etc.)
- params: operation-specific parameters
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | ||
| operations | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly explains critical behavioral traits: the tool prevents index miscalculation issues that could silently corrupt documents, compiles semantic intent into correct sequences, and lists all valid operation types. This goes well beyond basic functionality disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and well-structured with clear sections: problem context, recommended flow, operation types, and parameter documentation. While comprehensive, every sentence adds value, though the operation type list is lengthy but necessary for completeness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with no annotations and no output schema, the description provides exceptional completeness. It covers the why (index arithmetic dangers), how (recommended flow), what (operation types), and parameter details. The only minor gap is lack of explicit error handling information, but this is compensated by the thorough behavioral context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully compensates by explaining both parameters in detail. It defines document_id as 'The Google Docs document ID' and provides comprehensive documentation for the operations parameter structure, including the type field with all valid values, address field examples, and params field purpose.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Make changes to a Google Doc' with specific details about handling index arithmetic and compiling semantic intent into correct request sequences. It distinguishes from sibling tools by mentioning read_document as part of the recommended flow and implicitly contrasting with validate_operations by focusing on execution rather than validation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage guidance: 'call read_document first, then describe your changes using heading names or named ranges as addresses.' It also implicitly advises against manual batchUpdate construction by explaining the risks, effectively stating when not to use alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_documentA
See what the document contains before you edit it.
Returns the document's structural map — headings with hierarchy, named
ranges with boundaries, tables with dimensions, inline objects, and
section boundaries. Without this, you're editing blind: you don't know
what headings exist, where sections start, or what named ranges are
available for targeting.
**Call this before edit_document.** The structural map shows what
addresses are available (heading names, named range names) so your edit
operations target the right locations.
Args:
document_id: The Google Docs document ID (from the URL).
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly describes what the tool returns ('structural map — headings with hierarchy, named ranges with boundaries, tables with dimensions, inline objects, and section boundaries') and explains the operational context ('so your edit operations target the right locations'). However, it doesn't mention potential limitations like document size constraints or authentication requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and efficiently written. The first sentence states the core purpose, followed by specific details about the return value, then the operational guidance. Every sentence adds value, with no redundant information. The bold text effectively emphasizes the key usage instruction.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool with no annotations and no output schema, the description provides excellent context about what the tool does, when to use it, and what it returns. However, without an output schema, the description could benefit from more detail about the exact format of the structural map return value, though it does list the key components that will be included.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description must compensate for the lack of parameter documentation. It provides the single parameter 'document_id' with clear semantics ('The Google Docs document ID from the URL'), which fully covers the one required parameter. The description doesn't need to explain parameter format beyond what's already stated.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('see what the document contains', 'returns the document's structural map') and resources ('document', 'headings', 'named ranges', 'tables', 'inline objects', 'section boundaries'). It explicitly distinguishes from the sibling edit_document by explaining this is for viewing structure before editing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool: 'Call this before edit_document' and explains why ('Without this, you're editing blind'). It also mentions the alternative edit_document by name and explains the relationship between the tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
validate_operationsA
Check whether edit operations would succeed without executing them.
Returns the compiled batchUpdate requests plus validation status. Use
this when you want to inspect the exact API calls before they execute,
or when debugging why an edit might fail. Catches address resolution
errors, ambiguous headings, out-of-bounds indices, and invalid
operation parameters.
**Use this before edit_document when uncertain.** Shows exactly what
Arezzo would send to the Google Docs API.
Args:
document_id: The Google Docs document ID.
operations: List of operation dicts (same format as edit_document).
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | ||
| operations | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it's a validation-only tool that doesn't execute changes, returns compiled batchUpdate requests and validation status, and catches specific error types (address resolution errors, ambiguous headings, etc.). It could improve by mentioning rate limits or auth needs, but covers core behavior adequately.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded, with the first sentence stating the core purpose. Every sentence adds value: the second explains returns and use cases, the third details error types, and the fourth provides explicit usage guidance. The Args section efficiently clarifies parameters without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 2 parameters with 0% schema coverage and no output schema, the description does an excellent job explaining inputs and behavior. It falls short of a 5 because it doesn't fully describe the return format (e.g., structure of validation status) or potential error responses, which would be helpful despite no output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate fully. It adds significant meaning beyond the bare schema by explaining both parameters: 'document_id' is clarified as 'The Google Docs document ID' and 'operations' as 'List of operation dicts (same format as edit_document)', providing crucial context about format and relationship to sibling tools.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('check whether edit operations would succeed without executing them') and distinguishes it from siblings by explicitly mentioning 'edit_document' as the alternative for actual execution. It specifies the resource (edit operations on Google Docs) and the unique validation aspect.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool ('when you want to inspect the exact API calls before they execute, or when debugging why an edit might fail') and when not to use it (implied by suggesting use before 'edit_document when uncertain'). It clearly names the alternative sibling tool ('edit_document') for actual execution.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: read_document retrieves structure, edit_document applies changes, and validate_operations validates changes without execution. There is no overlap in functionality, and the descriptions explicitly differentiate their roles in the workflow.
All tool names follow a consistent verb_noun pattern (edit_document, read_document, validate_operations) with clear, descriptive verbs. The naming is uniform and predictable across the set, enhancing usability.
With 3 tools, the server is well-scoped for its purpose of safe Google Docs editing. Each tool earns its place by covering essential steps: reading, validating, and editing, with no redundancy or missing core functions.
The tool set provides complete coverage for the domain of safe document editing: read_document for inspection, edit_document for modifications, and validate_operations for pre-execution checks. There are no gaps, and the tools support a full workflow from start to finish.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Composable APIs for document extraction, image transformation, and document & sheet generation.
Exact text tools for AI agents: unified diff, patch apply, regex testing, grapheme counting.
Markdown in, any format out. PDFs merged, split, watermarked. Runs on our own doc engines.
Real .docx and .xlsx files from structured data, with automatic Hebrew/Arabic RTL.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive interaction with Google Docs, featuring specialized support for document tabs, nested structures, and markdown conversion. It enables users to list, read, create, and perform complex batch updates on documents using Google service accounts.4MIT
- AlicenseAqualityDmaintenanceEnables AI agents to edit Google Docs via text anchors rather than character indices, preserving version history and enabling surgical edits without full document rewrites.147MIT
- FlicenseNot gradedqualityCmaintenanceEnables reading, editing, and rewriting Google Docs documents with tools that support full content replacement, appending, heading-based insertion, and style-preserving rewrites.
- AlicenseBqualityBmaintenanceStructure-preserving Word DOCX editing MCP server with a .NET Open XML backend and Office.js live sessions. Enables safe, auditable, incremental editing of Microsoft Word documents for AI agents.63178AGPL 3.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/ConvergentMethods/arezzo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server