@convertcom/mcp-server 0.0.1-beta.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/.assets/logo-dark.svg +20 -0
- package/.assets/logo-light.svg +20 -0
- package/README.md +277 -0
- package/build/api-config.d.ts +4 -0
- package/build/api-config.js +139 -0
- package/build/api-config.js.map +1 -0
- package/build/debug-log.d.ts +6 -0
- package/build/debug-log.js +46 -0
- package/build/debug-log.js.map +1 -0
- package/build/executor.d.ts +13 -0
- package/build/executor.js +783 -0
- package/build/executor.js.map +1 -0
- package/build/index.d.ts +10 -0
- package/build/index.js +453 -0
- package/build/index.js.map +1 -0
- package/build/kb-hybrid.d.ts +20 -0
- package/build/kb-hybrid.js +70 -0
- package/build/kb-hybrid.js.map +1 -0
- package/build/kb-search.d.ts +18 -0
- package/build/kb-search.js +77 -0
- package/build/kb-search.js.map +1 -0
- package/build/kb-semantic.d.ts +20 -0
- package/build/kb-semantic.js +135 -0
- package/build/kb-semantic.js.map +1 -0
- package/build/namespaced.d.ts +10 -0
- package/build/namespaced.js +927 -0
- package/build/namespaced.js.map +1 -0
- package/build/operator.d.ts +17 -0
- package/build/operator.js +1320 -0
- package/build/operator.js.map +1 -0
- package/build/prompts.d.ts +13 -0
- package/build/prompts.js +201 -0
- package/build/prompts.js.map +1 -0
- package/build/shared.d.ts +6 -0
- package/build/shared.js +14 -0
- package/build/shared.js.map +1 -0
- package/build/tools.d.ts +19 -0
- package/build/tools.js +1293 -0
- package/build/tools.js.map +1 -0
- package/data/convert-kb.json +28882 -0
- package/data/kb-vectors/0/embedding.index.3.proxima +0 -0
- package/data/kb-vectors/0/scalar.0.ipc +0 -0
- package/data/kb-vectors/LOCK +0 -0
- package/data/kb-vectors/del.0 +0 -0
- package/data/kb-vectors/idmap.0/000008.sst +0 -0
- package/data/kb-vectors/idmap.0/CURRENT +1 -0
- package/data/kb-vectors/idmap.0/IDENTITY +1 -0
- package/data/kb-vectors/idmap.0/LOCK +0 -0
- package/data/kb-vectors/idmap.0/LOG +0 -0
- package/data/kb-vectors/idmap.0/MANIFEST-000005 +0 -0
- package/data/kb-vectors/idmap.0/OPTIONS-000007 +199 -0
- package/data/kb-vectors/manifest.3 +9 -0
- package/package.json +71 -0
- package/server.json +17 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 153 33">
|
|
2
|
+
<g fill="#FFFFFF">
|
|
3
|
+
<path
|
|
4
|
+
d="M17.94 24.823h4.699c-.69 2.634-2.007 4.64-3.947 6.018C16.748 32.283 14.308 33 11.365 33c-3.57 0-6.355-1.157-8.36-3.475C1 27.27 0 24.04 0 19.837c0-4.009.968-7.142 2.912-9.397 2-2.319 4.79-3.482 8.36-3.482 3.76 0 6.668 1.13 8.736 3.385 1.127 1.38 1.94 2.978 2.444 4.794h-6.578c-.314-.624-.626-1.092-.936-1.409-.82-.878-1.976-1.317-3.476-1.317-1.382 0-2.508.44-3.383 1.317-1.127 1.254-1.691 3.327-1.691 6.21 0 2.88.564 4.915 1.69 6.107.81 1.002 2.03 1.503 3.664 1.503 1.065 0 1.968-.217 2.724-.657.188-.061.358-.173.514-.329.158-.16.329-.33.52-.517.122-.19.374-.438.748-.752.381-.31.942-.47 1.692-.47"></path>
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
6
|
+
d="M24.314 25.72c.561 1.912 1.505 3.43 2.818 4.557 1.252 1.127 2.931 1.928 5.029 2.394 2.095.474 4.18.43 6.246-.138 2.314-.502 4.225-1.788 5.735-3.855.681-1.002 1.25-2.222 1.688-3.663.436-1.442.655-3.166.655-5.178 0-2.756-.535-5.165-1.6-7.236-1.124-2.316-2.876-3.95-5.255-4.888-2.066-.756-4.384-.955-6.953-.613-2.569.346-4.667 1.46-6.294 3.34-1.007 1.124-1.74 2.539-2.214 4.232a19.12 19.12 0 00-.7 5.078c0 2.06.28 4.056.845 5.97zm5.549-5.55c-.129-2.853.464-4.998 1.779-6.442.438-.436 1.13-.798 2.068-1.081a4.58 4.58 0 012.815.048c.942.316 1.775 1.033 2.491 2.164.724 1.127 1.081 2.82 1.081 5.078-.06 2.503-.467 4.321-1.22 5.449-.751 1.127-1.617 1.832-2.585 2.117a4.47 4.47 0 01-2.867-.097c-.935-.342-1.594-.763-1.968-1.267-.942-1.124-1.475-3.113-1.594-5.97z"></path>
|
|
7
|
+
<path
|
|
8
|
+
d="M69.311 32.534h-3.285c-.94 0-1.708-.3-2.302-.895-.597-.598-.89-1.362-.89-2.302V16.552c0-1.505-.458-2.604-1.366-3.295a4.928 4.928 0 00-3.054-1.034 4.73 4.73 0 00-3.004 1.034c-.878.69-1.317 1.79-1.317 3.295v15.982h-6.572V17.867c0-4.26 1.107-7.113 3.334-8.558 2.221-1.44 4.677-2.222 7.373-2.351 2.756 0 5.29.723 7.61 2.164 2.318 1.44 3.473 4.358 3.473 8.745v14.667z"></path>
|
|
9
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
10
|
+
d="M118.667 24.823h-4.698c-.747 0-1.333.159-1.735.47-.408.314-.647.562-.704.752l-.148.147-.372.37a1.33 1.33 0 01-.517.33c-.751.44-1.659.656-2.722.656-1.629 0-2.855-.501-3.666-1.503-.877-.94-1.346-2.383-1.406-4.326h16.249c.064-.123.095-.341.095-.658v-1.034c0-4.134-.999-7.362-3.003-9.684-2.071-2.255-4.982-3.385-8.742-3.385-3.563 0-6.355 1.163-8.357 3.482-1.942 2.255-2.917 5.388-2.917 9.397 0 4.203 1.003 7.433 3.008 9.688 2.004 2.318 4.794 3.475 8.362 3.475 2.945 0 5.388-.718 7.331-2.16 1.936-1.378 3.254-3.384 3.942-6.017zm-6.389-7.335h-9.579c.06-1.628.529-2.88 1.407-3.76.878-.878 2.003-1.317 3.38-1.317 1.504 0 2.662.44 3.48 1.317.751.814 1.186 2.067 1.312 3.76z"></path>
|
|
11
|
+
<path
|
|
12
|
+
d="M120.077 32.533V20.402c0-2.442.362-4.494 1.08-6.157.721-1.66 1.705-2.991 2.96-3.992 1.19-.944 2.583-1.632 4.182-2.07a18.552 18.552 0 014.928-.66H134.168V14.2h-2.158c-1.818 0-3.168.44-4.04 1.311-.879.882-1.318 2.262-1.318 4.142v12.88h-6.575zM145.907 32.533c-2.062.121-4.304.093-6.713-.095-2.414-.188-3.614-1.723-3.614-4.606V.187h3.381c.81 0 1.533.317 2.158.943.627.627.941 1.38.941 2.258v4.229h3.846v1.317c0 .937-.31 1.706-.933 2.304a3.163 3.163 0 01-2.257.894h-.655v13.913c0 1.063.621 1.598 1.878 1.598h1.967v4.89h.001z"></path>
|
|
13
|
+
<path opacity=".5" d="M71.839 8.985l-1.47 3.61 3.073 6.95 3.341-8.689-4.944-1.871z"
|
|
14
|
+
fill="inherit"></path>
|
|
15
|
+
<path opacity=".75" d="M80.39 8.316l-5.478 14.438 3.073 7.085 7.617-19.517-5.211-2.006z"
|
|
16
|
+
fill="inherit"></path>
|
|
17
|
+
<path
|
|
18
|
+
d="M96.025 10.322L94.42 1.098l-7.35 5.614 2.005.802-9.754 25.266h5.612L94.02 9.52l2.005.802zM149.906 3.124c-1.492 0-2.7 1.226-2.7 2.715 0 1.5 1.208 2.714 2.7 2.714a2.715 2.715 0 000-5.43zm0 4.904a2.176 2.176 0 01-2.178-2.19c0-1.204.969-2.189 2.178-2.189a2.19 2.19 0 010 4.379zm1.198-.887c-.577-1.062-.544-1.007-.577-1.05.261-.154.425-.46.425-.81 0-.57-.327-.931-1.1-.931h-.861a.132.132 0 00-.13.131v2.715c0 .077.054.131.13.131h.425a.133.133 0 00.131-.131v-.909h.348l.512.975c.022.043.076.065.12.065h.457c.109 0 .164-.098.12-.186zm-1.198-1.478h-.359v-.7h.294c.348 0 .424.131.424.35 0 .23-.13.35-.359.35z"></path>
|
|
19
|
+
</g>
|
|
20
|
+
</svg>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 153 33">
|
|
2
|
+
<g fill="#24292F">
|
|
3
|
+
<path
|
|
4
|
+
d="M17.94 24.823h4.699c-.69 2.634-2.007 4.64-3.947 6.018C16.748 32.283 14.308 33 11.365 33c-3.57 0-6.355-1.157-8.36-3.475C1 27.27 0 24.04 0 19.837c0-4.009.968-7.142 2.912-9.397 2-2.319 4.79-3.482 8.36-3.482 3.76 0 6.668 1.13 8.736 3.385 1.127 1.38 1.94 2.978 2.444 4.794h-6.578c-.314-.624-.626-1.092-.936-1.409-.82-.878-1.976-1.317-3.476-1.317-1.382 0-2.508.44-3.383 1.317-1.127 1.254-1.691 3.327-1.691 6.21 0 2.88.564 4.915 1.69 6.107.81 1.002 2.03 1.503 3.664 1.503 1.065 0 1.968-.217 2.724-.657.188-.061.358-.173.514-.329.158-.16.329-.33.52-.517.122-.19.374-.438.748-.752.381-.31.942-.47 1.692-.47"></path>
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
6
|
+
d="M24.314 25.72c.561 1.912 1.505 3.43 2.818 4.557 1.252 1.127 2.931 1.928 5.029 2.394 2.095.474 4.18.43 6.246-.138 2.314-.502 4.225-1.788 5.735-3.855.681-1.002 1.25-2.222 1.688-3.663.436-1.442.655-3.166.655-5.178 0-2.756-.535-5.165-1.6-7.236-1.124-2.316-2.876-3.95-5.255-4.888-2.066-.756-4.384-.955-6.953-.613-2.569.346-4.667 1.46-6.294 3.34-1.007 1.124-1.74 2.539-2.214 4.232a19.12 19.12 0 00-.7 5.078c0 2.06.28 4.056.845 5.97zm5.549-5.55c-.129-2.853.464-4.998 1.779-6.442.438-.436 1.13-.798 2.068-1.081a4.58 4.58 0 012.815.048c.942.316 1.775 1.033 2.491 2.164.724 1.127 1.081 2.82 1.081 5.078-.06 2.503-.467 4.321-1.22 5.449-.751 1.127-1.617 1.832-2.585 2.117a4.47 4.47 0 01-2.867-.097c-.935-.342-1.594-.763-1.968-1.267-.942-1.124-1.475-3.113-1.594-5.97z"></path>
|
|
7
|
+
<path
|
|
8
|
+
d="M69.311 32.534h-3.285c-.94 0-1.708-.3-2.302-.895-.597-.598-.89-1.362-.89-2.302V16.552c0-1.505-.458-2.604-1.366-3.295a4.928 4.928 0 00-3.054-1.034 4.73 4.73 0 00-3.004 1.034c-.878.69-1.317 1.79-1.317 3.295v15.982h-6.572V17.867c0-4.26 1.107-7.113 3.334-8.558 2.221-1.44 4.677-2.222 7.373-2.351 2.756 0 5.29.723 7.61 2.164 2.318 1.44 3.473 4.358 3.473 8.745v14.667z"></path>
|
|
9
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
10
|
+
d="M118.667 24.823h-4.698c-.747 0-1.333.159-1.735.47-.408.314-.647.562-.704.752l-.148.147-.372.37a1.33 1.33 0 01-.517.33c-.751.44-1.659.656-2.722.656-1.629 0-2.855-.501-3.666-1.503-.877-.94-1.346-2.383-1.406-4.326h16.249c.064-.123.095-.341.095-.658v-1.034c0-4.134-.999-7.362-3.003-9.684-2.071-2.255-4.982-3.385-8.742-3.385-3.563 0-6.355 1.163-8.357 3.482-1.942 2.255-2.917 5.388-2.917 9.397 0 4.203 1.003 7.433 3.008 9.688 2.004 2.318 4.794 3.475 8.362 3.475 2.945 0 5.388-.718 7.331-2.16 1.936-1.378 3.254-3.384 3.942-6.017zm-6.389-7.335h-9.579c.06-1.628.529-2.88 1.407-3.76.878-.878 2.003-1.317 3.38-1.317 1.504 0 2.662.44 3.48 1.317.751.814 1.186 2.067 1.312 3.76z"></path>
|
|
11
|
+
<path
|
|
12
|
+
d="M120.077 32.533V20.402c0-2.442.362-4.494 1.08-6.157.721-1.66 1.705-2.991 2.96-3.992 1.19-.944 2.583-1.632 4.182-2.07a18.552 18.552 0 014.928-.66H134.168V14.2h-2.158c-1.818 0-3.168.44-4.04 1.311-.879.882-1.318 2.262-1.318 4.142v12.88h-6.575zM145.907 32.533c-2.062.121-4.304.093-6.713-.095-2.414-.188-3.614-1.723-3.614-4.606V.187h3.381c.81 0 1.533.317 2.158.943.627.627.941 1.38.941 2.258v4.229h3.846v1.317c0 .937-.31 1.706-.933 2.304a3.163 3.163 0 01-2.257.894h-.655v13.913c0 1.063.621 1.598 1.878 1.598h1.967v4.89h.001z"></path>
|
|
13
|
+
<path opacity=".5" d="M71.839 8.985l-1.47 3.61 3.073 6.95 3.341-8.689-4.944-1.871z"
|
|
14
|
+
fill="inherit"></path>
|
|
15
|
+
<path opacity=".75" d="M80.39 8.316l-5.478 14.438 3.073 7.085 7.617-19.517-5.211-2.006z"
|
|
16
|
+
fill="inherit"></path>
|
|
17
|
+
<path
|
|
18
|
+
d="M96.025 10.322L94.42 1.098l-7.35 5.614 2.005.802-9.754 25.266h5.612L94.02 9.52l2.005.802zM149.906 3.124c-1.492 0-2.7 1.226-2.7 2.715 0 1.5 1.208 2.714 2.7 2.714a2.715 2.715 0 000-5.43zm0 4.904a2.176 2.176 0 01-2.178-2.19c0-1.204.969-2.189 2.178-2.189a2.19 2.19 0 010 4.379zm1.198-.887c-.577-1.062-.544-1.007-.577-1.05.261-.154.425-.46.425-.81 0-.57-.327-.931-1.1-.931h-.861a.132.132 0 00-.13.131v2.715c0 .077.054.131.13.131h.425a.133.133 0 00.131-.131v-.909h.348l.512.975c.022.043.076.065.12.065h.457c.109 0 .164-.098.12-.186zm-1.198-1.478h-.359v-.7h.294c.348 0 .424.131.424.35 0 .23-.13.35-.359.35z"></path>
|
|
19
|
+
</g>
|
|
20
|
+
</svg>
|
package/README.md
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
# Convert MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@convertcom/mcp-server)
|
|
4
|
+
[](https://www.typescriptlang.org/)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
[](https://modelcontextprotocol.io)
|
|
7
|
+
|
|
8
|
+
**Connect Claude, Cursor, and other AI assistants to your Convert account**
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🌟 Overview
|
|
13
|
+
|
|
14
|
+
The Convert MCP server lets AI assistants explore your Convert account without custom integrations. Once connected, the assistant can answer questions, surface insights, and (if you permit) manage entities such as experiences, audiences, and goals.
|
|
15
|
+
|
|
16
|
+
**What is MCP?**
|
|
17
|
+
|
|
18
|
+
MCP (Model Context Protocol) is an open standard that allows AI models to interact with applications through a consistent interface. It acts as a bridge, letting AI assistants access your Convert data without needing to understand specific API protocols.
|
|
19
|
+
|
|
20
|
+
**Key Benefits:**
|
|
21
|
+
- 🔌 **Zero-config integration** – Works with Claude Desktop, Cursor, and any MCP-compatible client
|
|
22
|
+
- 🔍 **Full API access** – Comprehensive coverage of Convert's [REST API v2](https://api.convert.com/doc/v2.0.0/)
|
|
23
|
+
- 📚 **Built-in knowledge** – 5,776 indexed chunks across 500 Convert support article URLs
|
|
24
|
+
- 🛡️ **Configurable permissions** – Three access levels from reporting-only to full read/write
|
|
25
|
+
- 🧩 **Namespaced tools** – Clean interface with 13 generated API namespaces plus one computed `operator` namespace
|
|
26
|
+
- 🧠 **MCP prompts** – 19 curated Convert experimentation prompts exposed through `prompts/list` and `prompts/get`
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 📚 Table of Contents
|
|
31
|
+
|
|
32
|
+
- [🚀 Quick Start](#-quick-start)
|
|
33
|
+
- [🔗 Client Integration](#-client-integration)
|
|
34
|
+
- [🛠 What You Can Do](#-what-you-can-do)
|
|
35
|
+
- [📊 Example Prompts](#-example-prompts)
|
|
36
|
+
- [🔐 Security](#-security)
|
|
37
|
+
- [❓ Troubleshooting](#-troubleshooting)
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 🚀 Quick Start
|
|
42
|
+
|
|
43
|
+
### What you need
|
|
44
|
+
|
|
45
|
+
1. **Convert API credentials** – In Convert, go to **Settings → Integrations → API** and copy your Application ID and Secret Key.
|
|
46
|
+
2. **Node.js 20+** – Only required if you run the server from source.
|
|
47
|
+
3. **Access level** – Set `TOOLS_FOR_CLIENT` to control what the assistant can do:
|
|
48
|
+
- `reporting` (default) – basic analytics and read-only summaries
|
|
49
|
+
- `readOnly` – detailed configuration data without modifying anything
|
|
50
|
+
- `all` – read/write access (only use when you explicitly want the assistant to make changes)
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 🔗 Client Integration
|
|
55
|
+
|
|
56
|
+
The server implements the [Model Context Protocol](https://modelcontextprotocol.io) and works with Claude Desktop, Cursor, and any MCP-compatible client.
|
|
57
|
+
|
|
58
|
+
### Recommended Models
|
|
59
|
+
|
|
60
|
+
For the best experience, use models with strong agentic capabilities:
|
|
61
|
+
- **Claude Sonnet 4.5** or newer
|
|
62
|
+
- **GPT-5** or newer
|
|
63
|
+
- Other frontier models with multi-step reasoning abilities
|
|
64
|
+
|
|
65
|
+
**Enable extended thinking** – Extended thinking is a special reasoning mode that significantly improves MCP tool calling, multi-step workflows, and complex API interactions. Enable it in your client settings if available.
|
|
66
|
+
|
|
67
|
+
### Configuration
|
|
68
|
+
|
|
69
|
+
Add this configuration to your MCP settings file:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"mcpServers": {
|
|
74
|
+
"convert": {
|
|
75
|
+
"command": "npx",
|
|
76
|
+
"args": ["-y", "@convertcom/mcp-server@latest"],
|
|
77
|
+
"env": {
|
|
78
|
+
"CONVERT_API_KEY": "your_application_id",
|
|
79
|
+
"CONVERT_API_SECRET": "your_secret_key",
|
|
80
|
+
"TOOLS_FOR_CLIENT": "reporting"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Configuration file locations:**
|
|
88
|
+
- **Claude Desktop**: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows)
|
|
89
|
+
- **Cursor**: `.cursor/mcp.json` in your project directory
|
|
90
|
+
- **Other clients**: Refer to your client's documentation for MCP server configuration
|
|
91
|
+
|
|
92
|
+
Save the file and restart your client to activate the Convert tools.
|
|
93
|
+
|
|
94
|
+
### Environment Variables
|
|
95
|
+
|
|
96
|
+
| Variable | Required | Description | Default |
|
|
97
|
+
| -------------------- | -------- | ----------------------------------------------- | ----------- |
|
|
98
|
+
| `CONVERT_API_KEY` | ✅ | Your Convert **Application ID** | - |
|
|
99
|
+
| `CONVERT_API_SECRET` | ✅ | Your Convert **Secret Key** | - |
|
|
100
|
+
| `TOOLS_FOR_CLIENT` | | Access level: `reporting`, `readOnly`, or `all` | `reporting` |
|
|
101
|
+
| `CONVERT_ACCOUNT_ID` | | Optional live-test target account | - |
|
|
102
|
+
| `CONVERT_PROJECT_ID` | | Optional live-test target project | - |
|
|
103
|
+
| `CONVERT_HTTP_HEADER_*` | | Optional extra API headers, e.g. `CONVERT_HTTP_HEADER_X_CONVERT_ENVIRONMENT=staging`; auth/signing headers cannot be overridden | - |
|
|
104
|
+
| `CONVERT_API_MAX_RETRIES` | | Max bounded retries for 429/503 idempotent requests | `2` |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 🛠 What You Can Do
|
|
109
|
+
|
|
110
|
+
Once connected, your AI assistant can:
|
|
111
|
+
|
|
112
|
+
- 📊 **View experiment performance** – Get real-time stats on your A/B tests and experiences
|
|
113
|
+
- 🎯 **Analyze goals and conversions** – See which goals are tracking and how they're performing
|
|
114
|
+
- 👥 **Explore audience segments** – Understand your targeting rules and segmentation
|
|
115
|
+
- 🔍 **Search Convert documentation** – The assistant has instant access to Convert's full support library, including OpenAI-compatible `search`/`fetch` docs tools
|
|
116
|
+
- 🧠 **Use curated MCP prompts** – Portfolio summaries, project audits, QA checks, split URL setup, docs search, and experiment-builder workflows are available via MCP prompts
|
|
117
|
+
- 🧭 **Run operator workflows** – The `operator` namespace performs audits, health checks, defaults inference, and safe verified creation/update flows without adding many tools
|
|
118
|
+
- 📈 **Access account analytics** – Review live data, history, and visitor tracking
|
|
119
|
+
- ⚙️ **Manage experiments** – Create, update, or pause experiences *(requires `TOOLS_FOR_CLIENT=all`)*
|
|
120
|
+
|
|
121
|
+
The assistant doesn't need to know technical details—just ask questions in plain English.
|
|
122
|
+
|
|
123
|
+
<details>
|
|
124
|
+
<summary><b>14 Namespace Workflow Tools</b></summary>
|
|
125
|
+
|
|
126
|
+
| Namespace | Reporting & readOnly actions | Extra actions in `all` |
|
|
127
|
+
| --- | --- | --- |
|
|
128
|
+
| `accounts` | list, get, get_billing_portal, get_live_data, get_history, list_users_accesses, list_api_keys, list_sdk_keys | create_sdk_key |
|
|
129
|
+
| `projects` | list, get, get_live_data, get_history | create, update |
|
|
130
|
+
| `domains` | list, get, get_by_url, check_code | create, update, delete |
|
|
131
|
+
| `experiences` | list, get, get_by_key, get_live_data, get_history, aggregated_report, daily_report, daily_traffic_allocation, get_variation_screenshot, get_heatmap_background, get_heatmap_overlay, get_change | create, clone, update, update_variation, upload_variation_screenshot, convert_variation, update_change |
|
|
132
|
+
| `sections` | list | create, update, update_experience_sections, add_version, update_version |
|
|
133
|
+
| `goals` | list, get, get_by_key | create, update, delete, clone |
|
|
134
|
+
| `tags` | list, get | create, update, delete |
|
|
135
|
+
| `hypotheses` | list, get | create, update, update_status, convert, delete |
|
|
136
|
+
| `knowledgebases` | list, get | create, update, delete |
|
|
137
|
+
| `observations` | list, get | create, update, delete |
|
|
138
|
+
| `locations` | list, get, presets | create, update, delete, clone |
|
|
139
|
+
| `audiences` | list, get, presets | create, update, delete, clone |
|
|
140
|
+
| `features` | list, get, get_by_key | create, update, delete |
|
|
141
|
+
| `operator` | project_audit, experiment_portfolio, experiment_velocity, draft_qa, active_health, implementation_health, failed_test_analysis, hypothesis_quality_audit, audience_segment_comparison, cleanup_candidates, get_defaults | create_custom_code_ab_test, create_split_url_test, enable_split_url_regex, safe_update_variation_code |
|
|
142
|
+
|
|
143
|
+
</details>
|
|
144
|
+
|
|
145
|
+
**Access Control**: With `TOOLS_FOR_CLIENT=all`, additional write actions (create/update/delete) become available. Keep permissions as narrow as possible and escalate only when necessary.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 🧪 Experience Authoring Notes
|
|
150
|
+
|
|
151
|
+
For custom JavaScript or CSS in an A/B test, use `experiences.create` or `experiences.update_variation` with `changes[].type: "customCode"` and `data: { "js": "...", "css": "" }`. `defaultCode` is for Visual Editor payloads and requires Convert's generated fields.
|
|
152
|
+
|
|
153
|
+
Split URL regex support is an experience-level setting. Use `experiences.update` without `variation_id`:
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"action": "update",
|
|
158
|
+
"path": { "account_id": 123, "project_id": 456, "experience_id": 789 },
|
|
159
|
+
"body": {
|
|
160
|
+
"settings": {
|
|
161
|
+
"split_url_settings": { "split_regex_support": true }
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
If a client sends those settings to `experiences.update_variation`, the server returns a structured retry call instead of silently letting the wrong endpoint no-op.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 📊 Example Prompts
|
|
172
|
+
|
|
173
|
+
Once set up, try these prompts with your AI assistant:
|
|
174
|
+
|
|
175
|
+
### Get Insights from Your Data
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
Show me the performance of all active experiments in my account
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
How many experiences do I have running right now?
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
Summarize all A/B tests with conversion rates above 5% from the last 30 days
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Analyze Experiment Performance
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
Get me the latest conversion data for my homepage experiment
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
Compare the performance of mobile vs desktop experiments this month
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
Show me which audience segments are performing best across all active tests
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Manage Tests *(Requires `TOOLS_FOR_CLIENT=all`)*
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
Create a new A/B test for the pricing page targeting returning visitors
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
Update the traffic split on experience 789 to 50/50
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
Pause any experiences that have been running for more than 30 days with negative lift
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 🔎 Documentation Search Tools
|
|
220
|
+
|
|
221
|
+
The server exposes two read-only documentation tools using OpenAI's MCP `search`/`fetch` connector format:
|
|
222
|
+
|
|
223
|
+
| Tool | Best for |
|
|
224
|
+
| ---- | -------- |
|
|
225
|
+
| `search` | Finding Convert docs and returning `results[].id`, `title`, and canonical `url` values. |
|
|
226
|
+
| `fetch` | Full-text retrieval for an ID returned by `search`. |
|
|
227
|
+
|
|
228
|
+
Search is hybrid. Keyword search is always available; semantic vector search starts from the packaged vector store. At runtime the server opens a temporary copy of the committed index so installed packages are not mutated and docs search stays hybrid instead of falling back to keyword-only mode.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 🔐 Security
|
|
233
|
+
|
|
234
|
+
The server uses your Convert API credentials to authenticate requests. Your credentials are stored only in environment variables and never exposed in code.
|
|
235
|
+
|
|
236
|
+
**Best practices:**
|
|
237
|
+
- Start with `TOOLS_FOR_CLIENT=reporting` and escalate only when needed
|
|
238
|
+
- Keep your API credentials secure and never commit them to version control
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## ❓ Troubleshooting
|
|
243
|
+
|
|
244
|
+
| Problem | How to fix |
|
|
245
|
+
| ------- | ---------- |
|
|
246
|
+
| Tools not visible after install | Restart the client and confirm the JSON config points to the correct command/env vars. |
|
|
247
|
+
| `401 Unauthorized` | Re-check API key/secret and your account permissions. |
|
|
248
|
+
| Requests blocked or failing | Use a smart model like Claude Sonnet 4.5, GPT-5, or newer with strong agentic capabilities. Enable extended thinking if available. The model needs to handle multi-step API workflows and parse response alerts. |
|
|
249
|
+
| Documentation search feels off | Refine the query with specific terms (product codes, URLs, field names). The package includes the semantic vector index; if needed, restart the MCP client so the runtime copy is rebuilt from the packaged store. |
|
|
250
|
+
|
|
251
|
+
Need more help? Visit the [Convert Help Center](https://support.convert.com/).
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## 📦 API Coverage
|
|
256
|
+
|
|
257
|
+
The server provides comprehensive coverage of Convert's [REST API v2](https://api.convert.com/doc/v2.0.0/):
|
|
258
|
+
|
|
259
|
+
- **Account Operations**: User management, billing, and settings
|
|
260
|
+
- **Project Management**: Configuration, domains, and collaborators
|
|
261
|
+
- **Experience Control**: A/B tests, MVT, Split URL, and deployments
|
|
262
|
+
- **Analytics & Reporting**: Real-time data, conversion tracking, and statistical analysis
|
|
263
|
+
- **Goal Tracking**: Conversion goals, revenue tracking, and custom events
|
|
264
|
+
- **Audience Management**: Segmentation rules and targeting
|
|
265
|
+
- **Feature Flags**: Feature management and rollout control
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
<div align="center">
|
|
270
|
+
|
|
271
|
+
**Made with ❤️ by the Convert Team**
|
|
272
|
+
|
|
273
|
+
© 2026 Convert Insights, Inc. Built for the automation-minded optimizer.
|
|
274
|
+
|
|
275
|
+
[Website](https://www.convert.com) • [Documentation](https://support.convert.com/) • [API Reference](https://api.convert.com/doc/)
|
|
276
|
+
|
|
277
|
+
</div>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const API_BASE_URL: string;
|
|
2
|
+
export declare function convertHttpHeadersFromEnv(env?: NodeJS.ProcessEnv): Record<string, string>;
|
|
3
|
+
export declare function shouldRetryApiRequest(method: string | undefined, status: number | undefined, retryUnsafeWrites?: boolean): boolean;
|
|
4
|
+
export declare function signingBody(data: unknown): string;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import crypto from 'crypto';
|
|
3
|
+
export const API_BASE_URL = process.env.API_BASE_URL || 'https://api.convert.com/api/v2';
|
|
4
|
+
const CUSTOM_HEADER_PREFIX = 'CONVERT_HTTP_HEADER_';
|
|
5
|
+
const DEFAULT_MAX_RETRIES = 2;
|
|
6
|
+
const RETRYABLE_STATUSES = new Set([429, 503]);
|
|
7
|
+
const BLOCKED_CUSTOM_HEADERS = new Set([
|
|
8
|
+
'authorization',
|
|
9
|
+
'convert-application-id',
|
|
10
|
+
'expires',
|
|
11
|
+
'content-type',
|
|
12
|
+
]);
|
|
13
|
+
axios.defaults.transformRequest = [
|
|
14
|
+
function (data) {
|
|
15
|
+
if (isPassThroughBody(data)) {
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
if (!data) {
|
|
19
|
+
data = {};
|
|
20
|
+
}
|
|
21
|
+
if (typeof data === 'string') {
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
return JSON.stringify(data);
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
export function convertHttpHeadersFromEnv(env = process.env) {
|
|
28
|
+
const headers = {};
|
|
29
|
+
for (const [key, value] of Object.entries(env)) {
|
|
30
|
+
if (!key.startsWith(CUSTOM_HEADER_PREFIX) || typeof value !== 'string' || value.length === 0) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const headerName = headerNameFromEnvKey(key);
|
|
34
|
+
if (!headerName)
|
|
35
|
+
continue;
|
|
36
|
+
if (BLOCKED_CUSTOM_HEADERS.has(headerName.toLowerCase()))
|
|
37
|
+
continue;
|
|
38
|
+
headers[headerName] = value;
|
|
39
|
+
}
|
|
40
|
+
return headers;
|
|
41
|
+
}
|
|
42
|
+
export function shouldRetryApiRequest(method, status, retryUnsafeWrites = false) {
|
|
43
|
+
if (!status || !RETRYABLE_STATUSES.has(status))
|
|
44
|
+
return false;
|
|
45
|
+
const normalizedMethod = (method || 'get').toLowerCase();
|
|
46
|
+
if (['get', 'head', 'options'].includes(normalizedMethod))
|
|
47
|
+
return true;
|
|
48
|
+
return retryUnsafeWrites;
|
|
49
|
+
}
|
|
50
|
+
axios.interceptors.request.use((config) => {
|
|
51
|
+
const applicationID = process.env.CONVERT_API_KEY;
|
|
52
|
+
const applicationSecretKey = process.env.CONVERT_API_SECRET;
|
|
53
|
+
const expires = 60;
|
|
54
|
+
const requestURL = config.url;
|
|
55
|
+
const requestBody = signingBody(config.data);
|
|
56
|
+
const expiresTimestamp = Date.now() / 1000 + expires;
|
|
57
|
+
const signString = applicationID + '\n' + expiresTimestamp + '\n' + requestURL + '\n' + requestBody;
|
|
58
|
+
const hash = crypto.createHmac('sha256', applicationSecretKey).update(signString).digest('hex');
|
|
59
|
+
const authorization = 'Convert-HMAC-SHA256 Signature=' + hash;
|
|
60
|
+
for (const [header, value] of Object.entries(convertHttpHeadersFromEnv())) {
|
|
61
|
+
config.headers[header] = value;
|
|
62
|
+
}
|
|
63
|
+
config.headers['Convert-Application-ID'] = applicationID;
|
|
64
|
+
config.headers['Expires'] = expiresTimestamp;
|
|
65
|
+
config.headers['Authorization'] = authorization;
|
|
66
|
+
return config;
|
|
67
|
+
}, (error) => {
|
|
68
|
+
return Promise.reject(error);
|
|
69
|
+
});
|
|
70
|
+
axios.interceptors.response.use((response) => response, async (error) => {
|
|
71
|
+
if (!axios.isAxiosError(error) || !error.config) {
|
|
72
|
+
return Promise.reject(error);
|
|
73
|
+
}
|
|
74
|
+
const config = error.config;
|
|
75
|
+
const retryUnsafeWrites = process.env.CONVERT_RETRY_UNSAFE_WRITES === '1'
|
|
76
|
+
|| process.env.CONVERT_RETRY_UNSAFE_WRITES?.toLowerCase() === 'true';
|
|
77
|
+
if (!shouldRetryApiRequest(config.method, error.response?.status, retryUnsafeWrites)) {
|
|
78
|
+
return Promise.reject(error);
|
|
79
|
+
}
|
|
80
|
+
const retryCount = config.__convertRetryCount ?? 0;
|
|
81
|
+
const maxRetries = maxRetriesFromEnv();
|
|
82
|
+
if (retryCount >= maxRetries) {
|
|
83
|
+
return Promise.reject(error);
|
|
84
|
+
}
|
|
85
|
+
config.__convertRetryCount = retryCount + 1;
|
|
86
|
+
await sleep(retryDelayMs(retryCount, error.response?.headers?.['retry-after']));
|
|
87
|
+
return axios(config);
|
|
88
|
+
});
|
|
89
|
+
function headerNameFromEnvKey(key) {
|
|
90
|
+
const raw = key.slice(CUSTOM_HEADER_PREFIX.length).trim();
|
|
91
|
+
if (!raw)
|
|
92
|
+
return null;
|
|
93
|
+
return raw
|
|
94
|
+
.split('_')
|
|
95
|
+
.filter(Boolean)
|
|
96
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
|
|
97
|
+
.join('-');
|
|
98
|
+
}
|
|
99
|
+
export function signingBody(data) {
|
|
100
|
+
if (typeof data === 'undefined' || data === null)
|
|
101
|
+
return '{}';
|
|
102
|
+
if (typeof data === 'string')
|
|
103
|
+
return data || '{}';
|
|
104
|
+
if (isPassThroughBody(data))
|
|
105
|
+
return '';
|
|
106
|
+
return JSON.stringify(data);
|
|
107
|
+
}
|
|
108
|
+
function isPassThroughBody(data) {
|
|
109
|
+
if (!data)
|
|
110
|
+
return false;
|
|
111
|
+
if (typeof FormData !== 'undefined' && data instanceof FormData)
|
|
112
|
+
return true;
|
|
113
|
+
if (typeof Blob !== 'undefined' && data instanceof Blob)
|
|
114
|
+
return true;
|
|
115
|
+
if (typeof URLSearchParams !== 'undefined' && data instanceof URLSearchParams)
|
|
116
|
+
return true;
|
|
117
|
+
if (typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer)
|
|
118
|
+
return true;
|
|
119
|
+
if (ArrayBuffer.isView(data))
|
|
120
|
+
return true;
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
function maxRetriesFromEnv() {
|
|
124
|
+
const parsed = Number(process.env.CONVERT_API_MAX_RETRIES);
|
|
125
|
+
if (!Number.isSafeInteger(parsed) || parsed < 0)
|
|
126
|
+
return DEFAULT_MAX_RETRIES;
|
|
127
|
+
return Math.min(parsed, 5);
|
|
128
|
+
}
|
|
129
|
+
function retryDelayMs(retryCount, retryAfter) {
|
|
130
|
+
const retryAfterSeconds = Array.isArray(retryAfter) ? Number(retryAfter[0]) : Number(retryAfter);
|
|
131
|
+
if (Number.isFinite(retryAfterSeconds) && retryAfterSeconds > 0) {
|
|
132
|
+
return Math.min(retryAfterSeconds * 1000, 10_000);
|
|
133
|
+
}
|
|
134
|
+
return Math.min(250 * 2 ** retryCount, 2_000);
|
|
135
|
+
}
|
|
136
|
+
function sleep(ms) {
|
|
137
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=api-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-config.js","sourceRoot":"","sources":["../src/api-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,gCAAgC,CAAC;AACzF,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AACpD,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAC/C,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,eAAe;IACf,wBAAwB;IACxB,SAAS;IACT,cAAc;CACf,CAAC,CAAC;AAEH,KAAK,CAAC,QAAQ,CAAC,gBAAgB,GAAG;IAChC,UAAU,IAAS;QACjB,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC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AI,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,iBAAiB;IACxB,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAC3D,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,mBAAmB,CAAC;IAC5E,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,YAAY,CAAC,UAAkB,EAAE,UAAmB;IAC3D,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACjG,IAAI,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,iBAAiB,GAAG,CAAC,EAAE,CAAC;QAChE,OAAO,IAAI,CAAC,GAAG,CAAC,iBAAiB,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,UAAU,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { appendFileSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
export class DebugLogger {
|
|
5
|
+
filePath;
|
|
6
|
+
enabled;
|
|
7
|
+
constructor(enabled) {
|
|
8
|
+
this.enabled = enabled;
|
|
9
|
+
if (!enabled) {
|
|
10
|
+
this.filePath = null;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
const baseDir = join(homedir(), '.convert');
|
|
15
|
+
mkdirSync(baseDir, { recursive: true });
|
|
16
|
+
this.filePath = join(baseDir, 'convert-mcp-debug.log');
|
|
17
|
+
writeFileSync(this.filePath, '', { encoding: 'utf8' });
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
console.error('[DebugLogger] Failed to initialise debug log file:', error);
|
|
21
|
+
this.filePath = null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
log(message, payload) {
|
|
25
|
+
if (!this.enabled || !this.filePath) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const time = new Date().toISOString();
|
|
30
|
+
const serialized = payload === undefined ? '' : `\n${safeSerialize(payload)}\n`;
|
|
31
|
+
appendFileSync(this.filePath, `[${time}] ${message}${serialized}\n`, { encoding: 'utf8' });
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
console.error('[DebugLogger] Failed to write debug entry:', error);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function safeSerialize(value) {
|
|
39
|
+
try {
|
|
40
|
+
return JSON.stringify(value, null, 2);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
return `<<unserializable: ${String(error)}>>`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=debug-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-log.js","sourceRoot":"","sources":["../src/debug-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS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QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,KAAK,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;CACF;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,qBAAqB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;IAChD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { type AxiosError } from 'axios';
|
|
3
|
+
import { type ErrorObject } from 'ajv/dist/2020.js';
|
|
4
|
+
import { type JsonObject } from './shared.js';
|
|
5
|
+
export declare function executeToolByName(toolName: string, toolArgs: JsonObject): Promise<CallToolResult>;
|
|
6
|
+
export declare function recoverUploadedScreenshot(toolName: string, error: AxiosError, readbackUrl: string | null): Promise<CallToolResult | null>;
|
|
7
|
+
export declare function validateToolArgs(toolName: string, rawSchema: unknown, args: JsonObject): {
|
|
8
|
+
ok: true;
|
|
9
|
+
} | {
|
|
10
|
+
ok: false;
|
|
11
|
+
message: string;
|
|
12
|
+
errors: ErrorObject[];
|
|
13
|
+
};
|