fix(call-actor): synthesize structuredContent on MCP server pass-through#859
Merged
MQ37 merged 1 commit intoMay 18, 2026
Conversation
handleMcpToolCall returned { content: result.content } only — no structuredContent,
no isError. Since #415 added outputSchema to call-actor, MCP SDK >= 1.11.4 rejects
the response with -32600 'has an output schema but did not return structured content'
once the client has called listTools() to cache validators (i.e. every real client).
Synthesize a sentinel RunResponse matching getActorRunOutputSchema.required keys —
runId/actorId/status/storages/summary/nextStep — and forward result.isError. The
remote tool's payload still flows through content; no behavior change for callers
that don't validate against outputSchema.
Reproduces with mcpc:
mcpc --json @apify tools-call call-actor \
actor:='"apify/actors-mcp-server:search-apify-docs"' input:='{"query":"weather"}'
This was referenced May 18, 2026
9cf3a39
into
feat/migrate-direct-actor-tools-runresponse
10 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
call-actorwith MCP-server pass-through syntax (actor: "apify/actors-mcp-server:search-apify-docs") fails on master withMCP error -32600: Tool call-actor has an output schema but did not return structured content. Repro withmcpc --json @apify tools-call call-actor actor:='"apify/actors-mcp-server:search-apify-docs"' input:='{"query":"weather"}'. Regression introduced in #415 (f9512c4, 2026-01-29) whenoutputSchemawas added tocall-actor; the MCP-pass-through code inhandleMcpToolCallhas been returning{ content }only since #274 (2025-09-18). Both ingredients sat dormant until the SDK on^1.25.2(already enforcing since 1.11.4) saw them combined.Solution
In
handleMcpToolCall, synthesize a sentinelRunResponsematchinggetActorRunOutputSchema.required(runId: 'mcp-passthrough',actorId: baseActorName,status,storages: {},summary,nextStep) and forwardresult.isErrorfrom the remote tool. The remote tool's payload still flows throughcontent. Stacks on #853.Worth your attention
'mcp-passthrough'is a deliberate non-Apify literal so logs / dashboards never mistake it for a real run id. Open tomcp-passthrough:${mcpToolName}for greppability per tool if preferred.client.listTools(), so the SDK never builds the validator cache. The new test attests/integration/suite.ts:813callslistTools()first to mirror real clients (mcpc, Claude Desktop), which is the only way to surface this class of bug at the integration layer.call-actordoing two unrelated things (Apify run vs. MCP tool pass-through) under one tool name is the root cause; this PR keeps that shape and just makes the response spec-compliant. Follow-up tracked in call-actor mixes Apify-run and MCP-tool pass-through under one schema #860 (see comment).Follow-up
call-actorMCP pass-through into a dedicated tool, or move to code-mode as the default. Issue: call-actor mixes Apify-run and MCP-tool pass-through under one schema #860