@actwith-ai/mcp-server 0.6.9 → 0.6.10
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/client.d.ts +71 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +89 -0
- package/dist/client.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/tools/catalog.d.ts +21 -0
- package/dist/tools/catalog.d.ts.map +1 -0
- package/dist/tools/catalog.js +75 -0
- package/dist/tools/catalog.js.map +1 -0
- package/dist/tools/gadgets.d.ts +13 -0
- package/dist/tools/gadgets.d.ts.map +1 -0
- package/dist/tools/gadgets.js +291 -0
- package/dist/tools/gadgets.js.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +43 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/meta.d.ts +14 -0
- package/dist/tools/meta.d.ts.map +1 -0
- package/dist/tools/meta.js +139 -0
- package/dist/tools/meta.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meta-Tools — Dynamic toolset engine
|
|
3
|
+
*
|
|
4
|
+
* Three tools that give agents access to the full catalog:
|
|
5
|
+
* - search_tools: find tools by keyword or category
|
|
6
|
+
* - tool_details: get full schema for a specific tool
|
|
7
|
+
* - execute_tool: run any tool by name (delegates to handleTool)
|
|
8
|
+
*/
|
|
9
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
10
|
+
import { ActwithClient } from "../client.js";
|
|
11
|
+
export declare const metaTools: Tool[];
|
|
12
|
+
export declare const META_TOOL_NAMES: Set<string>;
|
|
13
|
+
export declare function handleMetaTool(client: ActwithClient, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
14
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/tools/meta.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAO1D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,SAAS,EAAE,IAAI,EAsE3B,CAAC;AAEF,eAAO,MAAM,eAAe,aAI1B,CAAC;AAEH,wBAAsB,cAAc,CAClC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CAiElB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meta-Tools — Dynamic toolset engine
|
|
3
|
+
*
|
|
4
|
+
* Three tools that give agents access to the full catalog:
|
|
5
|
+
* - search_tools: find tools by keyword or category
|
|
6
|
+
* - tool_details: get full schema for a specific tool
|
|
7
|
+
* - execute_tool: run any tool by name (delegates to handleTool)
|
|
8
|
+
*/
|
|
9
|
+
import { searchCatalog, toolByName, getCategorySummary, } from "./catalog.js";
|
|
10
|
+
import { handleTool } from "./index.js";
|
|
11
|
+
export const metaTools = [
|
|
12
|
+
{
|
|
13
|
+
name: "search_tools",
|
|
14
|
+
description: "Search available tools by keyword. Returns matching tool names and descriptions. Use this to discover what actions are available.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
query: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Search keyword (e.g., 'memory', 'task', 'artifact', 'pattern')",
|
|
21
|
+
},
|
|
22
|
+
category: {
|
|
23
|
+
type: "string",
|
|
24
|
+
enum: [
|
|
25
|
+
"memory",
|
|
26
|
+
"tasks",
|
|
27
|
+
"messaging",
|
|
28
|
+
"patterns",
|
|
29
|
+
"artifacts",
|
|
30
|
+
"projects",
|
|
31
|
+
"reputation",
|
|
32
|
+
"discovery",
|
|
33
|
+
"workspace",
|
|
34
|
+
"identity",
|
|
35
|
+
"votes",
|
|
36
|
+
"connectors",
|
|
37
|
+
"gadgets",
|
|
38
|
+
"agents",
|
|
39
|
+
],
|
|
40
|
+
description: "Filter by category",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "tool_details",
|
|
47
|
+
description: "Get the full schema and description for a specific tool. Use after search_tools to understand parameters before calling execute_tool.",
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: "object",
|
|
50
|
+
properties: {
|
|
51
|
+
tool_name: {
|
|
52
|
+
type: "string",
|
|
53
|
+
description: "The tool name (e.g., 'remember', 'post_task')",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
required: ["tool_name"],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "execute_tool",
|
|
61
|
+
description: "Execute any available tool by name. Use tool_details first to see the required parameters.",
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
tool_name: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "The tool to execute",
|
|
68
|
+
},
|
|
69
|
+
arguments: {
|
|
70
|
+
type: "object",
|
|
71
|
+
description: "The tool's arguments (see tool_details for schema)",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
required: ["tool_name"],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
export const META_TOOL_NAMES = new Set([
|
|
79
|
+
"search_tools",
|
|
80
|
+
"tool_details",
|
|
81
|
+
"execute_tool",
|
|
82
|
+
]);
|
|
83
|
+
export async function handleMetaTool(client, name, args) {
|
|
84
|
+
switch (name) {
|
|
85
|
+
case "search_tools": {
|
|
86
|
+
const { query, category } = args;
|
|
87
|
+
if (!query && !category) {
|
|
88
|
+
return {
|
|
89
|
+
totalTools: toolByName.size,
|
|
90
|
+
categories: getCategorySummary(),
|
|
91
|
+
tip: 'Use search_tools { query: "keyword" } to find specific tools, or { category: "tasks" } to browse a category.',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const results = searchCatalog(query, category);
|
|
95
|
+
return {
|
|
96
|
+
query: query || null,
|
|
97
|
+
category: category || null,
|
|
98
|
+
count: results.length,
|
|
99
|
+
tools: results.map((e) => ({
|
|
100
|
+
name: e.tool.name,
|
|
101
|
+
category: e.category,
|
|
102
|
+
description: e.tool.description,
|
|
103
|
+
})),
|
|
104
|
+
tip: results.length > 0
|
|
105
|
+
? 'Use tool_details { tool_name: "name" } to see full parameters, then execute_tool to run it.'
|
|
106
|
+
: "No tools found. Try a different keyword or category.",
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
case "tool_details": {
|
|
110
|
+
const { tool_name } = args;
|
|
111
|
+
const entry = toolByName.get(tool_name);
|
|
112
|
+
if (!entry) {
|
|
113
|
+
return {
|
|
114
|
+
error: `Unknown tool: "${tool_name}". Use search_tools to find available tools.`,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
name: entry.tool.name,
|
|
119
|
+
category: entry.category,
|
|
120
|
+
description: entry.tool.description,
|
|
121
|
+
inputSchema: entry.tool.inputSchema,
|
|
122
|
+
tip: `Use execute_tool { tool_name: "${tool_name}", arguments: { ... } } to run this tool.`,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
case "execute_tool": {
|
|
126
|
+
const { tool_name, arguments: toolArgs = {} } = args;
|
|
127
|
+
if (!toolByName.has(tool_name)) {
|
|
128
|
+
return {
|
|
129
|
+
error: `Unknown tool: "${tool_name}". Use search_tools to find available tools.`,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
// Delegate to existing handleTool — preserves message packs, aliases, everything
|
|
133
|
+
return handleTool(client, tool_name, toolArgs);
|
|
134
|
+
}
|
|
135
|
+
default:
|
|
136
|
+
throw new Error(`Unknown meta tool: ${name}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/tools/meta.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,aAAa,EACb,UAAU,EACV,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,CAAC,MAAM,SAAS,GAAW;IAC/B;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,mIAAmI;QACrI,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,gEAAgE;iBACnE;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE;wBACJ,QAAQ;wBACR,OAAO;wBACP,WAAW;wBACX,UAAU;wBACV,WAAW;wBACX,UAAU;wBACV,YAAY;wBACZ,WAAW;wBACX,WAAW;wBACX,UAAU;wBACV,OAAO;wBACP,YAAY;wBACZ,SAAS;wBACT,QAAQ;qBACT;oBACD,WAAW,EAAE,oBAAoB;iBAClC;aACF;SACF;KACF;IACD;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,uIAAuI;QACzI,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,+CAA+C;iBAC7D;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,CAAC;SACxB;KACF;IACD;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,4FAA4F;QAC9F,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;o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