Skip to main content
Glama

Insert Header Near Text

insert_header_near_text

Inserts a styled header before or after a paragraph identified by text or index in a Word document. Use to add section headings at precise locations.

Instructions

Insert a header (with specified style) before or after the target paragraph. Specify by text or paragraph index. Args: filename (str), target_text (str, optional), header_title (str), position ('before' or 'after'), header_style (str, default 'Heading 1'), target_paragraph_index (int, optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes
target_textNo
header_titleNo
positionNoafter
header_styleNoHeading 1
target_paragraph_indexNo
Behavior2/5

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

Annotations provide only title; no readOnlyHint or destructiveHint. The description discloses the insertion action but does not cover side effects, permissions required, error handling (e.g., missing target), or behavior when both target_text and target_paragraph_index are omitted. Minimal transparency beyond the basic operation.

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

Conciseness3/5

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

The description is two sentences, but the second sentence is a parameter list that could be more concise. The main action is front-loaded, but the parameter listing adds redundancy. It is adequate but not optimally structured.

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

Completeness2/5

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

With 6 parameters, no output schema, and no annotations, the description covers parameter meanings but lacks information on return value, error conditions, mutual exclusivity of target_text and target_paragraph_index, and default behavior when neither is provided. Leaves significant gaps for an AI agent.

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

Parameters4/5

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

Schema description coverage is 0%, so the description adds meaning by explaining each parameter's purpose and default values (e.g., 'position' values 'before' or 'after', header_style default 'Heading 1', optional target_text and target_paragraph_index). This is valuable despite the schema lacking descriptions.

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

Purpose5/5

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

The description clearly states the action (insert a header with specified style) and the target (before or after a given paragraph, identified by text or index). It effectively distinguishes from sibling tools like 'add_heading' or 'insert_line_or_paragraph_near_text' by specifying header insertion and relative positioning.

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

Usage Guidelines3/5

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

The description includes basic usage ('Specify by text or paragraph index') but does not provide guidance on when to use this tool versus other similar tools (e.g., 'add_heading', 'replace_paragraph_block_below_header'). No explicit when-not-to-use or alternative tool mentions.

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/ihatesea69/Office-Word-MCP'

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