Skip to main content
Word 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.All for read-only document access
    • Files.ReadWrite.All for upload, update, delete, checkout, check-in, restore, and follow operations
    • Sites.Read.All or Sites.ReadWrite.All when 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

Installation

  1. Go to Apps in your workspace
  2. Search for Word and install it
  3. Open the app instance configuration and fill in the required Microsoft Graph credentials

Configuration

FieldDescription
Azure Client IDMicrosoft Entra application (client) ID used to call Microsoft Graph
Azure Client SecretMicrosoft Entra application client secret, stored as a workspace secret
Azure Tenant IDMicrosoft Entra directory (tenant) ID
SharePoint Site IDOptional default SharePoint site ID for SharePoint-based document operations

File Access

Word operations target Microsoft Graph drive items. For OneDrive files, pass an itemId or path and optionally a driveId. For SharePoint files, also pass siteId or configure a default SharePoint Site ID on the app instance.
- Word.getDocument:
    itemId: '{{documentItemId}}'
    driveId: '{{driveId}}'
    output: document
- Word.getDocumentByPath:
    path: Documents/Quarterly Report.docx
    siteId: '{{sharePointSiteId}}'
    driveId: '{{driveId}}'
    output: document

Available Instructions

Every instruction resolves Microsoft Graph credentials through the workspace configuration. Most operations accept driveId and siteId to override the configured default target.
InstructionArguments
getDocumentitemId*, select, expand, driveId, siteId
getDocumentByPathpath*, select, expand, driveId, siteId
searchDocumentsquery*, top, driveId, siteId
getDocumentStructureitemId*, includeContent, maxContentLength, driveId, siteId

Content Transfer & Creation

InstructionArguments
downloadDocumentitemId*, driveId, siteId
downloadDocumentByPathpath*, driveId, siteId
uploadDocumentitemId, content, contentType, driveId, siteId
uploadDocumentByPathpath, content, contentType, driveId, siteId
buildDocumentitemId or path, spec*, driveId, siteId
convertDocumentitemId, format, driveId, siteId

Metadata & Lifecycle

InstructionArguments
updateDocumentitemId*, name, description, driveId, siteId
deleteDocumentitemId*, driveId, siteId

Versions

InstructionArguments
listVersionsitemId*, driveId, siteId
getVersionitemId, versionId, driveId, siteId
downloadVersionContentitemId, versionId, driveId, siteId
restoreVersionitemId, versionId, driveId, siteId

Checkout

InstructionArguments
checkoutDocumentitemId*, driveId, siteId
checkinDocumentitemId*, comment, driveId, siteId
discardCheckoutitemId*, driveId, siteId

Collaboration & Analytics

InstructionArguments
followDocumentitemId*, driveId, siteId
unfollowDocumentitemId*, driveId, siteId
getAnalyticsitemId*, 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

- Word.searchDocuments:
    query: contract
    top: 10
    driveId: '{{driveId}}'
    output: documents

Build a New Word Document

- Word.buildDocument:
    path: Reports/generated-summary.docx
    driveId: '{{driveId}}'
    spec:
      properties:
        title: Generated Summary
        author: Prisme.ai
      sections:
        - content:
            - type: heading
              level: 1
              text: Quarterly Summary
            - type: paragraph
              text: This document was generated from a Prisme.ai workflow.
            - type: table
              headers:
                - Metric
                - Value
              rows:
                - - Revenue
                  - '{{revenue}}'
                - - Active customers
                  - '{{customerCount}}'
    output: builtDocument

Inspect and Convert a Document

- Word.getDocumentStructure:
    itemId: '{{documentItemId}}'
    includeContent: true
    output: structure
- Word.convertDocument:
    itemId: '{{documentItemId}}'
    format: pdf
    output: pdfContent

Restore a Previous Version

- Word.listVersions:
    itemId: '{{documentItemId}}'
    output: versions
- Word.restoreVersion:
    itemId: '{{documentItemId}}'
    versionId: '{{versions.value[0].id}}'
    output: restored

Error Handling

HTTP StatusErrorSolution
400Invalid request, path, format, or document specCheck required arguments, Graph path syntax, and spec.sections for buildDocument
401Authentication failedVerify Azure Client ID, Client Secret, Tenant ID, and token permissions
403Insufficient Microsoft Graph permissionsGrant admin consent for the required Files and Sites permissions
404Document, drive, site, or version not foundVerify itemId, path, driveId, siteId, and versionId
409Conflict or checkout state prevents the operationCheck the document checkout status or retry after releasing the lock
413Generated or uploaded content is too largeKeep base64 DOCX uploads under the 4 MB connector limit
429Microsoft Graph throttlingRetry later or reduce request volume
500Microsoft Graph or connector runtime errorInspect 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.