Skip to main content
Glama

list_hwp_bindata

List image and binary attachments inside an .hwpx file to inspect contents before replacing images.

Instructions

List ZIP entries under BinData/ inside an .hwpx (image and binary attachments). Useful before replace_hwp_image. Args: file_path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Implementation Reference

  • The main handler function for the 'list_hwp_bindata' tool. Validates file existence, ensures format is .hwpx, then calls listHwpxBinDataEntries to list BinData entries.
    export async function listHwpBinData(args: ListBinDataArgs): Promise<string> {
      if (!existsSync(args.file_path)) {
        return `파일을 찾을 수 없습니다 (file not found): ${args.file_path}`;
      }
      let fmt;
      try {
        fmt = getFormatFromPath(args.file_path);
      } catch (e) {
        return (e as Error).message;
      }
      if (fmt !== "hwpx") {
        return "v0.2은 .hwpx 만 지원 (BinData listing requires .hwpx in v0.2).";
      }
      const entries = await listHwpxBinDataEntries(args.file_path);
      if (entries.length === 0) return "(BinData 엔트리 없음 / no BinData entries)";
      return entries.map((e, i) => `${i + 1}. ${e}`).join("\n");
    }
  • The core utility that lists BinData/ entries inside a .hwpx ZIP archive by reading the file and filtering ZIP entries starting with 'BinData/'.
    export async function listHwpxBinDataEntries(inputPath: string): Promise<string[]> {
      const bytes = await readFile(inputPath);
      const zip = await JSZip.loadAsync(bytes);
      return Object.keys(zip.files)
        .filter((n) => n.startsWith("BinData/"))
        .sort();
    }
  • TypeScript interface defining the input schema (only file_path string required).
    export interface ListBinDataArgs {
      file_path: string;
    }
  • src/server.ts:165-173 (registration)
    Tool registration in the tools array: name, description, and inputSchema (JSON Schema) for list_hwp_bindata.
      name: "list_hwp_bindata",
      description:
        "List ZIP entries under BinData/ inside an .hwpx (image and binary attachments). Useful before replace_hwp_image. Args: file_path.",
      inputSchema: {
        type: "object",
        properties: { file_path: { type: "string" } },
        required: ["file_path"],
      },
    },
  • src/server.ts:524-524 (registration)
    Mapping the tool name to its handler function in the server's tool handler lookup.
    list_hwp_bindata: listHwpBinData,
  • src/server.ts:16-16 (registration)
    Import statement pulling listHwpBinData from src/tools/replace-image.ts.
    import { replaceHwpImage, listHwpBinData } from "./tools/replace-image.js";
Behavior3/5

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

No annotations are provided, so the description must carry the full burden. It states the tool lists ZIP entries under BinData/ but does not disclose any behavioral traits such as error handling, permissions, or output format. For a simple list operation, this is adequate but not thorough.

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

Conciseness5/5

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

The description consists of two short sentences that are front-loaded with the core purpose and then a brief usage hint. Every sentence adds value with no wasted words.

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

Completeness4/5

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

Given the tool's simplicity (one parameter, no nested objects, no output schema), the description adequately covers its purpose and usage. The lack of output format details is acceptable for a list operation that the agent can infer.

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

Parameters2/5

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

The schema description coverage is 0%, and the description only adds 'Args: file_path' without providing any additional meaning about the parameter's format, constraints, or purpose beyond its name. This fails to compensate for the lack of schema documentation.

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 'List ZIP entries under BinData/ inside an .hwpx (image and binary attachments)' with a specific verb and resource. It also distinguishes from siblings like list_hwp_images by noting it is useful before replace_hwp_image.

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

Usage Guidelines4/5

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

The description explicitly says 'Useful before replace_hwp_image', providing clear context for when to use this tool. However, it does not mention when not to use it or provide alternatives beyond this one sibling.

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