googleapis/mcp-toolbox · error
error generating SKILL.md content: %w
Error message
error generating SKILL.md content: %w
What it means
This error wraps a failure from generateSkillMarkdown, which renders the SKILL.md documentation file describing the skill and its tools. Script generation succeeded for all tools, but assembling the markdown content failed; the command logs and aborts before writing SKILL.md.
Source
Thrown at cmd/internal/skills/command.go:230
scriptContent, err := generateScriptContent(toolName, configArgsStr, cmd.licenseHeader, cmd.invocationMode, cmd.toolboxVersion, parser.OptionalEnvVars)
if err != nil {
errMsg := fmt.Errorf("error generating script content for %s: %w", toolName, err)
opts.Logger.ErrorContext(ctx, errMsg.Error())
return errMsg
}
scriptFilename := filepath.Join(scriptsPath, fmt.Sprintf("%s.js", toolName))
if err := os.WriteFile(scriptFilename, []byte(scriptContent), 0755); err != nil {
errMsg := fmt.Errorf("error writing script %s: %w", scriptFilename, err)
opts.Logger.ErrorContext(ctx, errMsg.Error())
return errMsg
}
}
// Generate SKILL.md
skillContent, err := generateSkillMarkdown(skillName, content.description, cmd.additionalNotes, allTools, parser.EnvVars)
if err != nil {
errMsg := fmt.Errorf("error generating SKILL.md content: %w", err)
opts.Logger.ErrorContext(ctx, errMsg.Error())
return errMsg
}
skillMdPath := filepath.Join(skillPath, "SKILL.md")
if err := os.WriteFile(skillMdPath, []byte(skillContent), 0644); err != nil {
errMsg := fmt.Errorf("error writing SKILL.md: %w", err)
opts.Logger.ErrorContext(ctx, errMsg.Error())
return errMsg
}
opts.Logger.InfoContext(ctx, fmt.Sprintf("Successfully generated skill '%s' with %d tools.", skillName, len(allTools)))
}
return nil
}
// resolveSkillName returns the explicit --name when set. Otherwise, in the
// single-skill modes it defaults to the --group or --toolset name, and forView on GitHub (pinned to 8cc6e09de2)
Solutions
- Re-run the command to confirm determinism and inspect which skill/tools were being processed
- Check the --additional-notes value and the config's tool descriptions for malformed or problematic content
- Regenerate with fewer tools (--tools/--toolset) to isolate the tool whose metadata breaks rendering
- Update the toolbox binary to the latest patch version
- If persistent, file an issue with the failing config (redacted) for the maintainers
Example fix
// before toolbox skills --name my-skill --toolset all --additional-notes "$(cat notes.txt)" // after (validate the notes input is plain text) toolbox skills --name my-skill --tools list_tables,execute_sql --additional-notes "Use read-only queries."
Defensive patterns
Strategy: try-catch
Validate before calling
// Validate inputs to markdown generation before running text Notes; // ensure --additional-notes is plain UTF-8 text if [ -n "$NOTES" ] && ! printf '%s' "$NOTES" | iconv -f utf-8 -t utf-8 >/dev/null 2>&1; then echo "--additional-notes must be valid UTF-8"; exit 1 fi
Try / catch
try {
execSync("toolbox skills --name my-skill", { stdio: "inherit" });
} catch (e) {
if (String(e.stderr).includes("error generating SKILL.md content")) {
console.error("SKILL.md rendering failed; reduce toolset or check --additional-notes:", e.stderr);
} else { throw e; }
} Prevention
- Keep --additional-notes simple plain text
- Regenerate after toolbox upgrades so template expectations match config metadata
- Generate skills from a clean, validated config rather than ad-hoc edited ones
- Isolate failures by generating per-toolset before combining
When it happens
Trigger: Running `toolbox skills` when generateSkillMarkdown(skillName, content.description, cmd.additionalNotes, allTools, parser.EnvVars) returns an error — e.g. template execution failure while rendering tool descriptions, env var tables, or additional notes into the markdown template.
Common situations: A tool whose description or parameter metadata contains content the markdown template cannot render; a config with unusual --additional-notes input; a toolset mixing tools from mismatched config versions producing unexpected data shapes passed to the template.
Related errors
- error generating script content for %s: %w
- failed to initialize resources: %w
- tool %q not found
- unable to retrieve source for tool %s
- error writing script %s: %w
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/3d24d9fb61e878c8.
Report an issue: GitHub.