Skip to main content
Glama

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

Implementation Reference

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

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