Skip to main content
Glama

Build an H5P package

build_h5p

Validate H5P content against deployment and content-type rules, then write a content-only .h5p package plus an optional HTML preview for review before upload.

Instructions

Build a content-only .h5p package (h5p.json and content/content.json, no libraries) from content written for one of list_h5p_types' types, in the shape its fields give. The content is checked first, with the rules a site applies when it deploys the package (required fields, kinds, limits, the HTML tags each text allows) and the type's own (a multiple choice with a right answer, a blank with its answer…); if anything is wrong nothing is written and the error lists what to fix. Plain text is escaped; where a field takes HTML, simple HTML with its allowed tags may be used. Buttons and messages are filled in the package's language. Writes /.h5p and, unless preview is false, .preview.html next to it: the content as a page to review before uploading. Confirm with the person before overwriting. The package plays only on a site with that type installed at that version; uploading it is another tool's job.

Input Schema

NameRequiredDescriptionDefault
nameNoThe file name without .h5p; by default made from the title
typeYesThe content type, such as H5P.MultiChoice (from list_h5p_types)
titleYesThe package's title, as the site will show it
contentYesThe content, in the shape list_h5p_types gives for the type
destDirYesAn existing folder to write the package in (absolute path)
previewNoWrite the HTML preview next to the package (default true)
languageYesThe content's language code, such as es or en: its buttons and messages come in it
overwriteNoReplace the package and preview if they exist; only once the person agrees

Output Schema

NameRequiredDescriptionDefault
pathYesThe package written
typeYes
titleYes
previewNoThe HTML preview written next to it
versionYesThe type's version the site must have
languageYes
warningsYesWhat the person should know, such as texts left in English

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well past the annotations: it discloses that validation runs before any write, that a failed check writes nothing and returns an error listing what to fix, the exact files produced (<destDir>/<name>.h5p plus optional <name>.preview.html), escaping behavior for plain text versus allowed HTML tags, and the compatibility limit that the package only plays on a site with that type installed at that version. That is the kind of consequence-level detail the readOnlyHint/destructiveHint flags cannot convey.

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?

Front-loaded with what is built and from what, then validation, then outputs. It is a dense single block and could be split for scanability, but each sentence carries distinct information about behavior rather than restating the schema.

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

Completeness5/5

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

Covers everything an agent needs for an eight-parameter, nested-content, file-writing tool: input provenance, validation outcomes, exact output locations, language handling, overwrite safety, and post-build compatibility. An output schema exists, so return values need no elaboration.

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 coverage is 100%, so baseline is 3; the description adds real meaning beyond it by explaining that name defaults from title, that preview writes the HTML page unless false (matching the schema default), and that language drives the buttons and messages inside the package. It does not elaborate on overwrite's failure modes beyond the confirmation requirement.

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?

A precise verb plus resource plus scope: builds a content-only .h5p package with h5p.json and content/content.json and no libraries, sourced from list_h5p_types. It is unmistakable against read_h5p, list_h5p_types and server_info, and even names the sibling that supplies the input shape.

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?

Gives a clear precondition (content must be written for one of list_h5p_types' types and in the shape its fields give) and a scope boundary (uploading is another tool's job; confirm with the person before overwriting). It stops short of naming a specific alternative tool for upload or preview review, so routing is implied rather than explicit.

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

Deploy Server

Other Tools