Skip to main content
Glama

get_hwp_page_def

Retrieve page definitions including paper size, margins, and columns for each section in a Hangul Word Processor file. Understand document layout properties.

Instructions

Get per-section page definition (paper size, margins, columns) and section properties. Useful for understanding document layout. Args: file_path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Implementation Reference

  • The handler function for the 'get_hwp_page_def' tool. Opens a document, iterates over each section, retrieves page definition and section definition via doc.getPageDef(s) and doc.getSectionDef(s), and returns a formatted string.
    export async function getHwpPageDef(args: FilePathArgs): Promise<string> {
      let doc;
      try {
        doc = await openDocument(args.file_path);
      } catch (e) {
        return (e as Error).message;
      }
      try {
        const sectionCount = doc.getSectionCount();
        const out: string[] = [];
        for (let s = 0; s < sectionCount; s++) {
          try {
            const pageRaw = doc.getPageDef(s);
            const sectionRaw = doc.getSectionDef(s);
            out.push(`# section ${s}`);
            out.push(`pageDef: ${pageRaw}`);
            out.push(`sectionDef: ${sectionRaw}`);
            out.push("");
          } catch (e) {
            out.push(`section ${s}: ${(e as Error).message}`);
          }
        }
        return out.join("\n");
      } finally {
        closeDocument(doc);
      }
    }
  • The FilePathArgs interface defining the input schema fields: file_path (string).
    export interface FilePathArgs {
      file_path: string;
    }
  • src/server.ts:131-140 (registration)
    Tool registration metadata: name 'get_hwp_page_def', description, and inputSchema (type object with required file_path).
    {
      name: "get_hwp_page_def",
      description:
        "Get per-section page definition (paper size, margins, columns) and section properties. Useful for understanding document layout. Args: file_path.",
      inputSchema: {
        type: "object",
        properties: { file_path: { type: "string" } },
        required: ["file_path"],
      },
    },
  • src/server.ts:521-521 (registration)
    Handler mapping in the HANDLERS record: maps 'get_hwp_page_def' to the getHwpPageDef function.
    get_hwp_page_def: getHwpPageDef,
  • src/server.ts:17-17 (registration)
    Import of getHwpPageDef from the info.ts module.
    import { getHwpInfo, listHwpFields, getHwpFieldValue, getHwpPageDef } from "./tools/info.js";
Behavior2/5

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

No annotations provided, so description must carry full behavioral disclosure. It states 'Get' implying read-only, but does not mention side effects, required permissions, or what exactly is returned. Minimal transparency.

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 short (two sentences) and to the point, but it sacrifices important details. It is adequately concise for a simple tool, but lacks structure or front-loading of critical info.

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?

Given no output schema and one parameter, the description should explain what the tool returns and when it is appropriate to use. It only mentions 'per-section page definition' without specifying output format or use cases, leaving gaps.

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?

Schema description coverage is 0%, yet the description only restates the parameter name ('Args: file_path') without adding any meaning. It fails to explain what file_path should be (e.g., path format, accepted extensions).

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 it gets per-section page definition including paper size, margins, columns, and section properties, which is a specific verb+resource. It distinguishes from sibling tools (mostly append/delete/apply) as a read-only getter.

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?

The only usage guidance is 'Useful for understanding document layout,' which is vague. There is no explicit when to use or alternatives, especially among other getter tools like get_hwp_info or read_hwp_text.

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/treesoop/hwp-mcp'

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