Skip to main content
Glama

docx-editMeta

Modify DOCX metadata such as title, subject, creator, and keywords programmatically by ID. Streamline document updates and management using structured JSON input for precise changes.

Instructions

Patch metadata of a docx by id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
patchYes

Implementation Reference

  • Main MCP tool handler: validates input arguments using the tool's schema and delegates to DocRegistry.editMeta for execution.
    case "docx-editMeta": { const { id, patch } = parseArgs<{ id: string; patch: any }>(args, tools["docx-editMeta"].inputSchema); const res = registry.editMeta(id, patch); return ok({ id: res.id, updatedAt: res.updatedAt, meta: res.json.meta }); }
  • Core logic implementation: applies the patch to the document's JSON meta field using shallow merge, then triggers doc rebuild via updateJson.
    editMeta(id: DocId, patch: Partial<DocxJSON["meta"]>) { return this.updateJson(id, (json) => ({ ...json, meta: { ...(json.meta ?? {}), ...(patch ?? {}) } })); }
  • src/index.ts:57-60 (registration)
    Tool registration: defines name, description, and input schema (referencing DocxSchema.properties.meta for patch validation).
    "docx-editMeta": { description: "Patch metadata of a docx by id.", inputSchema: { type: "object", required: ["id", "patch"], properties: { id: { type: "string" }, patch: DocxSchema.properties.meta } } },
  • JSON schema definition for the document meta object, referenced by the tool's inputSchema for patch validation.
    meta: { type: "object", additionalProperties: false, properties: { title: { type: "string" }, subject: { type: "string" }, creator: { type: "string" }, description: { type: "string" }, keywords: { type: "string" }, lastModifiedBy: { type: "string" }, category: { type: "string" }, company: { type: "string" }, manager: { type: "string" }, revision: { type: "string" }, createdAt: { type: "string", format: "date-time" }, modifiedAt: { type: "string", format: "date-time" } } },

Latest Blog Posts

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/lihongjie0209/docx-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server