xmcp 0.1.4 → 0.1.6
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.
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.js +1 -1
- package/dist/runtime/adapter-express.js +1 -1
- package/dist/runtime/adapter-nextjs.js +1 -1
- package/dist/runtime/http.js +1 -1
- package/dist/runtime/stdio.js +1 -1
- package/dist/types/tool.d.ts +32 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export interface ToolAnnotations {
|
|
3
|
+
/** Human-readable title for the tool */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** If true, the tool does not modify its environment */
|
|
6
|
+
readOnlyHint?: boolean;
|
|
7
|
+
/** If true, the tool may perform destructive updates */
|
|
8
|
+
destructiveHint?: boolean;
|
|
9
|
+
/** If true, repeated calls with same args have no additional effect */
|
|
10
|
+
idempotentHint?: boolean;
|
|
11
|
+
/** If true, tool interacts with external entities */
|
|
12
|
+
openWorldHint?: boolean;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface ToolMetadata {
|
|
16
|
+
/** Unique identifier for the tool */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Human-readable description */
|
|
19
|
+
description: string;
|
|
20
|
+
/** Optional hints about tool behavior */
|
|
21
|
+
annotations?: ToolAnnotations;
|
|
22
|
+
}
|
|
23
|
+
export interface Tool {
|
|
24
|
+
type: string;
|
|
25
|
+
handler: (args: any) => any;
|
|
26
|
+
metadata: ToolMetadata;
|
|
27
|
+
schema: Record<string, z.ZodType>;
|
|
28
|
+
}
|
|
29
|
+
export type ToolSchema = Record<string, z.ZodType<unknown, z.ZodTypeDef, unknown>>;
|
|
30
|
+
export type InferSchema<T extends ToolSchema> = {
|
|
31
|
+
[K in keyof T]: z.infer<T[K]>;
|
|
32
|
+
};
|