Skip to main content
Glama

docx-queryObjects

Retrieve top-level object information by ID from Word documents to inspect document structure and content elements.

Instructions

List top-level object info by id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Core implementation of queryObjects in DocRegistry: maps document content to array of {index, type} and returns with count.
    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 };
    }
  • MCP server switch case handler for docx-queryObjects: validates input and calls registry.queryObjects(id).
    case "docx-queryObjects": {
      const { id } = parseArgs<{ id: string }>(args, tools["docx-queryObjects"].inputSchema);
      return ok(registry.queryObjects(id));
    }
  • src/index.ts:53-56 (registration)
    Tool registration in tools object: defines name, description, and inputSchema requiring 'id' string.
    "docx-queryObjects": {
      description: "List top-level object info by id.",
      inputSchema: { type: "object", required: ["id"], properties: { id: { type: "string" } } }
    },
  • Input schema for the tool: object with required 'id' property of type string.
      inputSchema: { type: "object", required: ["id"], properties: { id: { type: "string" } } }
    },

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