Skip to main content
Glama
fop-label-mcp

fop-label-mcp

by kntys

generate_pdf

Creates print-ready label, badge, and POP PDFs from CSV data and JSON templates; validates rows and copies before imposing pages with crop marks and bleed.

Instructions

全行(copies 列があればその枚数ぶん)を用紙に面付けした PDF を出力する。 出力前に validate_csv と同じ確認を行い、足りない列・不正な copies・収まらない文字があれば PDF を作らずエラーを返す。ページ数・1枚あたりの面数・処理時間・警告を返す。最大 5,000 面。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "csv_path": "<csv_path>",
      "template": "<template>",
      "output_path": "<output_path>"
    },
    "name": "generate_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
colsNo列数を手動指定(省略時は自動で最大)
rowsNo行数を手動指定(省略時は自動で最大)
fontsNoフォント別名→TrueType(.ttf/.ttc) パスの対応。例 {"gothic": "/path/NotoSansJP.ttf"}。指定がなければ HeiseiKakuGo-W5 / HeiseiMin-W3(埋め込みなし)
paperNo用紙: A4, A3, A5, B4, B5, Letter など、または '210x297'(mm)A4
gap_mmNoラベル間の間隔 mm。省略時は 0(塗り足しありなら 2×塗り足し、トンボありならトンボ分も確保)。トンボありで狭すぎる場合はエラー
bleed_mmNo塗り足し mm(0〜3)。背景の四角を外側に伸ばす
csv_pathYesCSV ファイルのパス(絶対パス推奨)。1行目は見出し
encodingNoCSV の文字コード。utf-8(BOM 可)または shift_jisutf-8
templateYesテンプレート名(例: name_badge)または .json ファイルのパス
font_pathNo全ての文字にこの TrueType フォントを使う(サブセット埋め込み)
margin_mmNo用紙端の余白 mm(塗り足し・トンボが用紙からはみ出す場合は自動で広げる)
overwriteNo同名の PDF が既にあれば上書きする(既定は上書きせずエラー)
crop_marksNo各ラベルの四隅にトンボを付ける
orientationNo用紙の向き。auto は(cols/rows の指定を反映したうえで)面数が多くなる方。同数なら縦auto
output_pathYes保存先 PDF のパス(絶対パス推奨、許可されたフォルダの中)。フォルダを指定するとテンプレート名.pdf
template_dirNo追加のテンプレートフォルダ(許可されたフォルダの中)
allow_truncateNo最小サイズでも収まらない文字を末尾「…」で省略して出力する(既定はエラーにして出力しない)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description carries the whole burden, and it delivers: it discloses the pre-flight validation, that missing columns, invalid copies values, or overflowing text abort the run with no PDF written, and it names the returned metrics (page count, faces per sheet, processing time, warnings). It also states a hard ceiling of 5,000 faces, a limit that appears nowhere in the schema.

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

Conciseness4/5

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

Four short sentences, front-loaded with the core action and followed by failure behavior and return values in a logical order. No filler, though the clauses are densely packed and would benefit from slightly clearer separation of guarantees versus results.

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?

For a 17-parameter mutation tool with no output schema, the description covers the essential contract: validation gate, abort conditions, return summary, and a hard scalability limit. Remaining gaps are minor, such as the relationship to sibling templates tools and the overwrite precondition, both of which the schema covers at least partially.

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

Parameters3/5

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

Schema description coverage is 100%, so all 17 parameters are already documented in structured form and the baseline of 3 applies. The description adds only marginal parameter-adjacent meaning (the copies-column expansion rule, the 5,000-face cap, the error-by-default behavior that allow_truncate overrides) without explaining layout or font parameters beyond what the schema already says.

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 opening sentence names a specific verb and artifact: imposing every row (expanded by the copies column) onto sheets and emitting a PDF. It also implicitly separates itself from validate_csv by saying it re-runs that same validation internally rather than being a validation tool.

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?

Usage is implied rather than stated: the agent learns that validation is performed automatically before output, which suggests this is the terminal step after CSV preparation. However, there is no explicit guidance on when to prefer preview_label or describe_template first, nor any statement about when this tool should not be called.

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