diff --git a/index.d.ts b/index.d.ts index 95a98f7..d9d305c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -95,6 +95,16 @@ declare namespace WebMCP { fromOrigins?: string[]; } + /** + * Options for executing a tool. + */ + interface ModelContextExecuteToolOptions { + /** + * An AbortSignal that can be used to cancel the execution of the tool. + */ + signal?: AbortSignal; + } + /** * Represents a tool that has been registered and is available for execution. */ @@ -149,6 +159,13 @@ declare namespace WebMCP { * @param options Filtering options. */ getTools(options?: ModelContextGetToolOptions): Promise; + /** + * Executes a tool on the document it was registered on. + * @param tool The tool to execute. + * @param inputObject The input parameters for the tool. + * @param options Execution options. + */ + executeTool(tool: RegisteredTool, inputObject?: object, options?: ModelContextExecuteToolOptions): Promise; /** * Event handler for the toolchange event. */