@agentwonderland/mcp 0.1.6 → 0.1.8

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.
@@ -93,8 +93,9 @@ export async function uploadLocalFiles(input) {
93
93
  try {
94
94
  result[key] = await uploadFile(value);
95
95
  }
96
- catch {
97
- // Leave original value if upload fails
96
+ catch (err) {
97
+ const msg = err instanceof Error ? err.message : "unknown error";
98
+ throw new Error(`Failed to upload file "${value}" for field "${key}": ${msg}`);
98
99
  }
99
100
  }
100
101
  return result;
@@ -35,7 +35,7 @@ async function initMpp(wallet) {
35
35
  else {
36
36
  return null;
37
37
  }
38
- const mppx = Mppx.create({ methods: [tempo({ account })] });
38
+ const mppx = Mppx.create({ methods: [tempo({ account, deposit: "10" })] });
39
39
  return mppx.fetch.bind(mppx);
40
40
  }
41
41
  catch {
package/dist/tools/run.js CHANGED
@@ -14,7 +14,7 @@ function multiText(...blocks) {
14
14
  // Pending confirmations: agent_id → { agent, input, method }
15
15
  const pendingRuns = new Map();
16
16
  export function registerRunTools(server) {
17
- server.tool("run_agent", "Run an AI agent from the marketplace. Pays automatically via configured wallet. Returns the agent's output, cost, and job ID for tracking. If spending confirmation is enabled, first call returns a price quote — call again with confirmed: true to execute.", {
17
+ server.tool("run_agent", "Run an AI agent from the marketplace. Pays automatically via configured wallet. Returns the agent's output, cost, and job ID for tracking. If spending confirmation is enabled, first call returns a price quote — call again with confirmed: true to execute. Local file paths in the input (e.g. /Users/.../photo.jpg) are automatically uploaded to temporary storage and replaced with download URLs — just pass the path directly, no base64 encoding needed.", {
18
18
  agent_id: z.string().describe("Agent ID (UUID, slug, or name)"),
19
19
  input: z.record(z.unknown()).describe("Input payload for the agent"),
20
20
  pay_with: z.string().optional().describe("Payment method — wallet ID, chain name (tempo, base, etc.), or 'card'. Auto-detected if omitted."),
@@ -55,7 +55,14 @@ export function registerRunTools(server) {
55
55
  ].join("\n"));
56
56
  }
57
57
  const method = pay_with;
58
- const processedInput = await uploadLocalFiles(input);
58
+ let processedInput;
59
+ try {
60
+ processedInput = await uploadLocalFiles(input);
61
+ }
62
+ catch (err) {
63
+ const msg = err instanceof Error ? err.message : "File upload failed";
64
+ return text(`Error: ${msg}`);
65
+ }
59
66
  let result;
60
67
  try {
61
68
  result = await apiPostWithPayment(`/agents/${agent.id}/run`, { input: processedInput }, method);
@@ -44,7 +44,7 @@ async function autoTip(jobId, agentId, agentName, feedbackToken) {
44
44
  }
45
45
  }
46
46
  export function registerSolveTools(server) {
47
- server.tool("solve", "Solve a task by finding the best agent, paying, and executing. The primary way to use the marketplace. If spending confirmation is enabled, returns a price quote first — call again with confirmed: true to execute.", {
47
+ server.tool("solve", "Solve a task by finding the best agent, paying, and executing. The primary way to use the marketplace. If spending confirmation is enabled, returns a price quote first — call again with confirmed: true to execute. Local file paths in the input (e.g. /Users/.../photo.jpg) are automatically uploaded to temporary storage and replaced with download URLs — just pass the path directly, no base64 encoding needed.", {
48
48
  intent: z
49
49
  .string()
50
50
  .describe("What you want to accomplish (natural language)"),
@@ -76,8 +76,15 @@ export function registerSolveTools(server) {
76
76
  }
77
77
  const method = pay_with ?? getConfiguredMethods()[0];
78
78
  // Path 1: If authenticated, use the platform /solve route
79
+ let processedInput;
80
+ try {
81
+ processedInput = await uploadLocalFiles(input);
82
+ }
83
+ catch (err) {
84
+ const msg = err instanceof Error ? err.message : "File upload failed";
85
+ return text(`Error: ${msg}`);
86
+ }
79
87
  try {
80
- const processedInput = await uploadLocalFiles(input);
81
88
  const result = await apiPost("/solve", {
82
89
  intent,
83
90
  input: processedInput,
@@ -140,7 +147,14 @@ export function registerSolveTools(server) {
140
147
  ].join("\n"));
141
148
  }
142
149
  let result;
143
- const processedInput2 = await uploadLocalFiles(input);
150
+ let processedInput2;
151
+ try {
152
+ processedInput2 = await uploadLocalFiles(input);
153
+ }
154
+ catch (err) {
155
+ const msg = err instanceof Error ? err.message : "File upload failed";
156
+ return text(`Error: ${msg}`);
157
+ }
144
158
  try {
145
159
  result = await apiPostWithPayment(`/agents/${selected.id}/run`, { input: processedInput2 }, method);
146
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentwonderland/mcp",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "description": "MCP server for the Agent Wonderland AI agent marketplace",
6
6
  "bin": {
@@ -105,8 +105,9 @@ export async function uploadLocalFiles(
105
105
 
106
106
  try {
107
107
  result[key] = await uploadFile(value);
108
- } catch {
109
- // Leave original value if upload fails
108
+ } catch (err) {
109
+ const msg = err instanceof Error ? err.message : "unknown error";
110
+ throw new Error(`Failed to upload file "${value}" for field "${key}": ${msg}`);
110
111
  }
111
112
  }
112
113
 
@@ -49,7 +49,7 @@ async function initMpp(wallet: WalletEntry): Promise<typeof fetch | null> {
49
49
  return null;
50
50
  }
51
51
 
52
- const mppx = Mppx.create({ methods: [tempo({ account })] as any });
52
+ const mppx = Mppx.create({ methods: [tempo({ account, deposit: "10" })] as any });
53
53
  return mppx.fetch.bind(mppx) as typeof fetch;
54
54
  } catch {
55
55
  return null;
package/src/tools/run.ts CHANGED
@@ -25,7 +25,7 @@ const pendingRuns = new Map<string, {
25
25
  export function registerRunTools(server: McpServer): void {
26
26
  server.tool(
27
27
  "run_agent",
28
- "Run an AI agent from the marketplace. Pays automatically via configured wallet. Returns the agent's output, cost, and job ID for tracking. If spending confirmation is enabled, first call returns a price quote — call again with confirmed: true to execute.",
28
+ "Run an AI agent from the marketplace. Pays automatically via configured wallet. Returns the agent's output, cost, and job ID for tracking. If spending confirmation is enabled, first call returns a price quote — call again with confirmed: true to execute. Local file paths in the input (e.g. /Users/.../photo.jpg) are automatically uploaded to temporary storage and replaced with download URLs — just pass the path directly, no base64 encoding needed.",
29
29
  {
30
30
  agent_id: z.string().describe("Agent ID (UUID, slug, or name)"),
31
31
  input: z.record(z.unknown()).describe("Input payload for the agent"),
@@ -74,7 +74,13 @@ export function registerRunTools(server: McpServer): void {
74
74
  }
75
75
 
76
76
  const method = pay_with;
77
- const processedInput = await uploadLocalFiles(input);
77
+ let processedInput: Record<string, unknown>;
78
+ try {
79
+ processedInput = await uploadLocalFiles(input);
80
+ } catch (err) {
81
+ const msg = err instanceof Error ? err.message : "File upload failed";
82
+ return text(`Error: ${msg}`);
83
+ }
78
84
  let result: Record<string, unknown>;
79
85
  try {
80
86
  result = await apiPostWithPayment<Record<string, unknown>>(
@@ -55,7 +55,7 @@ async function autoTip(jobId: string, agentId: string, agentName: string, feedba
55
55
  export function registerSolveTools(server: McpServer): void {
56
56
  server.tool(
57
57
  "solve",
58
- "Solve a task by finding the best agent, paying, and executing. The primary way to use the marketplace. If spending confirmation is enabled, returns a price quote first — call again with confirmed: true to execute.",
58
+ "Solve a task by finding the best agent, paying, and executing. The primary way to use the marketplace. If spending confirmation is enabled, returns a price quote first — call again with confirmed: true to execute. Local file paths in the input (e.g. /Users/.../photo.jpg) are automatically uploaded to temporary storage and replaced with download URLs — just pass the path directly, no base64 encoding needed.",
59
59
  {
60
60
  intent: z
61
61
  .string()
@@ -95,8 +95,14 @@ export function registerSolveTools(server: McpServer): void {
95
95
  const method = pay_with ?? getConfiguredMethods()[0];
96
96
 
97
97
  // Path 1: If authenticated, use the platform /solve route
98
+ let processedInput: Record<string, unknown>;
99
+ try {
100
+ processedInput = await uploadLocalFiles(input);
101
+ } catch (err) {
102
+ const msg = err instanceof Error ? err.message : "File upload failed";
103
+ return text(`Error: ${msg}`);
104
+ }
98
105
  try {
99
- const processedInput = await uploadLocalFiles(input);
100
106
  const result = await apiPost<Record<string, unknown>>("/solve", {
101
107
  intent,
102
108
  input: processedInput,
@@ -169,7 +175,13 @@ export function registerSolveTools(server: McpServer): void {
169
175
  }
170
176
 
171
177
  let result: Record<string, unknown>;
172
- const processedInput2 = await uploadLocalFiles(input);
178
+ let processedInput2: Record<string, unknown>;
179
+ try {
180
+ processedInput2 = await uploadLocalFiles(input);
181
+ } catch (err) {
182
+ const msg = err instanceof Error ? err.message : "File upload failed";
183
+ return text(`Error: ${msg}`);
184
+ }
173
185
  try {
174
186
  result = await apiPostWithPayment<Record<string, unknown>>(
175
187
  `/agents/${selected.id}/run`,