Skip to main content
Glama

Scaffold Garry's Mod Component

scaffold_gmod_component
Idempotent

Generate realm-separated GLua boilerplate for 10 Garry's Mod component types. Write to disk or preview virtually to bootstrap addons with idiomatic structure.

Instructions

Generate production-grade, realm-separated Garry's Mod boilerplate code for 10 standard component architectures: SWEP (weapons), SENT (scripted entities), nextbot (NextBot AI with pathfinding coroutines), custom_tool (toolgun STOOLs with CPanel), vgui_panel (Derma UI), hud (Zero-GC HUDPaint overlays), gamemode (GM framework), effect (dynamic particle render effects), darkrp_module (DarkRP jobs, shipments, categories), and addon_skeleton (standard directory layout with addon.json). Dual operational mode: when output_dir is omitted (default), operates as a zero-side-effect preview returning a virtual code_manifest without touching the disk; when output_dir is provided, writes files directly to disk relative to workspace, creating directories and overwriting existing files at target paths. Implements idiomatic realm separation (e.g. server init.lua, client cl_init.lua with AddCSLuaFile headers, shared.lua). Requires component_type (enum: 'swep', 'sent', 'nextbot', 'custom_tool', 'vgui_panel', 'hud', 'gamemode', 'effect', 'darkrp_module', 'addon_skeleton') and alphanumeric identifier name (e.g. 'weapon_plasma_rifle', 'nb_stalker', 'tool_remover'). Optional output_dir designates target folder on disk. Optional options object configures category, base class, author, printable_name, and vgui_type ('frame', 'button', 'scroll', 'custom'). Use this tool when bootstrapping new Garry's Mod addons, weapons, entities, AI nextbots, STOOLs, or UI panels with idiomatic architecture and prediction support. Do NOT use for editing existing code or linting (use lint_glua). After scaffolding, use package_and_validate to verify Steam Workshop packaging compliance. Returns a GModToolResult envelope with status ('success' or 'failed'), summary, and data containing component_type, files_created array (path, purpose), and code_manifest mapping relative file paths to generated Lua source code strings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesUnique technical identifier for the component (e.g. 'weapon_plasma_rifle', 'ent_crate', 'vgui_scoreboard', 'tool_remover'). Must be alphanumeric with underscores or dashes.
optionsNoOptional metadata configuring component inheritance, display names, and base classes.
output_dirNoOptional workspace destination directory. If omitted, files are NOT written to disk and only returned in code_manifest (preview mode). If provided, files are written to disk relative to workspace, creating folders as needed and overwriting existing files at those paths.
component_typeYesThe architectural Garry's Mod component type to scaffold ('swep', 'sent', 'nextbot', 'custom_tool', 'vgui_panel', 'hud', 'gamemode', 'effect', 'darkrp_module', or 'addon_skeleton').

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesDomain-specific typed payload returned by the tool.
statusYesExecution status of the tool call ('success', 'partial', 'blocked', or 'failed').
summaryYesConcise, human-readable summary of operational findings, diagnostics, or execution outcome.
evidenceYesTraceability evidence including cited documentation and generated artifacts.
warningsYesList of non-fatal warnings, lint advisories, engine caveats, or security notices.
nextActionsNoActionable, ordered recommendations for the agent's immediate next steps.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • changedInput schema / properties / component_type / description
      Previous value: -"Type of Garry's Mod component to scaffold"New value: +"The architectural Garry's Mod component type to scaffold ('swep', 'sent', 'nextbot', 'custom_tool', 'vgui_panel', 'hud', 'gamemode', 'effect', 'darkrp_module', or 'addon_skeleton')."
    • changedInput schema / properties / component_type / enum
      Previous value: -[
      -  "swep",
      -  "sent",
      -  "vgui_panel",
      -  "custom_tool",
      -  "hud",
      -  "gamemode",
      -  "addon_skeleton"
      -]New value: +[
      +  "swep",
      +  "sent",
      +  "nextbot",
      +  "custom_tool",
      +  "vgui_panel",
      +  "hud",
      +  "gamemode",
      +  "effect",
      +  "darkrp_module",
      +  "addon_skeleton"
      +]
    • changedInput schema / properties / name / description
      Previous value: -"Identifier (e.g. 'weapon_plasma_rifle', 'ent_crate')"New value: +"Unique technical identifier for the component (e.g. 'weapon_plasma_rifle', 'ent_crate', 'vgui_scoreboard', 'tool_remover'). Must be alphanumeric with underscores or dashes."
    • addedInput schema / properties / name / minLength
      Added value: +1
    • addedInput schema / properties / options / description
      Added value: +"Optional metadata configuring component inheritance, display names, and base classes."
    • addedInput schema / properties / options / properties / author / description
      Added value: +"Author name embedded into file headers and metadata."
    • addedInput schema / properties / options / properties / base / description
      Added value: +"Base class to inherit from (e.g. 'weapon_base', 'base_anim')."
    • addedInput schema / properties / options / properties / category / description
      Added value: +"Spawnmenu category (e.g. 'Custom Weapons', 'Fun + Games')."
    • addedInput schema / properties / options / properties / printable_name / description
      Added value: +"User-facing UI name displayed in spawnmenu and HUD."
    • addedInput schema / properties / options / properties / vgui_type / description
      Added value: +"Derma UI base template when scaffolding a vgui_panel ('frame', 'button', 'scroll', or 'custom')."
    • changedInput schema / properties / output_dir / description
      Previous value: -"Workspace folder to write generated files to"New value: +"Optional workspace destination directory. If omitted, files are NOT written to disk and only returned in code_manifest (preview mode). If provided, files are written to disk relative to workspace, creating folders as needed and overwriting existing files at those paths."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "data": {
      +      "description": "Domain-specific typed payload returned by the tool.",
      +      "properties": {
      +        "code_manifest": {
      +          "additionalProperties": {
      +            "type": "string"
      +          },
      +          "description": "Key-value map of relative file path to generated boilerplate GLua code.",
      +          "type": "object"
      +        },
      +        "component_type": {
      +          "description": "The scaffolded component architecture.",
      +          "enum": [
      +            "swep",
      +            "sent",
      +            "vgui_panel",
      +            "custom_tool",
      +            "hud",
      +            "gamemode",
      +            "addon_skeleton"
      +          ],
      +          "type": "string"
      +        },
      +        "files_created": {
      +          "description": "List of files scaffolded on disk or generated in manifest.",
      +          "items": {
      +            "properties": {
      +              "path": {
      +                "description": "Relative file path in Garry's Mod addon structure.",
      +                "type": "string"
      +              },
      +              "purpose": {
      +                "description": "Role of this file (e.g. 'Server init script', 'Shared weapon logic').",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "path",
      +              "purpose"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "component_type",
      +        "files_created",
      +        "code_manifest"
      +      ],
      +      "type": "object"
      +    },
      +    "evidence": {
      +      "description": "Traceability evidence including cited documentation and generated artifacts.",
      +      "properties": {
      +        "artifacts": {
      +          "description": "Files, packages, or manifests generated on disk or in memory.",
      +          "items": {
      +            "properties": {
      +              "label": {
      +                "description": "Descriptive label of the generated artifact.",
      +                "type": "string"
      +              },
      +              "sha256": {
      +                "description": "SHA-256 hash of the generated file.",
      +                "type": "string"
      +              },
      +              "uri": {
      +                "description": "File path or URI of the generated artifact.",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "label",
      +              "uri"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "inputsDigest": {
      +          "description": "SHA-256 digest of normalized tool inputs for auditability.",
      +          "type": "string"
      +        },
      +        "sources": {
      +          "description": "Cited documentation, wiki pages, or external web sources supporting the result.",
      +          "items": {
      +            "properties": {
      +              "label": {
      +                "description": "Display name or title of the cited resource.",
      +                "type": "string"
      +              },
      +              "retrievedAt": {
      +                "description": "ISO-8601 timestamp of source retrieval.",
      +                "type": "string"
      +              },
      +              "uri": {
      +                "description": "Canonical URI or URL of the documentation or source.",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "label"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "sources",
      +        "artifacts"
      +      ],
      +      "type": "object"
      +    },
      +    "nextActions": {
      +      "description": "Actionable, ordered recommendations for the agent's immediate next steps.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "status": {
      +      "description": "Execution status of the tool call ('success', 'partial', 'blocked', or 'failed').",
      +      "enum": [
      +        "success",
      +        "partial",
      +        "blocked",
      +        "failed"
      +      ],
      +      "type": "string"
      +    },
      +    "summary": {
      +      "description": "Concise, human-readable summary of operational findings, diagnostics, or execution outcome.",
      +      "type": "string"
      +    },
      +    "warnings": {
      +      "description": "List of non-fatal warnings, lint advisories, engine caveats, or security notices.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "status",
      +    "summary",
      +    "data",
      +    "warnings",
      +    "evidence"
      +  ],
      +  "type": "object"
      +}
  2. First observedv1.0.0

TDQS

A4.2/5.0
Behavior1/5

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

The description states that when output_dir is provided, it 'writes files directly to disk... overwriting existing files at target paths.' This is a destructive behavior, yet the annotation declares destructiveHint=false. This is a direct contradiction, which must be flagged. The description otherwise provides rich behavioral detail (dual mode, preview vs write), but the contradiction makes it misleading.

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 is long but efficiently structured: purpose first, then operational mode, then parameter details, then usage guidance and post-scaffolding steps. Every sentence adds new information—no redundancy. Front-loading the component list and dual-mode behavior ensures critical decisions are made early.

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?

Given the tool's complexity (4 params, nested options, 10 component types, dual modes) and the presence of an output schema, the description covers all necessary aspects: what it generates, how to control output, parameter constraints, usage boundaries, and return envelope. No critical detail is missing.

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

Parameters5/5

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

The input schema already has 100% coverage, but the description goes well beyond by explaining the meaning of each parameter: component_type enum values, alphanumeric name requirements with examples, output_dir's preview vs write semantics, and options object fields with example values. It adds contextual meaning that helps an agent choose appropriate values without opening the schema.

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 a specific verb ('Generate') and resource ('Garry's Mod boilerplate code') with a comprehensive list of 10 component architectures. It distinguishes itself from siblings by explicitly naming lint_glua and package_and_validate as alternatives for editing/linting and verification respectively.

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

Usage Guidelines5/5

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

Provides explicit guidance: 'Use this tool when bootstrapping new Garry's Mod addons... Do NOT use for editing existing code or linting (use lint_glua).' It also chains the workflow by recommending package_and_validate after scaffolding. This leaves no ambiguity about when to select this tool.

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