Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -149,6 +159,13 @@ declare namespace WebMCP {
* @param options Filtering options.
*/
getTools(options?: ModelContextGetToolOptions): Promise<RegisteredTool[]>;
/**
* 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<string>;
/**
* Event handler for the toolchange event.
*/
Expand Down