Editor MCP tool wrapper that exposes an AimSimulate command. It parses parameters and calls SyntheticAimDriver.SimulateAim, returning the result as JSON, and catches exceptions to return a failure ToolOutcome serialized to JSON.
#nullable enable
using System;
using System.ComponentModel;
using Sandbox;
namespace Editor.Mcp
{
public static partial class SboxMcpAssistant
{
[McpTool( "pocketknife_aim_simulate" )]
public static string AimSimulate(
[Description( "Mode: angles (direct snap) or delta (relative mouse motion)" )] string mode = "angles",
[Description( "Target pitch in degrees (-89 to 89)" )] float pitch = 0f,
[Description( "Target yaw in degrees" )] float yaw = 0f,
[Description( "Target roll in degrees" )] float roll = 0f,
[Description( "Delta mouse X movement when mode is delta" )] float deltaX = 0f,
[Description( "Delta mouse Y movement when mode is delta" )] float deltaY = 0f )
{
try
{
var result = SyntheticAimDriver.SimulateAim( mode, pitch, yaw, roll, deltaX, deltaY );
return McpJson.Write( result );
}
catch ( Exception ex )
{
return McpJson.Write( ToolOutcome<object>.Failure( null, ToolStatus.Failed, "aim.simulate_failed", "Aim simulation failed.", ex ) );
}
}
}
}