@mondaydotcomorg/agent-toolkit 2.2.0 → 2.4.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/dist/cjs/core/index.d.ts +26 -3
- package/dist/cjs/core/index.js +25 -18
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.d.ts +134 -6
- package/dist/cjs/mcp/index.js +26 -18
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.d.ts +5 -0
- package/dist/cjs/openai/index.js +25 -18
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.d.ts +26 -3
- package/dist/esm/core/index.js +25 -18
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.d.ts +134 -6
- package/dist/esm/mcp/index.js +26 -18
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.d.ts +5 -0
- package/dist/esm/openai/index.js +25 -18
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +5 -2
package/dist/cjs/mcp/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { ApiClientConfig } from '@mondaydotcomorg/api';
|
|
3
|
+
import { ZodRawShape, z, ZodTypeAny } from 'zod';
|
|
4
|
+
import { ToolAnnotations } from '@modelcontextprotocol/sdk/types';
|
|
3
5
|
|
|
4
6
|
declare enum ToolMode {
|
|
5
7
|
API = "api",
|
|
@@ -11,6 +13,7 @@ type ToolsConfiguration = {
|
|
|
11
13
|
readOnlyMode?: boolean;
|
|
12
14
|
mode?: ToolMode;
|
|
13
15
|
enableDynamicApiTools?: boolean | 'only';
|
|
16
|
+
enableToolManager?: boolean;
|
|
14
17
|
};
|
|
15
18
|
type MondayAgentToolkitConfig = {
|
|
16
19
|
mondayApiToken: ApiClientConfig['token'];
|
|
@@ -25,6 +28,7 @@ type MondayAgentToolkitConfig = {
|
|
|
25
28
|
declare class MondayAgentToolkit extends McpServer {
|
|
26
29
|
private readonly mondayApiClient;
|
|
27
30
|
private readonly mondayApiToken;
|
|
31
|
+
private readonly dynamicToolManager;
|
|
28
32
|
/**
|
|
29
33
|
* Creates a new instance of the Monday Agent Toolkit
|
|
30
34
|
* @param config Configuration for the toolkit
|
|
@@ -38,6 +42,10 @@ declare class MondayAgentToolkit extends McpServer {
|
|
|
38
42
|
* Register all tools with the MCP server
|
|
39
43
|
*/
|
|
40
44
|
private registerTools;
|
|
45
|
+
/**
|
|
46
|
+
* Register the management tool with toolkit reference
|
|
47
|
+
*/
|
|
48
|
+
private registerManagementTool;
|
|
41
49
|
/**
|
|
42
50
|
* Initialize both API and CLI tools
|
|
43
51
|
*/
|
|
@@ -45,15 +53,27 @@ declare class MondayAgentToolkit extends McpServer {
|
|
|
45
53
|
/**
|
|
46
54
|
* Register a single tool with the MCP server
|
|
47
55
|
*/
|
|
48
|
-
private
|
|
56
|
+
private registerSingleTool;
|
|
57
|
+
/**
|
|
58
|
+
* Dynamically enable a tool
|
|
59
|
+
*/
|
|
60
|
+
enableTool(toolName: string): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Dynamically disable a tool
|
|
63
|
+
*/
|
|
64
|
+
disableTool(toolName: string): boolean;
|
|
49
65
|
/**
|
|
50
|
-
*
|
|
66
|
+
* Check if a tool is enabled
|
|
51
67
|
*/
|
|
52
|
-
|
|
68
|
+
isToolEnabled(toolName: string): boolean;
|
|
53
69
|
/**
|
|
54
|
-
*
|
|
70
|
+
* Get list of all available tools and their status
|
|
55
71
|
*/
|
|
56
|
-
|
|
72
|
+
getToolsStatus(): Record<string, boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* Get list of all dynamic tool names
|
|
75
|
+
*/
|
|
76
|
+
getDynamicToolNames(): string[];
|
|
57
77
|
getServer(): McpServer;
|
|
58
78
|
/**
|
|
59
79
|
* Format the tool result into the expected MCP format
|
|
@@ -65,4 +85,112 @@ declare class MondayAgentToolkit extends McpServer {
|
|
|
65
85
|
private handleToolError;
|
|
66
86
|
}
|
|
67
87
|
|
|
68
|
-
|
|
88
|
+
interface Executable<Input, Output> {
|
|
89
|
+
execute: (input?: Input) => Promise<Output>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
type ToolInputType<Input extends ZodRawShape | undefined> = Input extends ZodRawShape ? z.objectOutputType<Input, ZodTypeAny> : undefined;
|
|
93
|
+
type ToolOutputType<T extends Record<string, unknown>> = {
|
|
94
|
+
content: string;
|
|
95
|
+
metadata?: T;
|
|
96
|
+
};
|
|
97
|
+
declare enum ToolType {
|
|
98
|
+
READ = "read",
|
|
99
|
+
WRITE = "write",
|
|
100
|
+
ALL_API = "all_api"
|
|
101
|
+
}
|
|
102
|
+
interface Tool<Input extends ZodRawShape | undefined, Output extends Record<string, unknown> = never> extends Executable<ToolInputType<Input>, ToolOutputType<Output>> {
|
|
103
|
+
name: string;
|
|
104
|
+
type: ToolType;
|
|
105
|
+
annotations: ToolAnnotations;
|
|
106
|
+
/** Whether the tool is enabled by default. Defaults to true if not specified. */
|
|
107
|
+
enabledByDefault?: boolean;
|
|
108
|
+
getDescription(): string;
|
|
109
|
+
getInputSchema(): Input;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
interface ToolkitManager {
|
|
113
|
+
enableTool(toolName: string): boolean;
|
|
114
|
+
disableTool(toolName: string): boolean;
|
|
115
|
+
isToolEnabled(toolName: string): boolean;
|
|
116
|
+
isToolEnabledByDefault(toolName: string): boolean;
|
|
117
|
+
getToolsStatus(): Record<string, boolean>;
|
|
118
|
+
getDetailedToolsStatus(): Record<string, {
|
|
119
|
+
enabled: boolean;
|
|
120
|
+
enabledByDefault: boolean;
|
|
121
|
+
}>;
|
|
122
|
+
resetToolToDefault(toolName: string): boolean;
|
|
123
|
+
getDynamicToolNames(): string[];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Interface representing an MCP server tool registration handle
|
|
128
|
+
*/
|
|
129
|
+
interface MCPToolHandle {
|
|
130
|
+
enable(): void;
|
|
131
|
+
disable(): void;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Interface for dynamic tool control
|
|
135
|
+
*/
|
|
136
|
+
interface DynamicTool {
|
|
137
|
+
instance: Tool<any, any>;
|
|
138
|
+
mcpTool: MCPToolHandle;
|
|
139
|
+
enabled: boolean;
|
|
140
|
+
enabledByDefault: boolean;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Manages dynamic tool registration, enabling, and disabling
|
|
144
|
+
*/
|
|
145
|
+
declare class DynamicToolManager implements ToolkitManager {
|
|
146
|
+
private readonly dynamicTools;
|
|
147
|
+
/**
|
|
148
|
+
* Register a tool for dynamic management
|
|
149
|
+
*/
|
|
150
|
+
registerTool(tool: Tool<any, any>, mcpTool: MCPToolHandle): void;
|
|
151
|
+
/**
|
|
152
|
+
* Enable a specific tool
|
|
153
|
+
*/
|
|
154
|
+
enableTool(toolName: string): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Disable a specific tool
|
|
157
|
+
*/
|
|
158
|
+
disableTool(toolName: string): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Check if a tool is currently enabled
|
|
161
|
+
*/
|
|
162
|
+
isToolEnabled(toolName: string): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Check if a tool is enabled by default
|
|
165
|
+
*/
|
|
166
|
+
isToolEnabledByDefault(toolName: string): boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Get list of all available tools and their status
|
|
169
|
+
*/
|
|
170
|
+
getToolsStatus(): Record<string, boolean>;
|
|
171
|
+
/**
|
|
172
|
+
* Get list of all dynamic tool names
|
|
173
|
+
*/
|
|
174
|
+
getDynamicToolNames(): string[];
|
|
175
|
+
/**
|
|
176
|
+
* Get list of all available tools with their current and default status
|
|
177
|
+
*/
|
|
178
|
+
getDetailedToolsStatus(): Record<string, {
|
|
179
|
+
enabled: boolean;
|
|
180
|
+
enabledByDefault: boolean;
|
|
181
|
+
}>;
|
|
182
|
+
/**
|
|
183
|
+
* Reset a tool to its default enabled state
|
|
184
|
+
*/
|
|
185
|
+
resetToolToDefault(toolName: string): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Get all registered dynamic tools (for internal use)
|
|
188
|
+
*/
|
|
189
|
+
getAllDynamicTools(): Map<string, DynamicTool>;
|
|
190
|
+
/**
|
|
191
|
+
* Clear all registered tools (for cleanup)
|
|
192
|
+
*/
|
|
193
|
+
clear(): void;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export { DynamicToolManager, MondayAgentToolkit };
|