The Word connector provides Microsoft Word document operations through the Microsoft Graph API. It can be used as a Builder app for deterministic document workflows or as an MCP server for AI agents that need to create, inspect, convert, update, version, and manage .docx files stored in OneDrive or SharePoint.
Document Operations
Read metadata, download content, upload DOCX bytes, convert files, and delete documents
Structured Authoring
Build valid Word documents from a JSON specification with headings, paragraphs, tables, lists, images, and formatting
Governance & Lifecycle
Search files, inspect document structure, manage versions, checkout locks, following, and analytics
Prerequisites
- A Microsoft Entra ID / Azure AD application registered in your tenant
- A client secret for that application
- Microsoft Graph permissions granted with admin consent:
Files.Read.Allfor read-only document accessFiles.ReadWrite.Allfor upload, update, delete, checkout, check-in, restore, and follow operationsSites.Read.AllorSites.ReadWrite.Allwhen accessing SharePoint-hosted documents
- Your Directory (tenant) ID and Application (client) ID
- Optional SharePoint Site ID when the default target is a SharePoint site instead of the user’s OneDrive
- Usage as App
- Usage as MCP
Installation
- Go to Apps in your workspace
- Search for Word and install it
- Open the app instance configuration and fill in the required Microsoft Graph credentials
Configuration
| Field | Description |
|---|---|
| Azure Client ID | Microsoft Entra application (client) ID used to call Microsoft Graph |
| Azure Client Secret | Microsoft Entra application client secret, stored as a workspace secret |
| Azure Tenant ID | Microsoft Entra directory (tenant) ID |
| SharePoint Site ID | Optional default SharePoint site ID for SharePoint-based document operations |
File Access
Word operations target Microsoft Graph drive items. For OneDrive files, pass anitemId or path and optionally a driveId. For SharePoint files, also pass siteId or configure a default SharePoint Site ID on the app instance.Available Instructions
Every instruction resolves Microsoft Graph credentials through the workspace configuration. Most operations acceptdriveId and siteId to override the configured default target.Document Lookup & Search
| Instruction | Arguments |
|---|---|
getDocument | itemId*, select, expand, driveId, siteId |
getDocumentByPath | path*, select, expand, driveId, siteId |
searchDocuments | query*, top, driveId, siteId |
getDocumentStructure | itemId*, includeContent, maxContentLength, driveId, siteId |
Content Transfer & Creation
| Instruction | Arguments |
|---|---|
downloadDocument | itemId*, driveId, siteId |
downloadDocumentByPath | path*, driveId, siteId |
uploadDocument | itemId, content, contentType, driveId, siteId |
uploadDocumentByPath | path, content, contentType, driveId, siteId |
buildDocument | itemId or path, spec*, driveId, siteId |
convertDocument | itemId, format, driveId, siteId |
Metadata & Lifecycle
| Instruction | Arguments |
|---|---|
updateDocument | itemId*, name, description, driveId, siteId |
deleteDocument | itemId*, driveId, siteId |
Versions
| Instruction | Arguments |
|---|---|
listVersions | itemId*, driveId, siteId |
getVersion | itemId, versionId, driveId, siteId |
downloadVersionContent | itemId, versionId, driveId, siteId |
restoreVersion | itemId, versionId, driveId, siteId |
Checkout
| Instruction | Arguments |
|---|---|
checkoutDocument | itemId*, driveId, siteId |
checkinDocument | itemId*, comment, driveId, siteId |
discardCheckout | itemId*, driveId, siteId |
Collaboration & Analytics
| Instruction | Arguments |
|---|---|
followDocument | itemId*, driveId, siteId |
unfollowDocument | itemId*, driveId, siteId |
getAnalytics | itemId*, driveId, siteId |
Arguments flagged with
* are required. buildDocument requires spec and either itemId for rewrite mode or path for create mode.DSUL Examples
Search for Word Documents
Build a New Word Document
Inspect and Convert a Document
Restore a Previous Version
Error Handling
| HTTP Status | Error | Solution |
|---|---|---|
400 | Invalid request, path, format, or document spec | Check required arguments, Graph path syntax, and spec.sections for buildDocument |
401 | Authentication failed | Verify Azure Client ID, Client Secret, Tenant ID, and token permissions |
403 | Insufficient Microsoft Graph permissions | Grant admin consent for the required Files and Sites permissions |
404 | Document, drive, site, or version not found | Verify itemId, path, driveId, siteId, and versionId |
409 | Conflict or checkout state prevents the operation | Check the document checkout status or retry after releasing the lock |
413 | Generated or uploaded content is too large | Keep base64 DOCX uploads under the 4 MB connector limit |
429 | Microsoft Graph throttling | Retry later or reduce request volume |
500 | Microsoft Graph or connector runtime error | Inspect the tool response and workspace execution logs |
Common Issues
“Authentication failed” - The Microsoft Graph credentials are missing, expired, or lack admin consent. Confirm the configured Azure app can acquire a token for Microsoft Graph. “Either itemId or path must be provided” -buildDocument supports rewrite mode with itemId or create mode with path. Provide one of them with a valid spec.
Upload exceeds 4 MB - uploadDocument, uploadDocumentByPath, and generated buildDocument uploads use the small-file Microsoft Graph upload path. Reduce the document size before retrying.
SharePoint document not found - SharePoint operations usually need the correct siteId and driveId. Configure a default SharePoint Site ID or pass these arguments per call.
External Resources
Microsoft Graph DriveItem API
Reference for OneDrive and SharePoint file metadata, content, versions, and lifecycle operations.
Tool Agents
Learn how to expose connector tools to AI agents through Prisme.ai capabilities.