My Actors worked fine until an AI agent called them
说明与用途
Claude AI 代理暴露了 14 个 Apify Actors 的输入模式和错误处理问题。通过重新设计输入模式、添加显式状态字段和正确的 Dataset 访问,使 Actors 对 AI 调用更可靠。
问题
An AI agent calling Apify Actors via MCP misinterpreted input schemas and output handling, causing empty results, permission errors, and incorrect data interpretation.
结果
By refining input schemas, adding explicit status fields, and handling dataset access properly, the Actors became robust against AI agent calls, preventing silent failures and misinterpretations.
工作流
- 1. Expose Actors as MCP tools and connect to Claude.
- 2. Agent sends a natural language task to find a product across stores.
- 3. Actor receives input, runs scraper, and returns results.
- 4. Agent interprets output; if empty array, assumes no data.
- 5. Issues arise: empty arrays for both missing data and errors, permission errors when accessing datasets, and ambiguous input fields.
- 6. Redesign input schema: remove site‑specific IDs, use enums, and document fields clearly.
- 7. Modify output to include status, lookupStatus, and lookupDetail fields.
- 8. Update product pipeline to pass dataset path or items directly, avoiding cross‑run dataset access.
- 9. Test with agents to ensure correct branching and error handling.
证据
The agent picked my Actor, filled the input, started the run. Status: succeeded. Zero results, no error.
Empty result. The same thing the Actor returns when a company is genuinely absent from the registry.
An Actor with standard permissions cannot read the default dataset of a different run, and the API answers Insufficient permissions.
- 记录日期: 2026-09-05T19:15:00.149Z