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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| patch | Yes |
Implementation Reference
- src/docx-utils.ts:205-210 (handler)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 ?? {}) } })); }
- src/index.ts:182-186 (handler)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 } } },
- src/schema.ts:12-29 (schema)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" } } },