Editor/Tools/SettingsPublishingTools.Settings.cs

Editor tool entry point for a Mcp assistant that exposes project settings management. It defines a command ProjectSettings that accepts action, configName, key, and value parameters and delegates to ProjectSettingsDriver.ManageSettings, serializing the result or an error to JSON.

File Access
#nullable enable
using System;
using System.ComponentModel;

namespace Editor.Mcp
{
	public static partial class SboxMcpAssistant
	{
		[McpTool( "pocketknife_project_settings" )]
		public static string ProjectSettings(
			[Description( "Action: read, write, list_configs" )] string action = "list_configs",
			[Description( "Config file name (Platform, Collision, Input, Networking, Resources)" )] string? configName = null,
			[Description( "Setting key to update when writing" )] string? key = null,
			[Description( "Setting value to set when writing" )] string? value = null )
		{
			try
			{
				return McpJson.Write( ProjectSettingsDriver.ManageSettings( action, configName, key, value ) );
			}
			catch ( Exception ex )
			{
				return McpJson.Write( ToolOutcome<object>.Failure( null, ToolStatus.Failed, "settings.failed", "Project settings operation failed.", ex ) );
			}
		}
	}
}