@anychat-ai/mcp 0.5.0 → 0.7.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 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
- 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.
52
+ 123 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 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`.
60
+ - **`full`** (default) — all 123 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 media 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,12 +109,13 @@ 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
+ | `list_media` | read | `agents:read` | core | List media |
113
+ | `get_media` | read | `agents:read` | full | Get media item |
114
+ | `add_media` | write | `agents:write` | core | Add media |
115
+ | `update_media` | write | `agents:write` | core | Update media |
116
+ | `replace_media_content` | write | `agents:write` | full | Replace media file |
117
+ | `describe_media` | write | `agents:write` | full | Regenerate media description |
118
+ | `delete_media` | destructive | `agents:write` | core | Delete media |
118
119
  | `list_tool_bindings` | read | `agents:read` | core | List tool bindings |
119
120
  | `get_tool_binding` | read | `agents:read` | full | Get a tool binding |
120
121
  | `upsert_tool_binding` | write | `agents:write` | core | Create or replace a tool binding |
@@ -30,7 +30,7 @@ exports.activityTools = [
30
30
  (0, tool_1.defineTool)({
31
31
  name: 'list_messages',
32
32
  title: 'List messages',
33
- description: `List inbound and outbound messages for an agent within a time range (default last 24 hours); filter by sessionId (from list_conversations) to read one transcript. Returns { data: [{ timestamp, userId, sessionId, origin, type, channel, text, raw … }], nextPageToken }. ${DATA_NOT_INSTRUCTIONS} Maps to GET /v1/orgs/{org}/agents/{agent}/messages.`,
33
+ description: `List inbound and outbound messages for an agent within a time range (default last 24 hours); filter by sessionId (from list_sessions) to read one transcript. Returns { data: [{ timestamp, userId, sessionId, origin, type, channel, text, raw … }], nextPageToken }. ${DATA_NOT_INSTRUCTIONS} Maps to GET /v1/orgs/{org}/agents/{agent}/messages.`,
34
34
  kind: 'read',
35
35
  scope: 'messages:read',
36
36
  roleFloor: 'viewer',
@@ -55,9 +55,9 @@ exports.activityTools = [
55
55
  run: async ({ client }, { agentId, ...query }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/messages`), query),
56
56
  }),
57
57
  (0, tool_1.defineTool)({
58
- name: 'list_conversations',
59
- title: 'List conversations',
60
- description: `List an agent's conversations (30-minute sessions) within a time range (default last 24 hours): sessionId, userId, channel, startedAt, endedAt, messageCount, firstMessagePreview. Read a transcript with list_messages + sessionId. Not paginated beyond limit — narrow the range for busy agents. Maps to GET /v1/orgs/{org}/agents/{agent}/conversations.`,
58
+ name: 'list_sessions',
59
+ title: 'List sessions',
60
+ description: `List an agent's sessions (one row per ≤30-min-idle sitting) within a time range (default last 24 hours): sessionId, userId, channel, startedAt, endedAt, messageCount, firstMessagePreview. Read a transcript with list_messages + sessionId. Not paginated beyond limit — narrow the range for busy agents. Maps to GET /v1/orgs/{org}/agents/{agent}/sessions.`,
61
61
  kind: 'read',
62
62
  scope: 'messages:read',
63
63
  roleFloor: 'viewer',
@@ -69,6 +69,22 @@ exports.activityTools = [
69
69
  limit: trafficLimit,
70
70
  includeTest,
71
71
  },
72
+ run: async ({ client }, { agentId, ...query }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/sessions`), query),
73
+ }),
74
+ (0, tool_1.defineTool)({
75
+ name: 'list_conversations',
76
+ title: 'List conversations (deprecated)',
77
+ description: `DEPRECATED alias of list_sessions — same parameters, same result shape; the listed entity is a session (30-min sitting), not the all-time conversation. Use list_sessions. Maps to GET /v1/orgs/{org}/agents/{agent}/conversations (deprecated route alias).`,
78
+ kind: 'read',
79
+ scope: 'messages:read',
80
+ roleFloor: 'viewer',
81
+ input: {
82
+ agentId: zod_1.z.string(),
83
+ ...timeRange,
84
+ userId: zod_1.z.string().optional().describe('Channel-side user id'),
85
+ limit: trafficLimit,
86
+ includeTest,
87
+ },
72
88
  run: async ({ client }, { agentId, ...query }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/conversations`), query),
73
89
  }),
