Skip to main content
Glama

docx-editMeta

Update metadata fields in Word documents including title, author, keywords, and timestamps to organize and document file information.

Instructions

Patch metadata of a docx by id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
patchYes

Implementation Reference

  • Core handler function that applies the metadata patch by merging it into the document's JSON meta object and triggering a document rebuild via updateJson.
    editMeta(id: DocId, patch: Partial<DocxJSON["meta"]>) {
      return this.updateJson(id, (json) => ({
        ...json,
        meta: { ...(json.meta ?? {}), ...(patch ?? {}) }
      }));
    }
  • Top-level switch case handler for the tool call: validates arguments using the tool's inputSchema and calls the DocRegistry.editMeta method.
    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 });
    }
  • src/index.ts:57-60 (registration)
    Tool registration in the tools object, including description and inputSchema that references the meta schema from DocxSchema.
    "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 metadata object, which is referenced by the tool's inputSchema for the 'patch' parameter.
    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