@anychat-ai/mcp 0.4.0 → 0.5.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 +9 -3
- package/dist/tools/images.d.ts +1 -0
- package/dist/tools/images.js +111 -0
- package/dist/tools/images.js.map +1 -0
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ Flags: `--profile core|full` picks the tool set (default `full`, see [Profiles](
|
|
|
49
49
|
|
|
50
50
|
## Tools
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
122 tools, a 1:1 projection of the [Agent API](https://docs.anychat.ai/reference/agent-api/) grouped as the reference is (orient → Definition → Capabilities → Channels → People → Testers → Activity → Org → Docs). `npx -y @anychat-ai/mcp tools` prints the live table.
|
|
53
53
|
|
|
54
54
|
Every tool carries MCP annotations: `read` tools are `readOnlyHint`; `write` tools change configuration; `destructive` tools (deletes, outreach sends to real people, provisioning requests, imports over an existing agent, secret rotation) are `destructiveHint` so your host asks before running them.
|
|
55
55
|
|
|
@@ -57,8 +57,8 @@ Every tool carries MCP annotations: `read` tools are `readOnlyHint`; `write` too
|
|
|
57
57
|
|
|
58
58
|
Every tool definition (name, description, input schema) is sent to the model on every call, so a big table has a real per-turn cost. Two profiles trade breadth for weight:
|
|
59
59
|
|
|
60
|
-
- **`full`** (default) — all
|
|
61
|
-
- **`core`** —
|
|
60
|
+
- **`full`** (default) — all 122 tools.
|
|
61
|
+
- **`core`** — 60 tools, the everyday set: `whoami`; agents (list / get / create / update / export / import, apply template, catalogs); the whole Definition (identity, personality, objectives, guardrails, playbooks, message templates, `lint_agent`); the image library (list / add / update / delete); tool bindings (list / upsert); scheduling config; People field definitions; outreach config; product catalog (read); channels (list / get / request / bind); people (list / get / update, send outreach, list segments); testers (list); conversations / messages / logs / activity; org; docs. About half the tokens of `full`.
|
|
62
62
|
|
|
63
63
|
Pick one with `--profile core` on the CLI or `createServer({ profile: 'core' })` in code; the `Profile` column below shows which set each tool belongs to, and `npx -y @anychat-ai/mcp tools --profile core` lists just that set. Nothing else changes: `full` stays the default, and the `core` set only ever grows.
|
|
64
64
|
|
|
@@ -109,6 +109,12 @@ Pick one with `--profile core` on the CLI or `createServer({ profile: 'core' })`
|
|
|
109
109
|
| `delete_message_template` | destructive | `agents:write` | core | Delete message template |
|
|
110
110
|
| `preview_message_template` | read | `agents:read` | full | Preview message template |
|
|
111
111
|
| `lint_agent` | read | `agents:read` | core | Lint agent definition |
|
|
112
|
+
| `list_images` | read | `agents:read` | core | List images |
|
|
113
|
+
| `get_image` | read | `agents:read` | full | Get image |
|
|
114
|
+
| `add_image` | write | `agents:write` | core | Add image |
|
|
115
|
+
| `update_image` | write | `agents:write` | core | Update image |
|
|
116
|
+
| `describe_image` | write | `agents:write` | full | Regenerate image description |
|
|
117
|
+
| `delete_image` | destructive | `agents:write` | core | Delete image |
|
|
112
118
|
| `list_tool_bindings` | read | `agents:read` | core | List tool bindings |
|
|
113
119
|
| `get_tool_binding` | read | `agents:read` | full | Get a tool binding |
|
|
114
120
|
| `upsert_tool_binding` | write | `agents:write` | core | Create or replace a tool binding |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const imageTools: import("../tool").AnyTool[];
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imageTools = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Image library — `/v1/orgs/{org}/agents/{agent}/images`.
|
|
6
|
+
*
|
|
7
|
+
* Images an agent may show in rich cards, carousels and media messages.
|
|
8
|
+
* The platform hosts them (the object is created and deleted with the
|
|
9
|
+
* entry); content references them **by id**, never by URL:
|
|
10
|
+
* `[[card | Title ~ text | media: image:<id>]]`, `[[carousel …]]` lines,
|
|
11
|
+
* `[[media: image:<id>]]` in v1 templates/playbooks, or `card.image` /
|
|
12
|
+
* `image` in Framework v2 responses. The description (generated by a
|
|
13
|
+
* vision model, editable) and the optional usage hint are what the agent
|
|
14
|
+
* chooses images by.
|
|
15
|
+
*/
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const tool_1 = require("../tool");
|
|
18
|
+
const agentId = zod_1.z.string();
|
|
19
|
+
const imageId = zod_1.z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.describe('The image id (per-agent slug, e.g. "showcase-authentic-ai")');
|
|
23
|
+
const imageTextFields = {
|
|
24
|
+
name: zod_1.z.string().min(1).optional().describe('Operator label'),
|
|
25
|
+
description: zod_1.z
|
|
26
|
+
.string()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('What the image shows. Omit to have a vision model write it from the pixels (recommended); supply it to skip generation.'),
|
|
29
|
+
usageHint: zod_1.z
|
|
30
|
+
.string()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('When the agent should show it, e.g. "early in the conversation, when explaining what RCS can do"'),
|
|
33
|
+
};
|
|
34
|
+
exports.imageTools = [
|
|
35
|
+
(0, tool_1.defineTool)({
|
|
36
|
+
name: 'list_images',
|
|
37
|
+
title: 'List images',
|
|
38
|
+
description: "List the agent's image library — hosted images the agent may show in cards, carousels and media messages, each with an id (the reference key), a description and an optional usage hint. Reference an image in a template or playbook as `media: image:<id>` (e.g. `[[card | Title ~ text | media: image:<id>]]`, one card per line inside `[[carousel … ]]`, or `[[media: image:<id>]]`). Maps to GET /v1/orgs/{org}/agents/{agent}/images.",
|
|
39
|
+
kind: 'read',
|
|
40
|
+
scope: 'agents:read',
|
|
41
|
+
roleFloor: 'viewer',
|
|
42
|
+
profile: 'core',
|
|
43
|
+
input: { agentId },
|
|
44
|
+
run: async ({ client }, { agentId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/images`)),
|
|
45
|
+
}),
|
|
46
|
+
(0, tool_1.defineTool)({
|
|
47
|
+
name: 'get_image',
|
|
48
|
+
title: 'Get image',
|
|
49
|
+
description: 'Read one image-library entry ({ id, name, description, descriptionSource, usageHint?, url, contentType, bytes, width?, height? }). Maps to GET /v1/orgs/{org}/agents/{agent}/images/{imageId}.',
|
|
50
|
+
kind: 'read',
|
|
51
|
+
scope: 'agents:read',
|
|
52
|
+
roleFloor: 'viewer',
|
|
53
|
+
input: { agentId, imageId },
|
|
54
|
+
run: async ({ client }, { agentId, imageId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/images/${encodeURIComponent(imageId)}`)),
|
|
55
|
+
}),
|
|
56
|
+
(0, tool_1.defineTool)({
|
|
57
|
+
name: 'add_image',
|
|
58
|
+
title: 'Add image',
|
|
59
|
+
description: "Add an image to the agent's library from a public http(s) URL: the platform fetches it (PNG, JPEG, GIF or WebP, ≤ 5 MB), hosts its own copy, records dimensions, and — unless you pass a description — has a vision model describe it. Same bytes added twice return the existing entry. Choose the id (slug) or let it derive from the name. Maps to POST /v1/orgs/{org}/agents/{agent}/images.",
|
|
60
|
+
kind: 'write',
|
|
61
|
+
scope: 'agents:write',
|
|
62
|
+
roleFloor: 'editor',
|
|
63
|
+
profile: 'core',
|
|
64
|
+
input: {
|
|
65
|
+
agentId,
|
|
66
|
+
sourceUrl: zod_1.z.string().url().describe('Public http(s) URL of the image'),
|
|
67
|
+
id: zod_1.z
|
|
68
|
+
.string()
|
|
69
|
+
.optional()
|
|
70
|
+
.describe('Preferred id (slugified; suffixed when taken). Defaults from name.'),
|
|
71
|
+
...imageTextFields,
|
|
72
|
+
},
|
|
73
|
+
run: async ({ client }, { agentId, ...body }) => client.post(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/images`), body),
|
|
74
|
+
}),
|
|
75
|
+
(0, tool_1.defineTool)({
|
|
76
|
+
name: 'update_image',
|
|
77
|
+
title: 'Update image',
|
|
78
|
+
description: "Edit an image's name, description or usage hint (an empty usageHint clears it). The id and the hosted file never change — to replace the picture, delete and add. Maps to PATCH /v1/orgs/{org}/agents/{agent}/images/{imageId}.",
|
|
79
|
+
kind: 'write',
|
|
80
|
+
scope: 'agents:write',
|
|
81
|
+
roleFloor: 'editor',
|
|
82
|
+
profile: 'core',
|
|
83
|
+
input: { agentId, imageId, ...imageTextFields },
|
|
84
|
+
run: async ({ client }, { agentId, imageId, usageHint, ...rest }) => client.patch(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/images/${encodeURIComponent(imageId)}`), { ...rest, ...(usageHint === undefined ? {} : { usageHint: usageHint || null }) }),
|
|
85
|
+
}),
|
|
86
|
+
(0, tool_1.defineTool)({
|
|
87
|
+
name: 'describe_image',
|
|
88
|
+
title: 'Regenerate image description',
|
|
89
|
+
description: 'Have the vision model rewrite the description from the stored pixels (replaces operator edits). Maps to POST /v1/orgs/{org}/agents/{agent}/images/{imageId}:describe.',
|
|
90
|
+
kind: 'write',
|
|
91
|
+
scope: 'agents:write',
|
|
92
|
+
roleFloor: 'editor',
|
|
93
|
+
input: { agentId, imageId },
|
|
94
|
+
run: async ({ client }, { agentId, imageId }) => client.post(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/images/${encodeURIComponent(imageId)}:describe`), {}),
|
|
95
|
+
}),
|
|
96
|
+
(0, tool_1.defineTool)({
|
|
97
|
+
name: 'delete_image',
|
|
98
|
+
title: 'Delete image',
|
|
99
|
+
description: 'Remove an image from the library AND delete its hosted file. Templates or playbooks still referencing `image:<id>` keep sending, without the picture (lint reports them as image.ref.unknown). Irreversible. Maps to DELETE /v1/orgs/{org}/agents/{agent}/images/{imageId}.',
|
|
100
|
+
kind: 'destructive',
|
|
101
|
+
scope: 'agents:write',
|
|
102
|
+
roleFloor: 'editor',
|
|
103
|
+
profile: 'core',
|
|
104
|
+
input: { agentId, imageId },
|
|
105
|
+
run: async ({ client }, { agentId, imageId }) => {
|
|
106
|
+
await client.delete(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/images/${encodeURIComponent(imageId)}`));
|
|
107
|
+
return { ok: true, deleted: imageId };
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
];
|
|
111
|
+
//# sourceMappingURL=images.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images.js","sourceRoot":"","sources":["../../src/tools/images.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,6BAAwB;AACxB,kCAAqC;AAErC,MAAM,OAAO,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC;AAC3B,MAAM,OAAO,GAAG,OAAC;KACd,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,CAAC,6DAA6D,CAAC,CAAC;AAE3E,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC7D,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,yHAAyH,CAC1H;IACH,SAAS,EAAE,OAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,kGAAkG,CACnG;CACJ,CAAC;AAEW,QAAA,UAAU,GAAG;IACxB,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,aAAa;QACpB,WAAW,EACT,8aAA8a;QAChb,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,EAAE,OAAO,EAAE;QAClB,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CACrC,MAAM,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,WAAW,kBAAkB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;KACpF,CAAC;IACF,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,WAAW;QACjB,KAAK,E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EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;QAC3B,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;YAC9C,MAAM,MAAM,CAAC,MAAM,CACjB,MAAM,MAAM,CAAC,OAAO,CAClB,WAAW,kBAAkB,CAAC,OAAO,CAAC,WAAW,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAC/E,CACF,CAAC;YACF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QACxC,CAAC;KACF,CAAC;CACH,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const capabilities_1 = require("./capabilities");
|
|
|
8
8
|
const channels_1 = require("./channels");
|
|
9
9
|
const definition_1 = require("./definition");
|
|
10
10
|
const docs_1 = require("./docs");
|
|
11
|
+
const images_1 = require("./images");
|
|
11
12
|
const me_1 = require("./me");
|
|
12
13
|
const org_1 = require("./org");
|
|
13
14
|
const people_1 = require("./people");
|
|
@@ -21,6 +22,7 @@ exports.allTools = [
|
|
|
21
22
|
...me_1.meTools,
|
|
22
23
|
...agents_1.agentTools,
|
|
23
24
|
...definition_1.definitionTools,
|
|
25
|
+
...images_1.imageTools,
|
|
24
26
|
...capabilities_1.capabilityTools,
|
|
25
27
|
...channels_1.channelTools,
|
|
26
28
|
...people_1.peopleTools,
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;AAwCA,0CAKC;AA5CD,yCAA2C;AAC3C,qCAAsC;AACtC,iDAAiD;AACjD,yCAA0C;AAC1C,6CAA+C;AAC/C,iCAAmC;AACnC,qCAAsC;AACtC,6BAA+B;AAC/B,+BAAiC;AACjC,qCAAuC;AACvC,uCAAwC;AAExC;;;;GAIG;AACU,QAAA,QAAQ,GAAc;IACjC,GAAG,YAAO;IACV,GAAG,mBAAU;IACb,GAAG,4BAAe;IAClB,GAAG,mBAAU;IACb,GAAG,8BAAe;IAClB,GAAG,uBAAY;IACf,GAAG,oBAAW;IACd,GAAG,qBAAW;IACd,GAAG,wBAAa;IAChB,GAAG,cAAQ;IACX,GAAG,gBAAS;CACb,CAAC;AAEW,QAAA,WAAW,GAAiC,IAAI,GAAG,CAC9D,gBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAC/B,CAAC;AAEF;;;GAGG;AACH,SAAgB,eAAe,CAC7B,OAAoB,EACpB,QAA4B,gBAAQ;IAEpC,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC;AACnF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anychat-ai/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Anychat MCP server — drive your Anychat workspace (agents, playbooks, channels, people, outreach) from Claude Code, Claude Desktop, Cursor, or any MCP host.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anychat",
|