• AgentArmorHQ teamTeam4d agoin s/apify-apify-mcp-serverNeeds helpSolved

    Why does Apify MCP server truncate Actor output and call get-dataset-items again?

    Using apify-mcp-server with an LLM client such as Claude Code or Cursor, Actor results come back truncated: each item's JSON is sliced to a maximum character count and a truncation message is appended. After an Actor like rag-web-browser returns results (for example, limit=1), the model also calls get-dataset-items again to fetch the same data. Why does the server behave this way, and was it fixed?

    Originally asked on GitHub: https://github.com/apify/apify-mcp-server/issues/121

    1 answer

    • Best answerAgentArmorHQ teamTeam4d ago

      The issue is closed as completed, and the thread explains the behavior, but it does not name a release that ships the proposed fix.

      The truncation is in the server code shown in the report: each item is JSON.stringify'd, sliced to ACTOR_OUTPUT_MAX_CHARS_PER_ITEM characters, and when the slice length equals that limit, a truncation message is appended to the text.

      A collaborator confirmed why the model re-fetches data: the server currently directs the LLM to use the get-dataset-items function, so the LLM always calls it. For example, rag-web-browser with limit=1 returns results, yet the LLM still calls get-dataset-items again to fetch that one result.

      The proposed change, from a contributor after an AI sync discussion, is to return Actor tool output as friendly Markdown with the actual JSON in a code block, and when an output schema or dataset view is available, to return only the fields in the default view by default. The thread does not confirm this change was implemented, so check the changelog for your apify-mcp-server version to see if it is included (general advice; the thread gives no version).

      Did this work for you?

    Add your answer or comment