@wiro-ai/wiro-mcp 1.3.4 → 1.4.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.
Files changed (270) hide show
  1. package/README.md +173 -16
  2. package/dist/client.d.ts +10 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +39 -20
  5. package/dist/client.js.map +1 -1
  6. package/dist/index.js +4 -2
  7. package/dist/index.js.map +1 -1
  8. package/dist/instructions.d.ts +2 -0
  9. package/dist/instructions.d.ts.map +1 -0
  10. package/dist/instructions.js +25 -0
  11. package/dist/instructions.js.map +1 -0
  12. package/dist/playbooks.d.ts +8 -0
  13. package/dist/playbooks.d.ts.map +1 -0
  14. package/dist/playbooks.js +665 -0
  15. package/dist/playbooks.js.map +1 -0
  16. package/dist/prompts.d.ts +4 -0
  17. package/dist/prompts.d.ts.map +1 -0
  18. package/dist/prompts.js +133 -0
  19. package/dist/prompts.js.map +1 -0
  20. package/dist/server.d.ts +9 -2
  21. package/dist/server.d.ts.map +1 -1
  22. package/dist/server.js +9 -3
  23. package/dist/server.js.map +1 -1
  24. package/dist/tools/apply-agent-skills.d.ts +4 -0
  25. package/dist/tools/apply-agent-skills.d.ts.map +1 -0
  26. package/dist/tools/apply-agent-skills.js +545 -0
  27. package/dist/tools/apply-agent-skills.js.map +1 -0
  28. package/dist/tools/cancel-agent-message.d.ts +4 -0
  29. package/dist/tools/cancel-agent-message.d.ts.map +1 -0
  30. package/dist/tools/cancel-agent-message.js +126 -0
  31. package/dist/tools/cancel-agent-message.js.map +1 -0
  32. package/dist/tools/cancel-task.js +3 -3
  33. package/dist/tools/cancel-task.js.map +1 -1
  34. package/dist/tools/clone-workflow.d.ts +4 -0
  35. package/dist/tools/clone-workflow.d.ts.map +1 -0
  36. package/dist/tools/clone-workflow.js +83 -0
  37. package/dist/tools/clone-workflow.js.map +1 -0
  38. package/dist/tools/connect-agent-oauth.d.ts +4 -0
  39. package/dist/tools/connect-agent-oauth.d.ts.map +1 -0
  40. package/dist/tools/connect-agent-oauth.js +508 -0
  41. package/dist/tools/connect-agent-oauth.js.map +1 -0
  42. package/dist/tools/control-agent.d.ts +4 -0
  43. package/dist/tools/control-agent.d.ts.map +1 -0
  44. package/dist/tools/control-agent.js +274 -0
  45. package/dist/tools/control-agent.js.map +1 -0
  46. package/dist/tools/create-workflow.d.ts +100 -0
  47. package/dist/tools/create-workflow.d.ts.map +1 -0
  48. package/dist/tools/create-workflow.js +103 -0
  49. package/dist/tools/create-workflow.js.map +1 -0
  50. package/dist/tools/delete-agent-session.d.ts +6 -0
  51. package/dist/tools/delete-agent-session.d.ts.map +1 -0
  52. package/dist/tools/delete-agent-session.js +134 -0
  53. package/dist/tools/delete-agent-session.js.map +1 -0
  54. package/dist/tools/delete-agent.d.ts +4 -0
  55. package/dist/tools/delete-agent.d.ts.map +1 -0
  56. package/dist/tools/delete-agent.js +144 -0
  57. package/dist/tools/delete-agent.js.map +1 -0
  58. package/dist/tools/delete-workflow.d.ts +4 -0
  59. package/dist/tools/delete-workflow.d.ts.map +1 -0
  60. package/dist/tools/delete-workflow.js +77 -0
  61. package/dist/tools/delete-workflow.js.map +1 -0
  62. package/dist/tools/deploy-agent.d.ts +4 -0
  63. package/dist/tools/deploy-agent.d.ts.map +1 -0
  64. package/dist/tools/deploy-agent.js +455 -0
  65. package/dist/tools/deploy-agent.js.map +1 -0
  66. package/dist/tools/disconnect-agent-oauth.d.ts +4 -0
  67. package/dist/tools/disconnect-agent-oauth.d.ts.map +1 -0
  68. package/dist/tools/disconnect-agent-oauth.js +118 -0
  69. package/dist/tools/disconnect-agent-oauth.js.map +1 -0
  70. package/dist/tools/get-account.d.ts +4 -0
  71. package/dist/tools/get-account.d.ts.map +1 -0
  72. package/dist/tools/get-account.js +110 -0
  73. package/dist/tools/get-account.js.map +1 -0
  74. package/dist/tools/get-agent-activity.d.ts +4 -0
  75. package/dist/tools/get-agent-activity.d.ts.map +1 -0
  76. package/dist/tools/get-agent-activity.js +383 -0
  77. package/dist/tools/get-agent-activity.js.map +1 -0
  78. package/dist/tools/get-agent-conversation.d.ts +4 -0
  79. package/dist/tools/get-agent-conversation.d.ts.map +1 -0
  80. package/dist/tools/get-agent-conversation.js +224 -0
  81. package/dist/tools/get-agent-conversation.js.map +1 -0
  82. package/dist/tools/get-agent-message.d.ts +4 -0
  83. package/dist/tools/get-agent-message.d.ts.map +1 -0
  84. package/dist/tools/get-agent-message.js +68 -0
  85. package/dist/tools/get-agent-message.js.map +1 -0
  86. package/dist/tools/get-agent-template.d.ts +4 -0
  87. package/dist/tools/get-agent-template.d.ts.map +1 -0
  88. package/dist/tools/get-agent-template.js +107 -0
  89. package/dist/tools/get-agent-template.js.map +1 -0
  90. package/dist/tools/get-model-schema.d.ts +5 -1
  91. package/dist/tools/get-model-schema.d.ts.map +1 -1
  92. package/dist/tools/get-model-schema.js +136 -8
  93. package/dist/tools/get-model-schema.js.map +1 -1
  94. package/dist/tools/get-my-agent.d.ts +4 -0
  95. package/dist/tools/get-my-agent.d.ts.map +1 -0
  96. package/dist/tools/get-my-agent.js +78 -0
  97. package/dist/tools/get-my-agent.js.map +1 -0
  98. package/dist/tools/get-playbook.d.ts +3 -0
  99. package/dist/tools/get-playbook.d.ts.map +1 -0
  100. package/dist/tools/get-playbook.js +50 -0
  101. package/dist/tools/get-playbook.js.map +1 -0
  102. package/dist/tools/get-task-price.d.ts.map +1 -1
  103. package/dist/tools/get-task-price.js +42 -15
  104. package/dist/tools/get-task-price.js.map +1 -1
  105. package/dist/tools/get-task.d.ts.map +1 -1
  106. package/dist/tools/get-task.js +4 -3
  107. package/dist/tools/get-task.js.map +1 -1
  108. package/dist/tools/get-workflow.d.ts +9 -0
  109. package/dist/tools/get-workflow.d.ts.map +1 -0
  110. package/dist/tools/get-workflow.js +99 -0
  111. package/dist/tools/get-workflow.js.map +1 -0
  112. package/dist/tools/index.d.ts +62 -2
  113. package/dist/tools/index.d.ts.map +1 -1
  114. package/dist/tools/index.js +127 -14
  115. package/dist/tools/index.js.map +1 -1
  116. package/dist/tools/kill-task.d.ts.map +1 -1
  117. package/dist/tools/kill-task.js +10 -6
  118. package/dist/tools/kill-task.js.map +1 -1
  119. package/dist/tools/list-agent-skills.d.ts +4 -0
  120. package/dist/tools/list-agent-skills.d.ts.map +1 -0
  121. package/dist/tools/list-agent-skills.js +242 -0
  122. package/dist/tools/list-agent-skills.js.map +1 -0
  123. package/dist/tools/list-agent-templates.d.ts +4 -0
  124. package/dist/tools/list-agent-templates.d.ts.map +1 -0
  125. package/dist/tools/list-agent-templates.js +110 -0
  126. package/dist/tools/list-agent-templates.js.map +1 -0
  127. package/dist/tools/list-my-agents.d.ts +4 -0
  128. package/dist/tools/list-my-agents.d.ts.map +1 -0
  129. package/dist/tools/list-my-agents.js +90 -0
  130. package/dist/tools/list-my-agents.js.map +1 -0
  131. package/dist/tools/list-studio-results.d.ts +4 -0
  132. package/dist/tools/list-studio-results.d.ts.map +1 -0
  133. package/dist/tools/list-studio-results.js +95 -0
  134. package/dist/tools/list-studio-results.js.map +1 -0
  135. package/dist/tools/list-tasks.d.ts.map +1 -1
  136. package/dist/tools/list-tasks.js +7 -5
  137. package/dist/tools/list-tasks.js.map +1 -1
  138. package/dist/tools/list-workflow-runs.d.ts +4 -0
  139. package/dist/tools/list-workflow-runs.d.ts.map +1 -0
  140. package/dist/tools/list-workflow-runs.js +110 -0
  141. package/dist/tools/list-workflow-runs.js.map +1 -0
  142. package/dist/tools/list-workflows.d.ts +4 -0
  143. package/dist/tools/list-workflows.d.ts.map +1 -0
  144. package/dist/tools/list-workflows.js +143 -0
  145. package/dist/tools/list-workflows.js.map +1 -0
  146. package/dist/tools/manage-agent-billing.d.ts +4 -0
  147. package/dist/tools/manage-agent-billing.d.ts.map +1 -0
  148. package/dist/tools/manage-agent-billing.js +764 -0
  149. package/dist/tools/manage-agent-billing.js.map +1 -0
  150. package/dist/tools/manage-agent-custom-skill.d.ts +4 -0
  151. package/dist/tools/manage-agent-custom-skill.d.ts.map +1 -0
  152. package/dist/tools/manage-agent-custom-skill.js +537 -0
  153. package/dist/tools/manage-agent-custom-skill.js.map +1 -0
  154. package/dist/tools/recommend-model.d.ts.map +1 -1
  155. package/dist/tools/recommend-model.js +6 -5
  156. package/dist/tools/recommend-model.js.map +1 -1
  157. package/dist/tools/resume-workflow-run.d.ts +4 -0
  158. package/dist/tools/resume-workflow-run.d.ts.map +1 -0
  159. package/dist/tools/resume-workflow-run.js +69 -0
  160. package/dist/tools/resume-workflow-run.js.map +1 -0
  161. package/dist/tools/run-model.d.ts.map +1 -1
  162. package/dist/tools/run-model.js +39 -3
  163. package/dist/tools/run-model.js.map +1 -1
  164. package/dist/tools/run-workflow.d.ts +6 -0
  165. package/dist/tools/run-workflow.d.ts.map +1 -0
  166. package/dist/tools/run-workflow.js +132 -0
  167. package/dist/tools/run-workflow.js.map +1 -0
  168. package/dist/tools/save-workflow-from-agent.d.ts +4 -0
  169. package/dist/tools/save-workflow-from-agent.d.ts.map +1 -0
  170. package/dist/tools/save-workflow-from-agent.js +283 -0
  171. package/dist/tools/save-workflow-from-agent.js.map +1 -0
  172. package/dist/tools/schemas.d.ts +62 -12
  173. package/dist/tools/schemas.d.ts.map +1 -1
  174. package/dist/tools/schemas.js +17 -3
  175. package/dist/tools/schemas.js.map +1 -1
  176. package/dist/tools/search-models.js +6 -6
  177. package/dist/tools/search-models.js.map +1 -1
  178. package/dist/tools/send-agent-message.d.ts +4 -0
  179. package/dist/tools/send-agent-message.d.ts.map +1 -0
  180. package/dist/tools/send-agent-message.js +156 -0
  181. package/dist/tools/send-agent-message.js.map +1 -0
  182. package/dist/tools/set-agent-credentials.d.ts +4 -0
  183. package/dist/tools/set-agent-credentials.d.ts.map +1 -0
  184. package/dist/tools/set-agent-credentials.js +529 -0
  185. package/dist/tools/set-agent-credentials.js.map +1 -0
  186. package/dist/tools/update-agent.d.ts +4 -0
  187. package/dist/tools/update-agent.d.ts.map +1 -0
  188. package/dist/tools/update-agent.js +178 -0
  189. package/dist/tools/update-agent.js.map +1 -0
  190. package/dist/tools/update-workflow.d.ts +201 -0
  191. package/dist/tools/update-workflow.d.ts.map +1 -0
  192. package/dist/tools/update-workflow.js +168 -0
  193. package/dist/tools/update-workflow.js.map +1 -0
  194. package/dist/tools/upload-file.d.ts.map +1 -1
  195. package/dist/tools/upload-file.js +4 -3
  196. package/dist/tools/upload-file.js.map +1 -1
  197. package/dist/tools/wait-for-workflow-run.d.ts +259 -0
  198. package/dist/tools/wait-for-workflow-run.d.ts.map +1 -0
  199. package/dist/tools/wait-for-workflow-run.js +190 -0
  200. package/dist/tools/wait-for-workflow-run.js.map +1 -0
  201. package/dist/types.d.ts +12 -0
  202. package/dist/types.d.ts.map +1 -1
  203. package/dist/types.js.map +1 -1
  204. package/dist/utils/agent-catalog.d.ts +1256 -0
  205. package/dist/utils/agent-catalog.d.ts.map +1 -0
  206. package/dist/utils/agent-catalog.js +388 -0
  207. package/dist/utils/agent-catalog.js.map +1 -0
  208. package/dist/utils/agent-config.d.ts +441 -0
  209. package/dist/utils/agent-config.d.ts.map +1 -0
  210. package/dist/utils/agent-config.js +1667 -0
  211. package/dist/utils/agent-config.js.map +1 -0
  212. package/dist/utils/agent-message.d.ts +115 -0
  213. package/dist/utils/agent-message.d.ts.map +1 -0
  214. package/dist/utils/agent-message.js +246 -0
  215. package/dist/utils/agent-message.js.map +1 -0
  216. package/dist/utils/agent-targets.d.ts +76 -0
  217. package/dist/utils/agent-targets.d.ts.map +1 -0
  218. package/dist/utils/agent-targets.js +408 -0
  219. package/dist/utils/agent-targets.js.map +1 -0
  220. package/dist/utils/agent-turns.d.ts +354 -0
  221. package/dist/utils/agent-turns.d.ts.map +1 -0
  222. package/dist/utils/agent-turns.js +623 -0
  223. package/dist/utils/agent-turns.js.map +1 -0
  224. package/dist/utils/api.d.ts +40 -0
  225. package/dist/utils/api.d.ts.map +1 -0
  226. package/dist/utils/api.js +111 -0
  227. package/dist/utils/api.js.map +1 -0
  228. package/dist/utils/format.d.ts +38 -1
  229. package/dist/utils/format.d.ts.map +1 -1
  230. package/dist/utils/format.js +162 -13
  231. package/dist/utils/format.js.map +1 -1
  232. package/dist/utils/media.d.ts +28 -0
  233. package/dist/utils/media.d.ts.map +1 -0
  234. package/dist/utils/media.js +65 -0
  235. package/dist/utils/media.js.map +1 -0
  236. package/dist/utils/poll.d.ts +39 -0
  237. package/dist/utils/poll.d.ts.map +1 -0
  238. package/dist/utils/poll.js +111 -0
  239. package/dist/utils/poll.js.map +1 -0
  240. package/dist/utils/remote-file.js +2 -2
  241. package/dist/utils/remote-file.js.map +1 -1
  242. package/dist/utils/structured.d.ts +2 -0
  243. package/dist/utils/structured.d.ts.map +1 -1
  244. package/dist/utils/structured.js +9 -6
  245. package/dist/utils/structured.js.map +1 -1
  246. package/dist/utils/studio-runs.d.ts +87 -0
  247. package/dist/utils/studio-runs.d.ts.map +1 -0
  248. package/dist/utils/studio-runs.js +167 -0
  249. package/dist/utils/studio-runs.js.map +1 -0
  250. package/dist/utils/user-agent.d.ts +1140 -0
  251. package/dist/utils/user-agent.d.ts.map +1 -0
  252. package/dist/utils/user-agent.js +802 -0
  253. package/dist/utils/user-agent.js.map +1 -0
  254. package/dist/utils/workflow-agent.d.ts +151 -0
  255. package/dist/utils/workflow-agent.d.ts.map +1 -0
  256. package/dist/utils/workflow-agent.js +292 -0
  257. package/dist/utils/workflow-agent.js.map +1 -0
  258. package/dist/utils/workflow-artifacts.d.ts +160 -0
  259. package/dist/utils/workflow-artifacts.d.ts.map +1 -0
  260. package/dist/utils/workflow-artifacts.js +801 -0
  261. package/dist/utils/workflow-artifacts.js.map +1 -0
  262. package/dist/utils/workflow-save.d.ts +123 -0
  263. package/dist/utils/workflow-save.d.ts.map +1 -0
  264. package/dist/utils/workflow-save.js +734 -0
  265. package/dist/utils/workflow-save.js.map +1 -0
  266. package/dist/utils/workflow.d.ts +559 -0
  267. package/dist/utils/workflow.d.ts.map +1 -0
  268. package/dist/utils/workflow.js +613 -0
  269. package/dist/utils/workflow.js.map +1 -0
  270. package/package.json +1 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Wiro MCP Server
