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
// Flush interval in milliseconds (default is 10000)
134
133
exportconstSEGMENT_FLUSH_INTERVAL_MS=5_000;
135
134
135
+
// Tool status
136
+
/**
137
+
* Unified status constants for tool execution lifecycle.
138
+
* Single source of truth for all tool status values.
139
+
*/
140
+
exportconstTOOL_STATUS={
141
+
SUCCEEDED: 'SUCCEEDED',
142
+
FAILED: 'FAILED',
143
+
ABORTED: 'ABORTED',
144
+
SOFT_FAIL: 'SOFT_FAIL',
145
+
}asconst;
146
+
136
147
exportconstSERVER_INSTRUCTIONS=`
137
148
Apify is the world's largest marketplace of tools for web scraping, data extraction, and web automation.
138
149
These tools are called **Actors**. They enable you to extract structured data from social media, e-commerce, search engines, maps, travel sites, and many other sources.
Please verify the tool name, input parameters, and ensure all required resources are available.`,
710
-
],true);
725
+
returnbuildMCPResponse({
726
+
texts: [`Error calling tool "${name}": ${errorMessage}. Please verify the tool name, input parameters, and ensure all required resources are available.`],
`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.`,
413
-
],true);
410
+
returnbuildMCPResponse({
411
+
texts: [`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([`This is an MCP Server Actor with the following tools:\n\n${toolsInfo}\n\nTo call a tool, use step="call" with actor name format: "${baseActorName}:{toolName}"`]);
438
+
returnbuildMCPResponse({
439
+
texts: [`This is an MCP Server Actor with the following tools:\n\n${toolsInfo}\n\nTo call a tool, use step="call" with actor name format: "${baseActorName}:{toolName}"`],
@@ -554,9 +582,13 @@ You can search for available Actors using the tool: ${HelperTools.STORE_SEARCH}.
554
582
return{ content };
555
583
}catch(error){
556
584
logHttpError(error,'Failed to call Actor',{ actorName, performStep });
557
-
returnbuildMCPResponse([`Failed to call Actor '${actorName}': ${errorinstanceofError ? error.message : String(error)}.
585
+
// Let the server classify the error; we only mark it as an MCP error response
586
+
returnbuildMCPResponse({
587
+
texts: [`Failed to call Actor '${actorName}': ${errorinstanceofError ? error.message : String(error)}.
558
588
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);
589
+
You can search for available Actors using the tool: ${HelperTools.STORE_SEARCH}, or get Actor details using: ${HelperTools.ACTOR_GET_DETAILS}.`],
0 commit comments