Skip to main content
Glama

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
NameRequiredDescriptionDefault
docIdYesDocument identifier
itemsYesArray of list items

Implementation Reference

  • 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); }
  • 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"], }, },
  • 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.`, }, ], };

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/bibash44/word-documet-mcp-server'

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