{"record":{"id":"3d24d9fb61e878c8","repo":"googleapis/mcp-toolbox","slug":"error-generating-skill-md-content-w","errorCode":null,"errorMessage":"error generating SKILL.md content: %w","messagePattern":"error generating SKILL\\.md content: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/internal/skills/command.go","lineNumber":230,"sourceCode":"\t\t\tscriptContent, err := generateScriptContent(toolName, configArgsStr, cmd.licenseHeader, cmd.invocationMode, cmd.toolboxVersion, parser.OptionalEnvVars)\n\t\t\tif err != nil {\n\t\t\t\terrMsg := fmt.Errorf(\"error generating script content for %s: %w\", toolName, err)\n\t\t\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\t\t\treturn errMsg\n\t\t\t}\n\n\t\t\tscriptFilename := filepath.Join(scriptsPath, fmt.Sprintf(\"%s.js\", toolName))\n\t\t\tif err := os.WriteFile(scriptFilename, []byte(scriptContent), 0755); err != nil {\n\t\t\t\terrMsg := fmt.Errorf(\"error writing script %s: %w\", scriptFilename, err)\n\t\t\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\t\t\treturn errMsg\n\t\t\t}\n\t\t}\n\n\t\t// Generate SKILL.md\n\t\tskillContent, err := generateSkillMarkdown(skillName, content.description, cmd.additionalNotes, allTools, parser.EnvVars)\n\t\tif err != nil {\n\t\t\terrMsg := fmt.Errorf(\"error generating SKILL.md content: %w\", err)\n\t\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\t\treturn errMsg\n\t\t}\n\t\tskillMdPath := filepath.Join(skillPath, \"SKILL.md\")\n\t\tif err := os.WriteFile(skillMdPath, []byte(skillContent), 0644); err != nil {\n\t\t\terrMsg := fmt.Errorf(\"error writing SKILL.md: %w\", err)\n\t\t\topts.Logger.ErrorContext(ctx, errMsg.Error())\n\t\t\treturn errMsg\n\t\t}\n\n\t\topts.Logger.InfoContext(ctx, fmt.Sprintf(\"Successfully generated skill '%s' with %d tools.\", skillName, len(allTools)))\n\t}\n\n\treturn nil\n}\n\n// resolveSkillName returns the explicit --name when set. Otherwise, in the\n// single-skill modes it defaults to the --group or --toolset name, and for","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/cmd/internal/skills/command.go#L212-L248","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\ntoolbox skills --name my-skill --toolset all --additional-notes \"$(cat notes.txt)\"\n// after (validate the notes input is plain text)\ntoolbox skills --name my-skill --tools list_tables,execute_sql --additional-notes \"Use read-only queries.\"","handlingStrategy":"try-catch","validationCode":"// Validate inputs to markdown generation before running\ntext Notes; // ensure --additional-notes is plain UTF-8 text\nif [ -n \"$NOTES\" ] && ! printf '%s' \"$NOTES\" | iconv -f utf-8 -t utf-8 >/dev/null 2>&1; then\n  echo \"--additional-notes must be valid UTF-8\"; exit 1\nfi","typeGuard":null,"tryCatchPattern":"try {\n  execSync(\"toolbox skills --name my-skill\", { stdio: \"inherit\" });\n} catch (e) {\n  if (String(e.stderr).includes(\"error generating SKILL.md content\")) {\n    console.error(\"SKILL.md rendering failed; reduce toolset or check --additional-notes:\", e.stderr);\n  } else { throw e; }\n}","preventionTips":["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"],"tags":["go","cli","skills","markdown","template-generation"],"backgroundTag":"template-rendering-failed","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}