Skip to content

Conversation

@mainVar
Copy link
Collaborator

@mainVar mainVar commented Nov 2, 2025

MCPTools:

Functional text filter and “Type” dropdown (Enabled / Disabled / All).

Saving the enabled/disabled state of tools via EditorPrefs (JSON).

Improved ToolItem template: classes are now added via AddToClassList / EnableInClassList.

Added extended mock tool data for testing.

Styles (USS): made compatible and safe changes; the toggle now has a consistent visual state and simple animation/movement (taking into account USS parser limitations).

@mainVar mainVar requested a review from IvanMurzak November 2, 2025 19:09
@mainVar mainVar self-assigned this Nov 2, 2025
@IvanMurzak IvanMurzak added the enhancement New feature or request label Nov 2, 2025
@IvanMurzak
Copy link
Owner

Update merged into this branch

  • Data save and load from json config file is added
  • Enabled / Disabled tool data is provided.
var tools = UnityMcpPlugin.Instance.Tools;
if (tools != null)
{
    foreach (var tool in tools.GetAllTools())
    {
        // Get Enabled state of a tool
        var isEnabled = tools.IsToolEnabled(tool.Name);

        // Set Enabled state of a tool
        tools.SetToolEnabled(tool.Name, isEnabled);
    }
}

Need to do

Whenever you can please add it @mainVar

List

  • Read tools and filter them by
    • Title substring
    • Enabled status
  • Show amount of filtered and total tools
image

List item

  • Read tool Title and set the value to UI
  • Read tool Name (id) and set the value to UI
  • Read tool Description and set the value to UI
  • Read Enabled state and set the value to UI
  • Set Enabled state based on the toggle switch by user click
  • Read list of input arguments and show the data
  • Read list of outputs and show the data (it should look the same as input arguments, just instead of input arguments it should outputs
image

Here is the code sample for reading the data from tool

Read input arguments

// Get input arguments list
if (tool.InputSchema?.AsObject().TryGetPropertyValue(JsonSchema.Properties, out var inputProperties) == true)
{
    // if we get here, it means that tool has input properties

    foreach (var inputItem in inputProperties!.AsObject())
    {
        // inputName - name of the input property
        var inputName = inputItem.Key;

        // hasDescription - indicates if the description property exists
        // inputDescription - contains the actual description value if it exists
        var hasDescription = inputItem.Value?.AsObject().TryGetPropertyValue(JsonSchema.Description, out var inputDescription);
    }
}

Read outputs

// Get output items list
if (tool.OutputSchema?.AsObject().TryGetPropertyValue(JsonSchema.Properties, out var outputProperties) == true)
{
    // if we get here, it means that tool has output properties

    foreach (var outputItem in outputProperties!.AsObject())
    {
        // outputName - name of the output property
        var outputName = outputItem.Key;

        // hasDescription - indicates if the description property exists
        // outputDescription - contains the actual description value if it exists
        var hasDescription = outputItem.Value?.AsObject().TryGetPropertyValue(JsonSchema.Description, out var outputDescription);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants