Skip to main content
Glama

docx-queryObjects

Retrieve detailed information about top-level objects in a Word document by specifying an object ID. Use this tool to efficiently manage and query document elements within the DOCX MCP Server environment.

Instructions

List top-level object info by id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Direct handler for the 'docx-queryObjects' tool call within the MCP server request handler switch statement. Parses arguments using the tool's input schema and delegates execution to DocRegistry.queryObjects(id).
    case "docx-queryObjects": { const { id } = parseArgs<{ id: string }>(args, tools["docx-queryObjects"].inputSchema); return ok(registry.queryObjects(id)); }
  • Core implementation of queryObjects in DocRegistry class. Retrieves the managed document, maps over its content array to produce a list of top-level objects with their index and type, and returns count and objects array.
    queryObjects(id: DocId) { const cur = this.require(id); // Return a simplified view of objects from JSON (paragraphs, tables, images) const objects = cur.json.content.map((block, idx) => ({ index: idx, type: block.type, })); return { count: objects.length, objects }; }
  • src/index.ts:53-56 (registration)
    Tool registration entry in the tools object, defining the name, description, and input schema used for listing tools and validating parameters.
    "docx-queryObjects": { description: "List top-level object info by id.", inputSchema: { type: "object", required: ["id"], properties: { id: { type: "string" } } } },
  • Input schema for the tool, defining the required 'id' parameter of type string. Referenced in registration and used for argument validation.
    inputSchema: { type: "object", required: ["id"], properties: { id: { type: "string" } } } },

Other Tools

Related Tools

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/lihongjie0209/docx-mcp'

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