74
90
  (0, tool_1.defineTool)({
@@ -1 +1 @@
1
- {"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src/tools/activity.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kCAAqC;AAErC;;;;;;;;;GASG;AAEH,MAAM,qBAAqB,GACzB,sEAAsE,CAAC;AAEzE,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,OAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0EAA0E,CAAC;IACvF,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;CAC7E,CAAC;AAEF,MAAM,WAAW,GAAG,OAAC;KAClB,OAAO,EAAE;KACT,QAAQ,EAAE;KACV,QAAQ,CACP,iKAAiK,CAClK,CAAC;AAEJ,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AAE7E,QAAA,aAAa,GAAG;IAC3B,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,+QAA+Q,qBAAqB,sDAAsD;QACvW,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,eAAe;QACtB,SAAS,EAAE,QAAQ;QACnB,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C;CACH,CAAC"}
@@ -8,7 +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
+ const media_1 = require("./media");
12
12
  const me_1 = require("./me");
13
13
  const org_1 = require("./org");
14
14
  const people_1 = require("./people");
@@ -22,7 +22,7 @@ exports.allTools = [
22
22
  ...me_1.meTools,
23
23
  ...agents_1.agentTools,
24
24
  ...definition_1.definitionTools,
25
- ...images_1.imageTools,
25
+ ...media_1.mediaTools,
26
26
  ...capabilities_1.capabilityTools,
27
27
  ...channels_1.channelTools,
28
28
  ...people_1.peopleTools,
@@ -1 +1 @@
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"}
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,mCAAqC;AACrC,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,kBAAU;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"}
@@ -0,0 +1 @@
1
+ export declare const mediaTools: import("../tool").AnyTool[];
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mediaTools = void 0;
4
+ /**
5
+ * Media library — `/v1/orgs/{org}/agents/{agent}/media`.
6
+ *
7
+ * Media items an agent may show in rich cards, carousels and media
8
+ * messages (images; video kinds as rich channels allow). The platform
9
+ * hosts them (the object is created and deleted with the entry); content
10
+ * references them **by id**, never by URL: `[[card | Title ~ text | media:
11
+ * image:<id>]]`, `[[carousel …]]` lines, `[[media: image:<id>]]` in
12
+ * templates/playbooks, or `card.media` / `media` in Framework v2 responses.
13
+ * `name` and `usageHint` are what people see; `description` (vision-model
14
+ * generated, editable) is what the agent reads when choosing.
15
+ */
16
+ const zod_1 = require("zod");
17
+ const tool_1 = require("../tool");
18
+ const agentId = zod_1.z.string();
19
+ const mediaId = zod_1.z
20
+ .string()
21
+ .min(1)
22
+ .describe('The media id (per-agent slug, e.g. "showcase-authentic-ai")');
23
+ const textFields = {
24
+ name: zod_1.z.string().min(1).optional().describe('Operator label (human-facing)'),
25
+ description: zod_1.z
26
+ .string()
27
+ .optional()
28
+ .describe('What it shows — read by the agent when choosing. 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.mediaTools = [
35
+ (0, tool_1.defineTool)({
36
+ name: 'list_media',
37
+ title: 'List media',
38
+ description: "List the agent's media library — hosted images (and, as channels allow, videos) the agent may show in cards, carousels and media messages, each with an id (the reference key), a name, a usage hint and a description. Reference an item 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}/media.",
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)}/media`)),
45
+ }),
46
+ (0, tool_1.defineTool)({
47
+ name: 'get_media',
48
+ title: 'Get media item',
49
+ description: 'Read one media-library entry ({ id, kind, name, description, descriptionSource, usageHint?, url, contentType, bytes, width?, height? }). Maps to GET /v1/orgs/{org}/agents/{agent}/media/{mediaId}.',
50
+ kind: 'read',
51
+ scope: 'agents:read',
52
+ roleFloor: 'viewer',
53
+ input: { agentId, mediaId },
54
+ run: async ({ client }, { agentId, mediaId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/media/${encodeURIComponent(mediaId)}`)),
55
+ }),
56
+ (0, tool_1.defineTool)({
57
+ name: 'add_media',
58
+ title: 'Add media',
59
+ description: "Add an item to the agent's media 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}/media.",
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 file'),
67
+ id: zod_1.z
68
+ .string()
69
+ .optional()
70
+ .describe('Preferred id (slugified; suffixed when taken). Defaults from name.'),
71
+ ...textFields,
72
+ },
73
+ run: async ({ client }, { agentId, ...body }) => client.post(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/media`), body),
74
+ }),
75
+ (0, tool_1.defineTool)({
76
+ name: 'update_media',
77
+ title: 'Update media',
78
+ description: "Edit an item's name, description or usage hint (an empty usageHint clears it). The id never changes; to swap the picture use replace_media_content. Maps to PATCH /v1/orgs/{org}/agents/{agent}/media/{mediaId}.",
79
+ kind: 'write',
80
+ scope: 'agents:write',
81
+ roleFloor: 'editor',
82
+ profile: 'core',
83
+ input: { agentId, mediaId, ...textFields },
84
+ run: async ({ client }, { agentId, mediaId, usageHint, ...rest }) => client.patch(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/media/${encodeURIComponent(mediaId)}`), { ...rest, ...(usageHint === undefined ? {} : { usageHint: usageHint || null }) }),
85
+ }),
86
+ (0, tool_1.defineTool)({
87
+ name: 'replace_media_content',
88
+ title: 'Replace media file',
89
+ description: 'Replace the file behind an existing media id from a public http(s) URL — the "just update this picture" case. New hosted URL, description regenerated by the vision model; id, name and usage hint are kept, so every template referencing image:<id> shows the new picture. Maps to PUT /v1/orgs/{org}/agents/{agent}/media/{mediaId}/content.',
90
+ kind: 'write',
91
+ scope: 'agents:write',
92
+ roleFloor: 'editor',
93
+ input: {
94
+ agentId,
95
+ mediaId,
96
+ sourceUrl: zod_1.z.string().url().describe('Public http(s) URL of the new file'),
97
+ },
98
+ run: async ({ client }, { agentId, mediaId, sourceUrl }) => client.put(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/media/${encodeURIComponent(mediaId)}/content`), { sourceUrl }),
99
+ }),
100
+ (0, tool_1.defineTool)({
101
+ name: 'describe_media',
102
+ title: 'Regenerate media description',
103
+ description: 'Have the vision model rewrite the description from the stored file (replaces operator edits). Maps to POST /v1/orgs/{org}/agents/{agent}/media/{mediaId}:describe.',
104
+ kind: 'write',
105
+ scope: 'agents:write',
106
+ roleFloor: 'editor',
107
+ input: { agentId, mediaId },
108
+ run: async ({ client }, { agentId, mediaId }) => client.post(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/media/${encodeURIComponent(mediaId)}:describe`), {}),
109
+ }),
110
+ (0, tool_1.defineTool)({
111
+ name: 'delete_media',
112
+ title: 'Delete media',
113
+ description: 'Remove an item from the library AND delete its hosted file. Templates or playbooks still referencing `image:<id>` keep sending, without the picture (lint reports them as media.ref.unknown). Irreversible. Maps to DELETE /v1/orgs/{org}/agents/{agent}/media/{mediaId}.',
114
+ kind: 'destructive',
115
+ scope: 'agents:write',
116
+ roleFloor: 'editor',
117
+ profile: 'core',
118
+ input: { agentId, mediaId },
119
+ run: async ({ client }, { agentId, mediaId }) => {
120
+ await client.delete(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/media/${encodeURIComponent(mediaId)}`));
121
+ return { ok: true, deleted: mediaId };
122
+ },
123
+ }),
124
+ ];
125
+ //# sourceMappingURL=media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/tools/media.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,UAAU,GAAG;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC5E,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,oJAAoJ,CACrJ;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,YAAY;QAClB,KAAK,EAAE,YAAY;QACnB,WAAW,EACT,2cAA2c;QAC7c,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,QAAQ,CAAC,CAAC;KACnF,CAAC;IACF,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE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A8B;QACrC,WAAW,EACT,oKAAoK;QACtK,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;QAC3B,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAC9C,MAAM,CAAC,IAAI,CACT,MAAM,MAAM,CAAC,OAAO,CAClB,WAAW,kBAAkB,CAAC,OAAO,CAAC,UAAU,kBAAkB,CAAC,OAAO,CAAC,WAAW,CACvF,EACD,EAAE,CACH;KACJ,CAAC;IACF,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,2QAA2Q;QAC7Q,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE,MAAM;QACf,KAAK,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,UAAU,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAC9E,CACF,CAAC;YACF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QACxC,CAAC;KACF,CAAC;CACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anychat-ai/mcp",
3
- "version": "0.5.0",
3
+ "version": "0.7.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",
@@ -1 +0,0 @@
1
- export declare const imageTools: import("../tool").AnyTool[];
@@ -1,111 +0,0 @@
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
@@ -1 +0,0 @@
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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