docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ReadResourceParams

    Parameters for the Unity.ReadResource tool. Reads a resource by unity://path/... URI with optional slicing. Uses explicit defaults for clearer LLM guidance.

    Inheritance
    object
    ReadResourceParams
    Implements
    IEquatable<ReadResourceParams>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AI.MCP.Editor.ToolRegistry.Parameters
    Assembly: Unity.AI.MCP.Editor.dll
    Syntax
    public record ReadResourceParams : IEquatable<ReadResourceParams>

    Properties

    HeadBytes

    Gets or sets the number of bytes to read from the start of the file. Default is 0 (no byte limit, takes precedence over line-based slicing when set).

    Declaration
    [McpDescription("The number of bytes to read from the start of the file (default: 0 = no byte limit)", Required = false)]
    public int HeadBytes { get; set; }
    Property Value
    Type Description
    int

    LineCount

    Gets or sets the number of lines to read from the starting line. Default is -1 (read all lines from StartLine to end of file).

    Declaration
    [McpDescription("The number of lines to read (default: -1 = read all lines)", Required = false)]
    public int LineCount { get; set; }
    Property Value
    Type Description
    int

    ProjectRoot

    Gets or sets an override for the project root path. When null or empty, uses the current Unity project root.

    Declaration
    [McpDescription("Override project root path", Required = false)]
    public string ProjectRoot { get; set; }
    Property Value
    Type Description
    string

    Request

    Gets or sets a natural language request for content slicing. Examples: "last 120 lines", "show 40 lines around MethodName". Processed when explicit slicing parameters are at their defaults.

    Declaration
    [McpDescription("Natural language request for content slicing (e.g., 'last 120 lines', 'show 40 lines around MethodName')", Required = false)]
    public string Request { get; set; }
    Property Value
    Type Description
    string

    StartLine

    Gets or sets the starting line number for reading (1-based). Default is 1 (start from the beginning of the file).

    Declaration
    [McpDescription("The starting line number (1-based, default: 1 = start from beginning)", Required = false)]
    public int StartLine { get; set; }
    Property Value
    Type Description
    int

    TailLines

    Gets or sets the number of lines to read from the end of the file. Default is 0 (no tail limit, takes precedence over StartLine/LineCount when set).

    Declaration
    [McpDescription("The number of lines to read from the end of the file (default: 0 = no tail limit)", Required = false)]
    public int TailLines { get; set; }
    Property Value
    Type Description
    int

    Uri

    Gets or sets the resource URI to read (e.g., "unity://path/Assets/Scripts/MyScript.cs"). This is a required parameter.

    Declaration
    [McpDescription("The resource URI to read under Assets/", Required = true)]
    public string Uri { get; set; }
    Property Value
    Type Description
    string

    Implements

    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)