From 5f59d6b2e6820de05b2565448cb958b41e51e999 Mon Sep 17 00:00:00 2001 From: MQ37 Date: Sat, 4 Oct 2025 11:21:46 +0200 Subject: [PATCH] fix: call-actor mcp with invalid tool name --- src/tools/actor.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tools/actor.ts b/src/tools/actor.ts index 07fc3f6..2378db4 100644 --- a/src/tools/actor.ts +++ b/src/tools/actor.ts @@ -461,6 +461,13 @@ EXAMPLES: return buildMCPResponse([`Input is required when step="call". Please provide the input parameter based on the Actor's input schema.`]); } + // Handle the case where LLM does not respect instructions when calling MCP server Actors + // and does not provide the tool name. + const isMcpToolNameInvalid = mcpToolName === undefined || mcpToolName.trim().length === 0; + if (isActorMcpServer && isMcpToolNameInvalid) { + return buildMCPResponse([`When calling an MCP server Actor, you must specify the tool name in the actor parameter as "{actorName}:{toolName}" in the "actor" input property.`]); + } + // Handle MCP tool calls if (mcpToolName) { if (!isActorMcpServer) {