Editor/Mcp/BridgeNavigationTools.cs

Editor toolset wrapper for bridge_navigation MCP tools. Declares two editor RPCs: BakeNavmesh to start an async navmesh bake with agent parameters, and GetNavmeshPath to query a baked navmesh for a simple path between two world points.

Networking
// 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>
/// Bake the navmesh and query walkable paths.
/// </summary>
[McpToolset( "bridge_navigation", "Bake the navmesh and query walkable paths." )]
public static class BridgeNavigationTools
{
	/// <summary>
	/// Enable + bake the active scene's navigation mesh so NavMeshAgents can pathfind. This is an
	/// editor operation (NavMesh.BakeNavMesh), not a component. The bake runs ASYNC — it returns
	/// immediately with baking:true; the editor shows a progress bar and isGenerating flips false when
	/// done (give it a moment before querying paths). Optional agent params let you size the mesh to
	/// your characters.
	/// </summary>
	/// <param name="agentRadius">Agent radius (default scene setting).</param>
	/// <param name="agentHeight">Agent height.</param>
	/// <param name="agentStepSize">Max step-up height.</param>
	/// <param name="agentMaxSlope">Max walkable slope, degrees.</param>
	/// <param name="includeStaticBodies">Include static physics bodies in the bake.</param>
	[McpTool( "bake_navmesh" )]
	public static Task<object> BakeNavmesh( double? agentRadius = null, double? agentHeight = null, double? agentStepSize = null, double? agentMaxSlope = null, bool? includeStaticBodies = null )
		=> McpGate.Run( "bake_navmesh", McpGate.Args( ( "agentRadius", agentRadius ), ( "agentHeight", agentHeight ), ( "agentStepSize", agentStepSize ), ( "agentMaxSlope", agentMaxSlope ), ( "includeStaticBodies", includeStaticBodies ) ) );

	/// <summary>
	/// Query the baked navmesh for a walkable path between two world points (NavMesh.GetSimplePath).
	/// Returns the ordered path points, or reachable:false if no route exists. Requires bake_navmesh to
	/// have run first. Read-only — useful for validating connectivity, AI patrol routes, and spawn
	/// reachability.
	/// </summary>
	/// <param name="from">Start point (world space). As "x,y,z" (or JSON {x,y,z}).</param>
	/// <param name="to">Destination point (world space). As "x,y,z" (or JSON {x,y,z}).</param>
	[McpTool.ReadOnly( "get_navmesh_path" )]
	public static Task<object> GetNavmeshPath( string from, string to )
		=> McpGate.Run( "get_navmesh_path", McpGate.Args( ( "from", from ), ( "to", to ) ) );
}