API ReferenceEditor.Mcp

McpToolAttributeclass

Expose a static method as an MCP tool, callable by AI agents connected to the editor's MCP server. The method name (converted to snake_case) becomes the tool name unless one is given here, and the XML summary becomes the tool description the agent reads. Parameters become the tool's input schema - describe them with [Description]. Tools are invoked on the main thread and can return a Task to be async. Return values get serialized to json for the agent - return a `Sandbox.Bitmap` to send an image, or an `Editor.Mcp.McpResult` to compose text and images yourself. Agents find tools through search_tools and run them through call_tool - so the name and description are what make a tool discoverable.

objectAttributeMcpToolAttribute
Namespace
Editor.Mcp
Assembly
Sandbox.Tools
Declaration
public class Editor.Mcp.McpToolAttribute : System.Attribute

Constructors2

Showing 2 constructors

Properties2

Showing 2 properties

public Editor.Mcp.McpToolHints Editor.Mcp.McpToolAttribute.Hints { get; set; }PUBLICGETSET

Behaviour hints reported to the client, which may use them for permission prompts. A tool with no hints is assumed to write, and possibly destroy, state.

Returns:McpToolHints

public string Editor.Mcp.McpToolAttribute.Name { get; set; }PUBLICGETSET

The name agents call this tool by. Treat it as public API - agents and their workflows break when it changes.

Returns:string

On this page