Tool Class
A tool registered by a document and exposed to another document, or to the application (https://webmachinelearning.github.io/webmcp/#tool-interface, as defined by webmachinelearning/webmcp#348, which replaces the RegisteredTool dictionary): a snapshot of the tool when ModelContext.GetTools or BrowsingContext.GetModelContextTools discovered it, which identifies this registration of the tool: once the tool is unregistered, it cannot be executed anymore, even when a tool with the same name is registered again.
public sealed class ToolProperties
| Name | Description |
|---|---|
| Annotations | Gets the annotations of the tool as a value for the scripts (a JavaScript object, created by the script engine once), or null when the tool was registered without annotations. The .NET code reads Tool.ToolAnnotations. |
| Description | Gets the natural language description of the tool. |
| Document | Gets the document that registered the tool. |
| InputSchema | Gets the JSON Schema of the input arguments as a value for the scripts (a JavaScript object, parsed by the script engine once), or null. The .NET code reads Tool.InputSchemaJson. |
| InputSchemaJson | Gets the JSON Schema of the input arguments, as JSON text, or null when the tool was registered without one. |
| Name | Gets the name of the tool. |
| Origin | Gets the serialization of the origin of the document that registered the tool (null for an opaque origin). |
| OutputSchema | Gets the JSON Schema of the result as a value for the scripts (a JavaScript object, parsed by the script engine once), or null. The .NET code reads Tool.OutputSchemaJson. |
| OutputSchemaJson | Gets the JSON Schema of the result, as JSON text, or null when the tool was registered without one. |
| Title | Gets the human-readable title of the tool, or the empty string when it has none. |
| ToolAnnotations | Gets the annotations of the tool, or null when the tool was registered without annotations. |
| Window | Gets the window of the document that registered the tool, or null when its browsing context was destroyed (e.g. its iframe was removed). |
Annotations
ModelContextTypes.csGets the annotations of the tool as a value for the scripts (a JavaScript object, created by the script engine once), or null when the tool was registered without annotations. The .NET code reads Tool.ToolAnnotations.
public object? Annotations { get; }Description
ModelContextTypes.csGets the natural language description of the tool.
public string Description { get; }Document
ModelContextTypes.csInputSchema
ModelContextTypes.csGets the JSON Schema of the input arguments as a value for the scripts (a JavaScript object, parsed by the script engine once), or null. The .NET code reads Tool.InputSchemaJson.
public object? InputSchema { get; }InputSchemaJson
ModelContextTypes.csGets the name of the tool.
public string Name { get; }Origin
ModelContextTypes.csGets the serialization of the origin of the document that registered the tool (null for an opaque origin).
public string Origin { get; }OutputSchema
ModelContextTypes.csGets the JSON Schema of the result as a value for the scripts (a JavaScript object, parsed by the script engine once), or null. The .NET code reads Tool.OutputSchemaJson.
public object? OutputSchema { get; }OutputSchemaJson
ModelContextTypes.csTitle
ModelContextTypes.csGets the human-readable title of the tool, or the empty string when it has none.
public string Title { get; }ToolAnnotations
ModelContextTypes.csGets the annotations of the tool, or null when the tool was registered without annotations.
public ToolAnnotations? ToolAnnotations { get; }Property value
Window
ModelContextTypes.csGets the window of the document that registered the tool, or null when its browsing context was destroyed (e.g. its iframe was removed).
public Window? Window { get; }Methods
| Name | Description |
|---|---|
| ToString() | Returns a string that represents the current object. |