Editor toolset wrapper for asset-related MCP (bridge_asset) commands. It exposes methods to copy assets with dependencies, get asset info, install asset packages, list the asset library, recompile assets, and search assets, each calling McpGate.Run with appropriate arguments.
// AUTO-GENERATED by scripts/emit-mcp-wrappers.mjs — DO NOT EDIT.
// Regenerate: node scripts/extract-manifest.mjs && node scripts/emit-mcp-wrappers.mjs
// Source of truth: sbox-mcp-server/src/tools/ (zod schemas) → scripts/tools-manifest.json
using System.Text.Json.Nodes;
using System.Threading.Tasks;
using Editor.Mcp;
/// <summary>
/// Search the local asset library and sbox.game cloud assets, install packages, inspect asset
/// metadata, copy assets with their dependency closure, and recompile assets.
/// </summary>
[McpToolset( "bridge_asset", "Search the local asset library and sbox.game cloud assets, install packages, inspect asset metadata, copy assets with their dependency closure, and recompile assets." )]
public static class BridgeAssetTools
{
/// <summary>
/// Copy a project asset and its full dependency closure (via Asset.GetReferences(deep:true)) into a
/// target directory, preserving relative path structure so material references to textures keep
/// resolving. SHADOW GUARD: refuses to write under core engine trees (models/citizen, models/dev,
/// materials/dev, materials/default) -- copying there triggers an infinite asset-recompile loop
/// (BRIDGE_GOTCHAS #5). Cloud/procedural/transient assets are skipped with a reason. Returns {
/// copied:[{from,to}], skipped:[{path,reason}], count, note }.
/// </summary>
/// <param name="sourcePath">Absolute path OR project-relative path of the source asset (e.g. 'models/props/crate.vmdl'). Use search_assets to find the exact path.</param>
/// <param name="targetDir">Project-relative destination directory (e.g. 'Assets/library'). Defaults to 'Assets/library'.</param>
/// <param name="overwrite">Overwrite existing files at the destination. Defaults to false.</param>
[McpTool( "copy_asset_with_dependencies" )]
public static Task<object> CopyAssetWithDependencies( string sourcePath, string targetDir = null, bool? overwrite = null )
=> McpGate.Run( "copy_asset_with_dependencies", McpGate.Args( ( "sourcePath", sourcePath ), ( "targetDir", targetDir ), ( "overwrite", overwrite ) ) );
/// <summary>
/// Get detailed metadata about a specific asset — type, path, tags, package source.
/// </summary>
/// <param name="path">Asset path (e.g. 'models/citizen/citizen.vmdl').</param>
[McpTool.ReadOnly( "get_asset_info" )]
public static Task<object> GetAssetInfo( string path )
=> McpGate.Run( "get_asset_info", McpGate.Args( ( "path", path ) ) );
/// <summary>
/// Install a community asset package into the project by its ident (e.g. 'facepunch.flatgrass').
/// Adds it as a project dependency. Returns { installed, ident, name, path, relativePath,
/// restartRecommended, note } — pass the returned path to spawn_model / assign_model. CAUTION: if
/// the package is a code LIBRARY (adds a PackageReference), trigger_hotload will NOT surface its
/// types — call restart_editor so the new package compiles into the project.
/// </summary>
/// <param name="ident">Package identifier (e.g. 'facepunch.flatgrass', 'author.package_name').</param>
[McpTool( "install_asset" )]
public static Task<object> InstallAsset( string ident )
=> McpGate.Run( "install_asset", McpGate.Args( ( "ident", ident ) ) );
/// <summary>
/// List assets visible to the editor's AssetSystem — project assets plus mounted
/// engine/installed-package content (it does NOT query the remote sbox.game library; use
/// install_asset to pull in new packages). Returns { count, assets:[{ name, path, relativePath,
/// assetType }] } — pass a returned path to spawn_model, assign_model, or get_asset_info.
/// </summary>
/// <param name="query">Search term, case-insensitive substring match against asset NAMES.</param>
/// <param name="type">Asset type filter, substring-matched against the asset's type (e.g. 'model', 'material', 'sound').</param>
/// <param name="maxResults">Maximum results. Defaults to 200.</param>
[McpTool.ReadOnly( "list_asset_library" )]
public static Task<object> ListAssetLibrary( string query = null, string type = null, double? maxResults = null )
=> McpGate.Run( "list_asset_library", McpGate.Args( ( "query", query ), ( "type", type ), ( "maxResults", maxResults ) ) );
/// <summary>
/// Compile a project asset by path — registers it with the editor's AssetSystem then compiles it
/// (e.g. .vmat → .vmat_c). Use after writing/editing an asset with write_file so the change takes
/// effect without a manual editor step. Verified on materials. NOTE: the engine exposes no
/// reachable particle (.vpcf) compiler, so this can't compile particles — author those in
/// s&box's particle editor, then spawn_vpcf plays them.
/// </summary>
/// <param name="path">Asset path — project-relative (e.g. 'materials/foo.vmat') or absolute.</param>
[McpTool( "recompile_asset" )]
public static Task<object> RecompileAsset( string path )
=> McpGate.Run( "recompile_asset", McpGate.Args( ( "path", path ) ) );
/// <summary>
/// Search for assets in the project by name, type, or keyword. Returns models, materials, sounds,
/// textures, prefabs, etc.
/// </summary>
/// <param name="query">Search term to match against asset name or path.</param>
/// <param name="type">Asset type filter (e.g. 'model', 'material', 'sound', 'texture', 'prefab').</param>
/// <param name="maxResults">Maximum results to return. Defaults to 50.</param>
[McpTool.ReadOnly( "search_assets" )]
public static Task<object> SearchAssets( string query = null, string type = null, double? maxResults = null )
=> McpGate.Run( "search_assets", McpGate.Args( ( "query", query ), ( "type", type ), ( "maxResults", maxResults ) ) );
}