webmcp-types 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +6 -1
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2,12 +2,17 @@
2
2
  * The WebMCP API enables web apps to provide JavaScript-based tools to AI agents.
3
3
  */
4
4
  declare namespace WebMCP {
5
+ /**
6
+ * Value that may be returned synchronously or via Promise.
7
+ */
8
+ type MaybePromise<T> = T | Promise<T>;
9
+
5
10
  /**
6
11
  * Callback for tool execution.
7
12
  * @param input The input parameters for the tool, as defined by its inputSchema.
8
13
  * @returns A promise that resolves with the tool's output.
9
14
  */
10
- type ToolExecuteCallback = (input: object) => Promise<any>;
15
+ type ToolExecuteCallback = (input: object) => MaybePromise<unknown>;
11
16
 
12
17
  /**
13
18
  * Metadata about a tool's behavior.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webmcp-types",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "repository": "webmachinelearning/webmcp-types",
5
5
  "homepage": "https://github.com/webmachinelearning/webmcp-types",
6
6
  "bugs": "https://github.com/webmachinelearning/webmcp-types/issues",