add_numbered_list
Insert a numbered list into a Word document to organize content with sequential formatting, using a document ID and array of items.
Instructions
Add a numbered list to the document
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| docId | Yes | Document identifier | |
| items | Yes | Array of list items |
Implementation Reference
- src/services/document-manager.ts:134-149 (handler)The core handler function that adds a numbered list to the document by creating Paragraph elements with numbering configuration and appending them to the document's paragraphs.addNumberedList(docId: string, items: string[]): void { const docInfo = this.getDocument(docId); items.forEach((item, index) => { const paragraph = new Paragraph({ text: item, numbering: { reference: "default-numbering", level: 0, }, }); docInfo.paragraphs.push(paragraph); }); this.updateDocument(docId); }
- src/tools/document-tools.ts:99-117 (schema)The tool schema definition including name, description, and inputSchema for validating parameters: docId (string) and items (array of strings).{ name: "add_numbered_list", description: "Add a numbered list to the document", inputSchema: { type: "object", properties: { docId: { type: "string", description: "Document identifier", }, items: { type: "array", items: { type: "string" }, description: "Array of list items", }, }, required: ["docId", "items"], }, },
- src/tools/tool-handlers.ts:51-60 (registration)The switch case in handleToolCall that registers and dispatches the 'add_numbered_list' tool call to the DocumentManager's addNumberedList method, returning a success message.case "add_numbered_list": documentManager.addNumberedList(args.docId, args.items); return { content: [ { type: "text", text: `Numbered list added with ${args.items.length} items.`, }, ], };