Skip to main content
Glama

docx-removeContent

Remove a content block from a Word document by specifying the document ID and block index. Enables precise deletion of individual sections in a DOCX file.

Instructions

Remove a block at index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
indexYes

Implementation Reference

  • src/index.ts:69-72 (registration)
    Tool registration: Defines the 'docx-removeContent' tool with its description and inputSchema (requires id and index).
    "docx-removeContent": {
      description: "Remove a block at index.",
      inputSchema: { type: "object", required: ["id", "index"], properties: { id: { type: "string" }, index: { type: "integer", minimum: 0 } } }
    },
  • Handler: In the CallToolRequestSchema switch statement, handles 'docx-removeContent' by parsing args and calling registry.removeContent(id, index).
    case "docx-removeContent": {
      const { id, index } = parseArgs<{ id: string; index: number }>(args, tools["docx-removeContent"].inputSchema);
      const res = registry.removeContent(id, index);
      return ok({ id: res.id, updatedAt: res.updatedAt });
    }
  • Helper: DocRegistry.removeContent() removes a block at a given index from the document's content array via updateJson.
    removeContent(id: DocId, index: number) {
      return this.updateJson(id, (json) => {
        const arr = [...json.content];
        if (index < 0 || index >= arr.length) throw new Error("index out of range");
        arr.splice(index, 1);
        return { ...json, content: arr } as DocxJSON;
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states 'Remove' indicating mutation, but fails to disclose whether the operation is destructive, whether indices shift after removal, if undo is supported, or any error conditions. This is insufficient for an agent to assess side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely short (one sentence) but omits critical information. It achieves conciseness at the cost of clarity and completeness, leaving the agent underinformed. A better balance is needed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given two required parameters, no output schema, and no annotations, the description is grossly incomplete. It does not explain return values, error handling, expected behavior if index is out of bounds, or any operational context (e.g., document loaded). The agent cannot use this tool reliably.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description adds no meaning beyond the schema. It does not explain what 'id' refers to (e.g., document ID) or what 'index' means (e.g., 0-based position, valid range). The agent has no clue how to populate these parameters correctly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb 'Remove' and the resource 'a block', with a qualifier 'at index', making the basic purpose clear. However, it does not specify what a 'block' refers to (e.g., a paragraph, table, or other element), which could cause ambiguity in a docx context. It is distinct from sibling tools like docx-insertContent or docx-editContent, but the lack of specificity prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, prerequisites (e.g., document must be open), or conditions (e.g., index must exist). The agent receives no context about expected usage, making it unclear how to integrate this tool into a workflow.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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