You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Improve error handling (required for claude connector) (#331)
* feat: Improve error handling (required for claude connector)
* feat: Add hint to use tool to get schema
* fix: Add isError flag to tool execution errors per MCP spec
@@ -516,7 +521,8 @@ export class ActorsMcpServer {
516
521
);
517
522
}
518
523
if(!args){
519
-
constmsg=`Missing arguments for tool ${name}`;
524
+
constmsg=`Missing arguments for tool "${name}".
525
+
Please provide the required arguments for this tool. Check the tool's input schema using ${HelperTools.ACTOR_GET_DETAILS} tool to see what parameters are required.`;
constmsg=`Invalid arguments for tool "${tool.name}".
541
+
Validation errors: ${errorMessages}.
542
+
Please check the tool's input schema using ${HelperTools.ACTOR_GET_DETAILS} tool and ensure all required parameters are provided with correct types and values.`;
returnbuildMCPResponse([`MCP server Actors are not supported in Skyfire mode. Please use a regular Apify token without Skyfire.`]);
411
+
returnbuildMCPResponse([
412
+
`This Actor (${actorName}) is an MCP server and cannot be accessed using a Skyfire token. To use this Actor, please provide a valid Apify token instead of a Skyfire token.`,
returnbuildMCPResponse([`Actor '${actorName}' was not found.`]);
520
+
returnbuildMCPResponse([`Actor '${actorName}' was not found.
521
+
Please verify Actor ID or name format (e.g., "username/name" like "apify/rag-web-browser") and ensure that the Actor exists.
522
+
You can search for available Actors using the tool: ${HelperTools.STORE_SEARCH}.`],true);
517
523
}
518
524
519
525
if(!actor.ajvValidate(input)){
@@ -548,7 +554,9 @@ EXAMPLES:
548
554
return{ content };
549
555
}catch(error){
550
556
logHttpError(error,'Failed to call Actor',{ actorName, performStep });
551
-
returnbuildMCPResponse([`Failed to call Actor '${actorName}': ${errorinstanceofError ? error.message : String(error)}`]);
557
+
returnbuildMCPResponse([`Failed to call Actor '${actorName}': ${errorinstanceofError ? error.message : String(error)}.
558
+
Please verify the Actor name, input parameters, and ensure the Actor exists.
559
+
You can search for available Actors using the tool: ${HelperTools.STORE_SEARCH}, or get Actor details using: ${HelperTools.ACTOR_GET_DETAILS}.`],true);
content: [{type: 'text',text: `Actor information for '${parsed.actor}' was not found. Please check the Actor ID or name and ensure the Actor exists.`}],
45
-
};
44
+
consttexts=[`Actor information for '${parsed.actor}' was not found.
45
+
Please verify Actor ID or name format and ensure that the Actor exists.
46
+
You can search for available Actors using the tool: ${HelperTools.STORE_SEARCH}.`,
0 commit comments