@anaella/mcp 0.2.2 → 0.3.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.
|
@@ -27,9 +27,14 @@ var fail = (err) => {
|
|
|
27
27
|
if (err instanceof AnaellaApiError) {
|
|
28
28
|
const detail = err.details?.length ? `
|
|
29
29
|
Details: ${JSON.stringify(err.details)}` : "";
|
|
30
|
+
const next = err.next ? `
|
|
31
|
+
Next: ${JSON.stringify(err.next)}` : "";
|
|
30
32
|
return {
|
|
31
33
|
content: [
|
|
32
|
-
{
|
|
34
|
+
{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: `Error [${err.code}] (HTTP ${err.status}): ${err.message}${detail}${next}`
|
|
37
|
+
}
|
|
33
38
|
],
|
|
34
39
|
isError: true
|
|
35
40
|
};
|
|
@@ -48,10 +53,12 @@ function buildTools(client) {
|
|
|
48
53
|
{
|
|
49
54
|
name: "list_channels",
|
|
50
55
|
config: {
|
|
51
|
-
description: "List the connected social channels
|
|
56
|
+
description: "List the channels you can post to (connected social channels with publishing). Call this FIRST to get the channel ids you pass to create_post.",
|
|
52
57
|
inputSchema: {}
|
|
53
58
|
},
|
|
54
|
-
handler: wrap(
|
|
59
|
+
handler: wrap(
|
|
60
|
+
async () => (await client.listChannels()).filter((c) => c.features.includes("publish"))
|
|
61
|
+
)
|
|
55
62
|
},
|
|
56
63
|
{
|
|
57
64
|
name: "create_post",
|
|
@@ -134,6 +141,52 @@ function buildTools(client) {
|
|
|
134
141
|
}
|
|
135
142
|
},
|
|
136
143
|
handler: wrap((args) => client.uploadUrls(args.urls))
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "find",
|
|
147
|
+
config: {
|
|
148
|
+
description: 'Find Anaella capabilities by what you want to do (e.g. "post to instagram", "generate an image"). Returns ids, summaries and dollar prices. Free. Then call explain, then do.',
|
|
149
|
+
inputSchema: {
|
|
150
|
+
q: z.string().optional().describe("What you want to do, in plain words"),
|
|
151
|
+
category: z.string().optional()
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
handler: wrap(
|
|
155
|
+
(args) => client.find(args.q ?? "", { category: args.category })
|
|
156
|
+
)
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "explain",
|
|
160
|
+
config: {
|
|
161
|
+
description: "A capability's input and output JSON Schema, price and description. Free. Call before do.",
|
|
162
|
+
inputSchema: { id: z.string().describe("Capability id from find") }
|
|
163
|
+
},
|
|
164
|
+
handler: wrap((args) => client.explain(args.id))
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "do",
|
|
168
|
+
config: {
|
|
169
|
+
description: "Run a capability with input matching its explain schema. Billed per call from the balance. Some capabilities have a daily quota (quotaPerDay in find/explain); beyond it the call fails with 429 rate_limited and resetAt. Async capabilities return a queued job: pass wait=true to block until it finishes, or poll with job.",
|
|
170
|
+
inputSchema: {
|
|
171
|
+
id: z.string().describe("Capability id"),
|
|
172
|
+
input: z.record(z.unknown()).optional().describe("Input object per the explain schema"),
|
|
173
|
+
wait: z.boolean().optional().describe("Wait for async jobs to finish (default false)")
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
handler: wrap(
|
|
177
|
+
async (args) => {
|
|
178
|
+
const job = await client.do(args.id, args.input ?? {});
|
|
179
|
+
return args.wait && (job.status === "queued" || job.status === "running") ? client.waitForJob(job.id) : job;
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "job",
|
|
185
|
+
config: {
|
|
186
|
+
description: "Status, output, error and cost of a job returned by do.",
|
|
187
|
+
inputSchema: { id: z.string() }
|
|
188
|
+
},
|
|
189
|
+
handler: wrap((args) => client.job(args.id))
|
|
137
190
|
}
|
|
138
191
|
];
|
|
139
192
|
}
|
package/dist/http.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anaella/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "MCP server for anaella.com — schedule and publish social posts via the /v1 API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"smoke": "bun run src/smoke.ts"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@anaella/client": "^0.
|
|
23
|
+
"@anaella/client": "^0.2.0",
|
|
24
24
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
25
25
|
"zod": "^3.25.76"
|
|
26
26
|
},
|