Metadata Tools
The MCP server provides two tools for document metadata manipulation. Both support PDF and DOCX formats with automatic format detection.
onlyoffice_get_metadata
Section titled “onlyoffice_get_metadata”Extract metadata from a PDF or DOCX document.
| Parameter | Type | Required | Description |
|---|---|---|---|
source |
string | Yes | Document content as base64, file path, or URL |
sourceType |
enum | Yes | "base64", "path", or "url" |
includeRaw |
boolean | No | Include raw format-specific metadata (default: false) |
includeCustom |
boolean | No | Include custom properties (default: true) |
Source Types
Section titled “Source Types”Use source (string) + sourceType (enum) together:
// Base64: source = base64 string, sourceType = "base64"// URL: source = URL string, sourceType = "url"// Path: source = file path, sourceType = "path"Example
Section titled “Example”{ "source": "JVBERi0xLjQK...", "sourceType": "base64"}Response
Section titled “Response”{ "success": true, "documentType": "pdf", "metadata": { "standard": { "title": "Document Title", "author": "Author Name", "subject": "Document Subject", "keywords": ["keyword1", "keyword2"], "creator": "Creator Application", "creationDate": "2024-01-15T10:00:00.000Z", "modificationDate": "2024-06-20T14:30:00.000Z" }, "custom": [] }}onlyoffice_set_metadata
Section titled “onlyoffice_set_metadata”Modify metadata in a PDF or DOCX document.
| Parameter | Type | Required | Description |
|---|---|---|---|
source |
string | Yes | Document content as base64, file path, or URL |
sourceType |
enum | Yes | "base64", "path", or "url" |
modifications |
object | Yes | Metadata changes to apply |
deliveryMethod |
enum | No | "url" or "base64" (default depends on transport) |
Modifications
Section titled “Modifications”{ "standard": { "title": "New Title", "author": "New Author", "keywords": ["new", "keywords"] }, "setCustom": [ { "name": "ProjectId", "value": "12345", "type": "string" }, { "name": "Approved", "value": true, "type": "boolean" } ], "removeCustom": ["OldProperty"]}Delivery Method
Section titled “Delivery Method”| Value | Description |
|---|---|
"url" |
Return a download URL for the modified document (HTTP default) |
"base64" |
Return the document as inline base64 (STDIO default) |
Example
Section titled “Example”{ "source": "JVBERi0xLjQK...", "sourceType": "base64", "modifications": { "standard": { "title": "Updated Document", "author": "Jane Doe" } }, "deliveryMethod": "url"}Response
Section titled “Response”{ "success": true, "documentType": "pdf", "modifiedFields": ["title", "author"], "output": { "base64": "JVBERi0xLjQK...", "mimeType": "application/pdf", "filename": "document.pdf" }}Supported Metadata Fields
Section titled “Supported Metadata Fields”| Field | Read | Write | Description |
|---|---|---|---|
title |
Yes | Yes | Document title |
author |
Yes | Yes | Document author |
subject |
Yes | Yes | Document subject |
keywords |
Yes | Yes | Keywords (string array) |
creator |
Yes | Yes | Creating application |
producer |
Yes | Yes | PDF producer |
creationDate |
Yes | Yes | Creation date (ISO 8601) |
modificationDate |
Yes | Yes | Last modified date (ISO 8601) |
| Field | Read | Write | Description |
|---|---|---|---|
title |
Yes | Yes | Document title |
author |
Yes | Yes | Creator (dc:creator) |
subject |
Yes | Yes | Document subject |
keywords |
Yes | Yes | Keywords |
creator |
Yes | Yes | Creating application |
creationDate |
Yes | Yes | Creation date |
modificationDate |
Yes | Yes | Last modified date |
Related
Section titled “Related”- Tools Reference - All 26 MCP tools
- API Overview - Tool categories