@datadive-tools/mcp 0.9.0 → 0.11.0
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/README.md +41 -16
- package/dist/index.js +342 -73
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +27 -4
- package/dist/lib.js +342 -73
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
package/dist/lib.d.ts
CHANGED
|
@@ -60,6 +60,29 @@ declare function loadConfig(env?: NodeJS.ProcessEnv): Config;
|
|
|
60
60
|
* is a one-file change (plus appending to `allTools` in tools/index.ts).
|
|
61
61
|
*/
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Tool annotations with `readOnlyHint` promoted to required.
|
|
65
|
+
*
|
|
66
|
+
* The MCP spec leaves every hint optional, but the in-product connector
|
|
67
|
+
* directories (Claude's Connectors Directory, ChatGPT's apps directory) reject a
|
|
68
|
+
* server whose tools do not declare read-vs-write behaviour, and a client cannot
|
|
69
|
+
* render an approval prompt without it. Making it required here means tool #N+1
|
|
70
|
+
* cannot silently regress the listing — the compiler catches it.
|
|
71
|
+
*
|
|
72
|
+
* Write tools (`readOnlyHint: false`) must additionally declare:
|
|
73
|
+
*
|
|
74
|
+
* - `destructiveHint` — per spec only meaningful on writes; Claude always prompts on it.
|
|
75
|
+
* - `openWorldHint` — OpenAI's plugin review requires it on every write tool: `true` if
|
|
76
|
+
* the tool changes publicly visible internet state, `false` for a closed system like a
|
|
77
|
+
* customer's own DataDive account. Missing or wrong values are a named rejection cause.
|
|
78
|
+
*/
|
|
79
|
+
type RequiredToolAnnotations = ToolAnnotations & ({
|
|
80
|
+
readOnlyHint: true;
|
|
81
|
+
} | {
|
|
82
|
+
readOnlyHint: false;
|
|
83
|
+
destructiveHint: boolean;
|
|
84
|
+
openWorldHint: boolean;
|
|
85
|
+
});
|
|
63
86
|
interface HandlerContext {
|
|
64
87
|
config: Config;
|
|
65
88
|
}
|
|
@@ -76,10 +99,10 @@ interface ToolDefinition<S extends z.ZodRawShape = z.ZodRawShape> {
|
|
|
76
99
|
/** Zod raw shape (object of Zod field schemas) — passed through to MCP SDK. */
|
|
77
100
|
inputSchema: S;
|
|
78
101
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
102
|
+
* MCP behavior hints so clients can flag token-spending write tools in their
|
|
103
|
+
* approval UI. `readOnlyHint` is mandatory; write tools also set `destructiveHint`.
|
|
81
104
|
*/
|
|
82
|
-
annotations
|
|
105
|
+
annotations: RequiredToolAnnotations;
|
|
83
106
|
/** Returns the data payload to be JSON-stringified in the tool response. */
|
|
84
107
|
handler: (args: z.infer<z.ZodObject<S>>, ctx: HandlerContext) => Promise<unknown>;
|
|
85
108
|
}
|
|
@@ -94,7 +117,7 @@ interface AnyTool {
|
|
|
94
117
|
title: string;
|
|
95
118
|
description: string;
|
|
96
119
|
inputSchema: z.ZodRawShape;
|
|
97
|
-
annotations
|
|
120
|
+
annotations: RequiredToolAnnotations;
|
|
98
121
|
handler: (args: Record<string, unknown>, ctx: HandlerContext) => Promise<unknown>;
|
|
99
122
|
}
|
|
100
123
|
|