6
6
 
7
- Official MCP server for Wiro AI: search, price and run image, video, audio and LLM models from Cursor, Claude Code, Claude Desktop, Windsurf and any other MCP client.
7
+ Official MCP server for Wiro AI: run image, video, audio and LLM models, build and run workflows, and deploy and talk to AI agents from Cursor, Claude Code, Claude Desktop, Windsurf and any other MCP client.
8
8
 
9
9
  [![npm](https://img.shields.io/npm/v/@wiro-ai/wiro-mcp?style=for-the-badge&color=111111)](https://www.npmjs.com/package/@wiro-ai/wiro-mcp) [![Node.js 20+](https://img.shields.io/badge/Node.js-20%2B-111111?style=for-the-badge&color=111111)](#quick-start) [![MCP server](https://img.shields.io/badge/MCP-server-111111?style=for-the-badge&color=111111)](https://modelcontextprotocol.io/) [![License: MIT](https://img.shields.io/badge/license-MIT-111111?style=for-the-badge&color=111111)](./LICENSE)
10
10
 
@@ -14,7 +14,13 @@ Official MCP server for Wiro AI: search, price and run image, video, audio and L
14
14
 
15
15
  </div>
16
16
 
17
- `@wiro-ai/wiro-mcp` is a TypeScript [Model Context Protocol](https://modelcontextprotocol.io/) server that runs locally over stdio with `npx`. Its 13 tools let an AI assistant search the Wiro AI model catalog, read a model's parameters and price, run it and wait for the result, upload input files, browse past tasks and search the Wiro AI docs. The hosted server at `https://mcp.wiro.ai/v1` serves the same tools with nothing to install.
17
+ `@wiro-ai/wiro-mcp` is a TypeScript [Model Context Protocol](https://modelcontextprotocol.io/) server that runs locally over stdio with `npx`. Its tools are grouped in three sets:
18
+
19
+ - **Models**: search the Wiro AI model catalog, read a model's parameters and price, run it and wait for the result, upload input files and browse past tasks.
20
+ - **Workflows**: build multi-step workflows that chain models, run them, resume failed runs, browse the public gallery, and design workflows together with the Workflow Agent.
21
+ - **Agents**: talk to Studio, the creative agent that runs models for you, and deploy, configure, run and message your own agents built from templates or from scratch.
22
+
23
+ Playbooks explain each job step by step, so the assistant knows the order of calls, what costs money and what needs your approval. The hosted server at `https://mcp.wiro.ai/v1` serves the same tools with nothing to install.
18
24
 
19
25
  ## Quick Start
20
26
 
@@ -130,6 +136,8 @@ Store `WIRO_MCP_AUTH` (your API key, or `API_KEY:API_SECRET`) in `~/.hermes/.env
130
136
 
131
137
  Ask your AI assistant:
132
138
 
139
+ **Models**
140
+
133
141
  - *"Generate a photorealistic image of a mountain lake at sunset"*
134
142
  - *"What video generation models are available on Wiro?"*
135
143
  - *"Show me the parameters for google/veo3-1"*
@@ -137,6 +145,20 @@ Ask your AI assistant:
137
145
  - *"Check the status of my last task"*
138
146
  - *"Show my latest productions and open the newest result"*
139
147
 
148
+ **Workflows**
149
+
150
+ - *"Build a workflow that turns a product photo into a short ad video, then run it on this photo"*
151
+ - *"Find a public workflow for podcast covers and run it with my show's name"*
152
+ - *"Ask the Workflow Agent to add an upscale step to my product ad workflow and save it"*
153
+ - *"Why did my last workflow run fail? Resume it if it can be resumed"*
154
+
155
+ **Agents**
156
+
157
+ - *"Ask Studio for three logo ideas for a coffee shop"*
158
+ - *"Which agent templates can manage Instagram? What does each plan cost?"*
159
+ - *"Deploy the Instagram manager agent on the Starter plan and tell me what it still needs"*
160
+ - *"Tell my support agent to summarise today's tickets"*
161
+
140
162
  ## Authentication
141
163
 
142
164
  Wiro AI supports two authentication types, chosen when you create a project:
@@ -164,11 +186,13 @@ The hosted server takes the same credentials as a bearer token:
164
186
 
165
187
  ## Available Tools
166
188
 
189
+ ### Models
190
+
167
191
  | Tool | Description |
168
192
  |------|-------------|
169
193
  | `search_models` | Search and browse AI models by keyword, category, or owner |
170
- | `get_model_schema` | Get full parameter schema and pricing for any model |
171
- | `recommend_model` | Describe what you want to build, get model recommendations by relevance |
194
+ | `get_model_schema` | Get full parameter schema and pricing for any model, or the parameters and output ports of a workflow utility |
195
+ | `recommend_model` | Find models for a goal from two or three key words, best matches first |
172
196
  | `explore` | Browse curated models grouped by category, no parameters needed |
173
197
  | `run_model` | Run any model, waiting up to 45s by default before it returns a recoverable task token |
174
198
  | `wait_for_task` | Continue waiting for an existing task without submitting or billing a duplicate run |
@@ -176,14 +200,124 @@ The hosted server takes the same credentials as a bearer token:
176
200
  | `list_tasks` | Browse authenticated task history across conversations, then continue with `get_task` |
177
201
  | `get_task_price` | Get the cost of a completed task |
178
202
  | `cancel_task` | Cancel a queued task |
179
- | `kill_task` | Kill a running task |
180
- | `upload_file` | Upload a file from a public http(s) URL (up to 200 MB) for use as model input |
181
- | `search_docs` | Search the Wiro documentation for guides and API references |
203
+ | `kill_task` | Stop a queued or running task |
204
+ | `upload_file` | Upload a file from a public http(s) URL (up to about 100 MB) for use as model input |
182
205
 
183
206
  For long generations, `run_model` returns the existing task ID and token when its
184
207
  wait budget expires. The assistant must continue with `wait_for_task`; retrying
185
208
  `run_model` creates a separate billable task.
186
209
 
210
+ ### Workflows
211
+
212
+ A workflow chains models and built-in utility steps into one graph with its own
213
+ inputs and outputs. Every model step is charged like a normal model run when it
214
+ finishes. Wiro fills a model input you leave out with the model's default, so the
215
+ save result lists what it filled, and a graph can be at most 40 KB of JSON.
216
+
217
+ | Tool | Description |
218
+ |------|-------------|
219
+ | `list_workflows` | List the workflows in your workspace, or search the public gallery by text, tag or model |
220
+ | `get_workflow` | Read a workflow's inputs, outputs and step graph |
221
+ | `create_workflow` | Save a new workflow from a step graph. Wiro checks it against the live model catalog and returns every problem it finds at once |
222
+ | `update_workflow` | Edit a workflow's title, description, tags or graph without overwriting newer changes; a new graph is saved only after you confirm a summary of the change |
223
+ | `clone_workflow` | Copy a public workflow into your workspace |
224
+ | `delete_workflow` | Delete a workflow, after your confirmation |
225
+ | `run_workflow` | Run a workflow and wait for its outputs; can stop after a chosen step to test the first steps |
226
+ | `wait_for_workflow_run` | Keep waiting on a run, read its outputs, or see why a step failed |
227
+ | `resume_workflow_run` | Continue a failed or stopped run without paying again for finished steps |
228
+ | `list_workflow_runs` | Browse past and current runs, including runs started on wiro.ai |
229
+ | `save_workflow_from_agent` | Save a workflow the Workflow Agent proposed, as a new workflow, or onto an existing one after you confirm a summary of the change |
230
+
231
+ The **Workflow Agent** designs workflows with you in plain language: talk to it
232
+ with `send_agent_message` and `agent: "workflow-agent"`, attach an existing
233
+ workflow to edit, then save its proposal with `save_workflow_from_agent`.
234
+ Conversations started through this server belong to the connected project and
235
+ are separate from your Workflow Agent chats on wiro.ai.
236
+
237
+ ### Agents
238
+
239
+ Talk to any Wiro agent with one set of tools. `agent` is `"studio"`, `"workflow-agent"`
240
+ or the id of one of your own agents.
241
+
242
+ | Tool | Description |
243
+ |------|-------------|
244
+ | `send_agent_message` | Send a message and wait for the reply, with any media, workflows or model runs it produced |
245
+ | `get_agent_message` | Keep waiting on a reply, or read one again |
246
+ | `get_agent_conversation` | List conversations, or read one conversation's history |
247
+ | `cancel_agent_message` | Stop a reply that is still being written |
248
+ | `delete_agent_session` | Delete a conversation and the agent's memory of it, after your confirmation |
249
+ | `list_studio_results` | List the images, videos and other results Studio generated for you |
250
+
251
+ **Studio** is Wiro's creative agent: it picks and runs models for you and charges
252
+ your wallet after each reply. Your own agents run on a monthly plan with credits.
253
+
254
+ | Tool | Description |
255
+ |------|-------------|
256
+ | `list_agent_templates` | Browse ready-made agent templates and their monthly prices |
257
+ | `get_agent_template` | Read a template's skills, plans, and the accounts and keys it needs |
258
+ | `list_agent_skills` | Browse the skills an agent can have, and what each one needs to work |
259
+ | `deploy_agent` | Deploy an agent from a template or build one from skills; shows the price and asks before charging |
260
+ | `list_my_agents` | List your agents with their status, plan and credits |
261
+ | `get_my_agent` | Read one agent's setup, plan and credits; can wait until it is running |
262
+ | `control_agent` | Start, stop or restart an agent |
263
+ | `update_agent` | Change an agent's name, description, time zone, models and chat commands |
264
+ | `apply_agent_skills` | Turn skills on or off; shows the price change and asks before charging |
265
+ | `set_agent_credentials` | Save the keys, tokens and settings an agent's skills and channels need, such as a Telegram bot token or a Gmail app password |
266
+ | `connect_agent_oauth` | Connect sign-in accounts such as HubSpot or X; you approve the connection in your browser. Some services need your own app keys or a token first |
267
+ | `disconnect_agent_oauth` | Disconnect a connected account, after your confirmation |
268
+ | `manage_agent_custom_skill` | Add, edit, schedule, restore or remove an agent's own instructions and scheduled tasks |
269
+ | `manage_agent_billing` | Subscribe, upgrade to Pro, cancel, renew or buy extra credits from your wallet, after your confirmation |
270
+ | `get_agent_activity` | Read an agent's credit usage and activity logs |
271
+ | `delete_agent` | Delete an agent, after your confirmation |
272
+
273
+ ### Account and guides
274
+
275
+ | Tool | Description |
276
+ |------|-------------|
277
+ | `get_account` | Show which workspace the connected project belongs to and its wallet balance |
278
+ | `get_playbook` | Step-by-step guides: getting started, models, workflows, workflow graphs, the Workflow Agent, Studio, agents and billing |
279
+ | `search_docs` | Search the Wiro documentation for guides and API references |
280
+
281
+ The server also offers prompts for common jobs (`build_workflow`, `deploy_agent`,
282
+ `create_with_studio`, `talk_to_my_agent`). In clients that support MCP prompts
283
+ they appear as ready-made commands.
284
+
285
+ ### Choosing tool groups
286
+
287
+ All groups are on by default. Some clients work best with fewer tools; set
288
+ `WIRO_TOOLSETS` to a comma-separated list of `models`, `workflows` and `agents`
289
+ to load only those. `get_account`, `get_playbook` and `search_docs` are always
290
+ available, and `workflows` also brings the model search tools it needs. The
291
+ conversation tools for Studio and the Workflow Agent, with
292
+ `save_workflow_from_agent`, come with either `workflows` or `agents`, and each
293
+ prompt appears only when its tools are loaded. If a job needs a tool from a
294
+ group that is not loaded, the server instructions tell the assistant to say so.
295
+
296
+ ```json
297
+ "env": {
298
+ "WIRO_API_KEY": "your-api-key",
299
+ "WIRO_TOOLSETS": "models,workflows"
300
+ }
301
+ ```
302
+
303
+ ### Paid and irreversible actions
304
+
305
+ Running a model or workflow, sending a message to Studio or the Workflow Agent,
306
+ and messages to your own agents (which use the agent's credits) cost money. Agent
307
+ plans, plan changes, credit packs and skill changes are charged to your wallet,
308
+ so those tools first return the price (an estimate for prorated changes such as
309
+ an upgrade to Pro) and only act when called again with `confirm: true` and the
310
+ quote's reference (`confirm_charge_usd` with the approved amount, or the quote's
311
+ `idempotency_key` for skill changes) after you agree. If the price changed in
312
+ between, nothing is charged and you get a new quote. Deleting a workflow, an
313
+ agent, a conversation or an account connection also waits for `confirm: true`,
314
+ and so does replacing a workflow's steps with `update_workflow` or
315
+ `save_workflow_from_agent`: you see a summary of the change first. No tool adds
316
+ funds or takes a card payment: funds are added in the Wiro dashboard, and an
317
+ agent plan paid by card is upgraded or topped up there. The connected project
318
+ decides the workspace: a personal project uses your personal wallet, a team
319
+ project uses the team wallet.
320
+
187
321
  ### LLM-friendly responses
188
322
 
189
323
  All tools publish typed MCP input and output schemas. Successful calls return
@@ -191,10 +325,12 @@ All tools publish typed MCP input and output schemas. Successful calls return
191
325
  that only render text, and MCP resource links for generated media.
192
326
  Model parameters remain catalog-driven: `json` and `json-array` fields are sent
193
327
  as structured values in the same `run_model.params` object as all other inputs.
194
- Use `get_model_schema` as the source of truth for continuation fields.
195
- `previousTaskToken` is the single continuation reference. Send it with exactly
196
- one new `prompt` or non-empty `messages` value for a stateful next turn, or with
197
- `toolOutputs` for a tool-result continuation.
328
+ Use `get_model_schema` as the source of truth for continuation fields. A model
329
+ can continue a conversation only when its schema lists `session_id`: send the
330
+ same `session_id` on every turn, the first one included, with the next
331
+ `prompt`. A turn that ended with tool calls is continued with
332
+ `previousTaskToken`, that turn's task token, and `toolOutputs`, as the turn's
333
+ `nextAction` template shows.
198
334
 
199
335
  LLM task outputs preserve the public Task Detail segment names and casing:
200
336
  `thinking`, `answer`, `function_call`, and `custom_tool_call`, including
@@ -220,7 +356,8 @@ same ordinary `run_model.params` object back:
220
356
  "call_id": "call_01",
221
357
  "output": "<tool result>"
222
358
  }
223
- ]
359
+ ],
360
+ "session_id": "launch-taglines"
224
361
  }
225
362
  }
226
363
  }
@@ -235,7 +372,9 @@ instruction. Some MCP clients expose a `resource_link` as tool metadata instead
235
372
  of previewing it inside the tool card, so the assistant is explicitly told to
236
373
  render images and preserve clickable media links in its user-facing response.
237
374
  The standard resource link and full-resolution URL remain available to every
238
- client; no base64 media payload is required.
375
+ client; no base64 media payload is required. Only files on Wiro's own hosts are
376
+ returned this way. Other links in an agent's reply stay plain links in the text,
377
+ without the delivery instruction.
239
378
 
240
379
  Task responses use the stable states `submitted`, `running`, `completed`,
241
380
  `failed`, and `cancelled`. When more work is required, the response includes an
@@ -264,6 +403,15 @@ Generation chain:
264
403
  Cross-conversation history:
265
404
  `list_tasks → get_task`
266
405
 
406
+ Workflow chain:
407
+ `search_models → get_model_schema → create_workflow → run_workflow → wait_for_workflow_run`
408
+
409
+ Workflow Agent chain:
410
+ `send_agent_message (agent "workflow-agent") → get_agent_message → save_workflow_from_agent → run_workflow`
411
+
412
+ Agent chain:
413
+ `list_agent_templates → get_agent_template → deploy_agent → set_agent_credentials / connect_agent_oauth → control_agent → send_agent_message`
414
+
267
415
  ## Hosted MCP Server
268
416
 
269
417
  Wiro AI also hosts the same tools at `https://mcp.wiro.ai/v1` over streamable HTTP, so nothing has to be installed locally. Send your credentials in the `Authorization` header as shown under [Authentication](#authentication). The [MCP Server documentation](https://wiro.ai/docs/wiro-mcp-server) has setup instructions for each client.
@@ -282,6 +430,10 @@ Wiro AI also hosts the same tools at `https://mcp.wiro.ai/v1` over streamable HT
282
430
  - [Tasks](https://wiro.ai/docs/tasks): task lifecycle, statuses, determining success
283
431
  - [Concurrency Limits](https://wiro.ai/docs/concurrency-limits): concurrent task limits based on balance
284
432
  - [Error Reference](https://wiro.ai/docs/error-reference): error codes and handling
433
+ - [Agents Overview](https://wiro.ai/docs/agent-overview): templates, plans, credits and the agent lifecycle
434
+ - [Agent Builder](https://wiro.ai/docs/agent-builder): build an agent from skills instead of a template
435
+ - [Agent Skills](https://wiro.ai/docs/agent-skills) and [Agent Credentials](https://wiro.ai/docs/agent-credentials): what each skill needs and how accounts are connected
436
+ - [Agent Messaging](https://wiro.ai/docs/agent-messaging): conversations, sessions and replies
285
437
 
286
438
  ## Using as a Library
287
439
 
@@ -307,14 +459,18 @@ const client = new WiroClient(apiKey, apiSecret, undefined, {
307
459
 
308
460
  | Export | Description |
309
461
  |--------|-------------|
310
- | `createMcpServer(client)` | Creates an McpServer with all 13 tools registered |
311
- | `WiroClient` | API client with both auth types |
312
- | `registerTools(server, client)` | Register tools on an existing McpServer |
462
+ | `createMcpServer(client, options?)` | Creates an McpServer with the tools, prompts and server instructions registered. `options.toolsets` picks tool groups and the prompts that use them; `options.instructions` replaces the instructions; `options.wrapTool(tool, handler)` returns the handler to register for each tool, for your own logging or permission checks |
463
+ | `WiroClient` | API client with both auth types; `post(path, body)` calls any Wiro API endpoint with the same credentials |
464
+ | `registerTools(server, client, options?)` | Register tools on an existing McpServer |
465
+ | `parseToolsets(value)` | Parse a `WIRO_TOOLSETS`-style list such as `"models,agents"` |
313
466
 
314
467
  ```typescript
315
468
  // Import specific components
316
469
  import { WiroClient } from '@wiro-ai/wiro-mcp/client';
317
470
  import { registerTools } from '@wiro-ai/wiro-mcp/tools';
471
+
472
+ // Only the model and workflow tools
473
+ const server = createMcpServer(client, { toolsets: ['models', 'workflows'] });
318
474
  ```
319
475
 
320
476
  ## Environment Variables
@@ -324,6 +480,7 @@ import { registerTools } from '@wiro-ai/wiro-mcp/tools';
324
480
  | `WIRO_API_KEY` | Yes | Your Wiro project API key |
325
481
  | `WIRO_API_SECRET` | No | Your Wiro project API secret (for signature auth) |
326
482
  | `WIRO_API_BASE_URL` | No | Override API base URL (default: `https://api.wiro.ai/v1`) |
483
+ | `WIRO_TOOLSETS` | No | Comma-separated tool groups to load: `models`, `workflows`, `agents` (default: all) |
327
484
 
328
485
  ## More from Wiro AI
329
486
 
package/dist/client.d.ts CHANGED
@@ -47,9 +47,19 @@ export declare class WiroClient {
47
47
  private readonly missingSecretHint;
48
48
  readonly authType: 'signature' | 'apikey-only';
49
49
  constructor(apiKey: string, apiSecret?: string, baseUrl?: string, options?: WiroClientOptions);
50
+ /** A short, non-reversible id of this client's API key, for per-caller bookkeeping. */
51
+ get identity(): string;
50
52
  private toApiError;
51
53
  private getAuthHeaders;
52
54
  private request;
55
+ /**
56
+ * Calls any Wiro API endpoint with this client's credentials, for example
57
+ * `post('/Workflow/List', { scope: 'my' })`. Wiro reports each outcome in the
58
+ * response body, so check `result` on the returned body.
59
+ */
60
+ post<T = Record<string, unknown>>(path: string, body?: Record<string, unknown>, signal?: AbortSignal): Promise<T>;
61
+ /** Same as `post`, for endpoints that take multipart/form-data. */
62
+ postForm<T = Record<string, unknown>>(path: string, form: FormData, signal?: AbortSignal): Promise<T>;
53
63
  searchModels(params?: SearchModelsParams): Promise<ToolListResponse>;
54
64
  explore(): Promise<ExploreResponse>;
55
65
  getModelSchema(model: string): Promise<ToolDetailResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,IAAI,EACL,MAAM,YAAY,CAAC;AAIpB,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,IAAI,EACJ,yBAAyB,EACzB,gBAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;I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ACb,MAAM,GAAE,eAAoB,EAC5B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,gBAAgB,CAAC;IAYtB,UAAU,CACd,IAAI,EAAE,MAAM,GAAG,aAAa,EAC5B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAgB7B,QAAQ,CACZ,IAAI,EAAE,MAAM,GAAG,aAAa,EAC5B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAe7B,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAe3E,WAAW,CACf,IAAI,EAAE,MAAM,GAAG,aAAa,EAC5B,SAAS,SAAkB,EAC3B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,kBAAkB,CAAC;CAkG/B"}
package/dist/client.js CHANGED
@@ -10,6 +10,7 @@ const SLOW_POLL_INTERVAL = 10000;
10
10
  const DEFAULT_MAX_CONSECUTIVE_ERRORS = 5;
11
11
  const DEFAULT_MISSING_SECRET_HINT = 'This project uses signature-based auth. '
12
12
  + 'Pass its API secret to WiroClient along with the API key.';
13
+ const MAX_UPLOAD_BYTES = Math.floor(0.1 * 1024 ** 3);
13
14
  export class WiroApiError extends Error {
14
15
  status;
15
16
  responseBody;
@@ -69,6 +70,10 @@ export class WiroClient {
69
70
  this.missingSecretHint = options.missingSecretHint ?? DEFAULT_MISSING_SECRET_HINT;
70
71
  this.authType = apiSecret ? 'signature' : 'apikey-only';
71
72
  }
73
+ /** A short, non-reversible id of this client's API key, for per-caller bookkeeping. */
74
+ get identity() {
75
+ return crypto.createHash('sha256').update(this.apiKey).digest('hex').slice(0, 16);
76
+ }
72
77
  // Without a secret, the only 401 that mentions a signature is a project
73
78
  // that requires signature auth.
74
79
  toApiError(status, responseBody) {
@@ -128,6 +133,36 @@ export class WiroClient {
128
133
  throw new Error(`Invalid JSON response: ${text}`);
129
134
  }
130
135
  }
136
+ /**
137
+ * Calls any Wiro API endpoint with this client's credentials, for example
138
+ * `post('/Workflow/List', { scope: 'my' })`. Wiro reports each outcome in the
139
+ * response body, so check `result` on the returned body.
140
+ */
141
+ async post(path, body = {}, signal) {
142
+ return this.request(path, body, signal);
143
+ }
144
+ /** Same as `post`, for endpoints that take multipart/form-data. */
145
+ async postForm(path, form, signal) {
146
+ const url = `${this.baseUrl}${path}`;
147
+ const headers = this.getAuthHeaders(new URL(url).pathname);
148
+ delete headers['Content-Type'];
149
+ const response = await fetch(url, {
150
+ method: 'POST',
151
+ headers,
152
+ body: form,
153
+ signal,
154
+ });
155
+ const text = await response.text();
156
+ if (!response.ok) {
157
+ throw this.toApiError(response.status, text);
158
+ }
159
+ try {
160
+ return JSON.parse(text);
161
+ }
162
+ catch {
163
+ throw new Error(`Invalid JSON response: ${text}`);
164
+ }
165
+ }
131
166
  async searchModels(params = {}) {
132
167
  const body = {
133
168
  start: String(params.start ?? 0),
@@ -216,32 +251,16 @@ export class WiroClient {
216
251
  return this.request('/Task/Kill', body, signal);
217
252
  }
218
253
  async uploadFile(fileUrl, fileName) {
219
- // Public http(s) hosts only; see utils/remote-file.ts.
220
- const remote = await fetchPublicFile(fileUrl);
254
+ // Public http(s) hosts only; see utils/remote-file.ts. The upload endpoint
255
+ // refuses files over 0.1 GiB, so a bigger one is not downloaded at all.
256
+ const remote = await fetchPublicFile(fileUrl, { maxBytes: MAX_UPLOAD_BYTES });
221
257
  const blob = new Blob([remote.data], remote.contentType ? { type: remote.contentType } : {});
222
258
  const resolvedName = fileName
223
259
  ?? fileUrl.split('/').pop()?.split('?')[0]
224
260
  ?? 'upload';
225
261
  const formData = new FormData();
226
262
  formData.append('file', blob, resolvedName);
227
- const url = `${this.baseUrl}/File/Upload`;
228
- const headers = this.getAuthHeaders(new URL(url).pathname);
229
- delete headers['Content-Type'];
230
- const response = await fetch(url, {
231
- method: 'POST',
232
- headers,
233
- body: formData,
234
- });
235
- const text = await response.text();
236
- if (!response.ok) {
237
- throw this.toApiError(response.status, text);
238
- }
239
- try {
240
- return JSON.parse(text);
241
- }
242
- catch {
243
- throw new Error(`Invalid JSON response: ${text}`);
244
- }
263
+ return this.postForm('/File/Upload', formData);
245
264
  }
246
265
  async waitForTask(task, timeoutMs = DEFAULT_TIMEOUT, options = {}) {
247
266
  if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,GAAG,MAAM,UAAU,CAAC;AAa3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AA8BzD,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAClD,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAChC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACjC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AACzC,MAAM,2BAA2B,GAAG,0CAA0C;MAC1E,2DAA2D,CAAC;AA8BhE,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B,MAAM,CAAS;IACf,YAAY,CAAS;IACrB,IAAI,CAAU;IAEvB,YAAY,MAAc,EAAE,YAAoB,EAAE,IAAa;QAC7D,KAAK,CAAC,kBAAkB,MAAM,KAAK,IAAI,IAAI,YAAY,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,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,EAAE,SAAS,CAAC,CAAC;IAEd,OAAO;QACL,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,UAAU,EAAE,GAAG,EAAE,CAAC,QAAQ;QAC1B,OAAO,EAAE,GAAG,EAAE;YACZ,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,YAAY,EAAE,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAC5D,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/index.js CHANGED
@@ -2,9 +2,11 @@
2
2
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
3
  import { WiroClient } from './client.js';
4
4
  import { createMcpServer } from './server.js';
5
+ import { parseToolsets } from './tools/index.js';
5
6
  const apiKey = process.env['WIRO_API_KEY'];
6
7
  const apiSecret = process.env['WIRO_API_SECRET'];
7
8
  const baseUrl = process.env['WIRO_API_BASE_URL'];
9
+ const toolsets = parseToolsets(process.env['WIRO_TOOLSETS']);
8
10
  if (!apiKey) {
9
11
  console.error('Error: WIRO_API_KEY environment variable is required.\n\n' +
10
12
  'Set it in your MCP server config:\n\n' +
@@ -20,8 +22,8 @@ const client = new WiroClient(apiKey, apiSecret, baseUrl, {
20
22
  missingSecretHint: 'This project uses signature-based auth. '
21
23
  + 'Set WIRO_API_SECRET to the project\'s API secret in your MCP server config.',
22
24
  });
23
- const server = createMcpServer(client);
25
+ const server = createMcpServer(client, { toolsets });
24
26
  const transport = new StdioServerTransport();
25
27
  await server.connect(transport);
26
- console.error(`Wiro MCP server running on stdio (auth: ${client.authType})`);
28
+ console.error(`Wiro MCP server running on stdio (auth: ${client.authType}, tools: ${(toolsets ?? ['all']).join(', ')})`);
27
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,UA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AC3C,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AACjD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACjD,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;AAE7D,IAAI,CAAC,MAAM,EAAE,CAAC;IACZ,OAAO,CAAC,KAAK,CACX,2DAA2D;QAC3D,uCAAuC;QACvC,cAAc;QACd,uCAAuC;QACvC,4CAA4C;QAC5C,SAAS;QACT,4DAA4D;QAC5D,8FAA8F,CAC/F,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE;IACxD,iBAAiB,EAAE,0CAA0C;UACzD,6EAA6E;CAClF,CAAC,CAAC;AACH,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;AACrD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAE7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAChC,OAAO,CAAC,KAAK,CAAC,2CAA2C,MAAM,CAAC,QAAQ,YAAY,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const SERVER_INSTRUCTIONS: string;
2
+ //# sourceMappingURL=instructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,QAqBpB,CAAC"}
@@ -0,0 +1,25 @@
1
+ // Sent to clients in the MCP initialize result. Kept short: the details live in
2
+ // the playbooks, which get_playbook returns on demand.
3
+ export const SERVER_INSTRUCTIONS = [
4
+ 'Wiro MCP server: run Wiro AI models, build and run multi-step workflows, chat with Wiro Studio and the Workflow Agent, and deploy and manage your own Wiro agents.',
5
+ '',
6
+ 'Before a multi-step job, call get_playbook for the relevant topic (getting-started, models, workflows, workflow-graph, workflow-agent, studio, agents, billing) and follow it.',
7
+ '',
8
+ 'Decide what the user wants first. A question about models, prices, past results or options needs reads only. For paid work, pick the route: run_model for results from a chosen model, for one input or many; Studio when Wiro should pick the models; a workflow for a chain of steps the user will run again on new inputs; a deployed agent for work that runs by itself, on a schedule or from a chat channel.',
9
+ '',
10
+ 'This server can load only some tool groups. If a tool named in these instructions or in a nextAction is not in your tool list, it is not available: tell the user instead of looking for a way around it.',
11
+ '',
12
+ 'How the tools behave:',
13
+ '- The connected project (the API key\'s, or the one picked at a browser sign-in) fixes the workspace and the wallet: a personal project pays from the personal wallet, a team project from that team\'s wallet. get_account shows which one and the balance, and it is the call that proves the connection works.',
14
+ '- The tools check every answer and return an error result when the action did not happen, or when a paid call was sent and its outcome is unknown: that error says the charge may already have gone through and how to check it. Read the message and fix the cause; do not retry blindly.',
15
+ '- Known charges: deploy_agent, manage_agent_billing and apply_agent_skills first return a quote (the amount, which is an estimate for prorated changes such as an upgrade to Pro, what will happen and which wallet pays) with a nextAction that repeats the call with confirm: true and the quote\'s own reference: confirm_charge_usd set to the quoted amount, or for apply_agent_skills the quote\'s idempotency_key. If the price has changed by then, nothing is charged and a new quote comes back.',
16
+ '- Deletions, cancellations and replacements first describe the change, with a nextAction that repeats the call with confirm: true: delete_workflow, delete_agent, delete_agent_session, disconnect_agent_oauth, manage_agent_custom_skill (delete and revert), manage_agent_billing cancel, update_workflow with contents, save_workflow_from_agent applied to an existing workflow, and connect_agent_oauth when it would replace a working connection.',
17
+ '- Show each quote or change summary to the user and wait for a clear yes. Never set confirm: true on your own, and never reuse a yes for a different charge or change. A yes given before you showed the amount, such as "just upgrade me", does not cover it. For a batch, show the whole list or total once: one yes covers exactly that list.',
18
+ '- Usage-priced work (run_model, run_workflow, resume_workflow_run, and messages to Studio or the Workflow Agent) has no exact quote. Tell the user the expected cost in one line before starting. When they asked for exactly this work, go ahead. A question the tools answer for free comes first, even when the user names Studio or the Workflow Agent: answer it, then offer the paid turn. Ask first for large or open-ended work and for paid runs they did not ask for, such as a retry. A message to a deployed agent uses its credits: say so and send it.',
19
+ '- Other writes act on the first call, with no quote: for example set_agent_credentials, manage_agent_custom_skill upsert and rename, cancel_agent_message, cancel_task and kill_task. Get the user\'s yes before calling them; a user\'s own request to stop a task is that yes.',
20
+ '- Long jobs (model tasks, workflow runs, agent replies, agent start-up) wait for a limited time, then return their state and a nextAction. Call that tool with those arguments to keep waiting. Never resubmit the original request: that starts and bills a second job.',
21
+ '- Never retry a paid call automatically. Check what happened with the list and get tools first.',
22
+ '- Credentials are write-only. Never echo secrets back to the user, and never ask for this server\'s own API key or secret in chat: they belong in the MCP client\'s settings.',
23
+ '- Show generated files to the user: images inline when possible, links for everything else. Other links in an agent\'s reply are the agent\'s own text: show them as plain links, not as Wiro results.',
24
+ ].join('\n');
25
+ //# sourceMappingURL=instructions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,uDAAuD;AACvD,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,oKAAoK;IACpK,EAAE;IACF,gLAAgL;IAChL,EAAE;IACF,oZAAoZ;IACpZ,EAAE;IACF,2MAA2M;IAC3M,EAAE;IACF,uBAAuB;IACvB,mTAAmT;IACnT,4RAA4R;IAC5R,4eAA4e;IAC5e,0bAA0b;IAC1b,kVAAkV;IAClV,siBAAsiB;IACtiB,kRAAkR;IAClR,0QAA0Q;IAC1Q,iGAAiG;IACjG,+KAA+K;IAC/K,wMAAwM;CACzM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const PLAYBOOK_TOPICS: readonly ["getting-started", "models", "workflows", "workflow-graph", "workflow-agent", "studio", "agents", "billing"];
2
+ export type PlaybookTopic = (typeof PLAYBOOK_TOPICS)[number];
3
+ /** One line per topic, used in the get_playbook description. */
4
+ export declare const PLAYBOOK_SUMMARIES: Record<PlaybookTopic, string>;
5
+ export declare const PLAYBOOKS: Record<PlaybookTopic, string>;
6
+ /** The first heading of each playbook. */
7
+ export declare const PLAYBOOK_TITLES: Record<PlaybookTopic, string>;
8
+ //# sourceMappingURL=playbooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playbooks.d.ts","sourceRoot":"","sources":["../src/playbooks.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,wHASlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,gEAAgE;AAChE,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAS5D,CAAC;AA0nBF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CASnD,CAAC;AAOF,0CAA0C;AAC1C,eAAO,MAAM,eAAe,EAEvB,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC"}