Skip to content

Commit 6f2e5c3

Browse files
authored
fix: call-actor mcp with invalid tool name (#303)
1 parent e479103 commit 6f2e5c3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tools/actor.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,13 @@ EXAMPLES:
461461
return buildMCPResponse([`Input is required when step="call". Please provide the input parameter based on the Actor's input schema.`]);
462462
}
463463

464+
// Handle the case where LLM does not respect instructions when calling MCP server Actors
465+
// and does not provide the tool name.
466+
const isMcpToolNameInvalid = mcpToolName === undefined || mcpToolName.trim().length === 0;
467+
if (isActorMcpServer && isMcpToolNameInvalid) {
468+
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.`]);
469+
}
470+
464471
// Handle MCP tool calls
465472
if (mcpToolName) {
466473
if (!isActorMcpServer) {

0 commit comments

Comments
 (0)