add_numbered_list
Insert a numbered list into a Word document by providing document ID and list items. This tool organizes content with sequential numbering for structured presentation.
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)Core implementation of the addNumberedList method that creates docx Paragraph elements with numbering configuration and appends them to the document's paragraphs array.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/tool-handlers.ts:51-60 (handler)Tool call handler case within handleToolCall that invokes the documentManager's addNumberedList method and returns a success confirmation.case "add_numbered_list": documentManager.addNumberedList(args.docId, args.items); return { content: [ { type: "text", text: `Numbered list added with ${args.items.length} items.`, }, ], };
- src/tools/document-tools.ts:99-117 (schema)Defines the tool schema for 'add_numbered_list' including input validation for docId (string) and items (string array).{ 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/index.ts:24-28 (registration)MCP server registration of tools list via ListToolsRequestHandler, where documentTools array includes the 'add_numbered_list' tool definition.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: documentTools, }; });