Skip to content

Commit 2919d15

Browse files
committed
Revert "chore: update upserTools and tool to instantiate client correcty"
This reverts commit 4a5c35d.
1 parent 52b8de1 commit 2919d15

File tree

3 files changed

+7
-36
lines changed

3 files changed

+7
-36
lines changed

src/const.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ export const SKYFIRE_SELLER_ID = process.env.SKYFIRE_SELLER_SERVICE_ID;
6161

6262
export const SKYFIRE_TOOL_INSTRUCTIONS = `To run the Actor, you need to provide a Skyfire payment ID in the \`skyfire-pay-id\` input property. You first need to create the Skyfire PAY token by calling the \`create-pay-token\` tool from the Skyfire MCP server and then provide the created token in the \`skyfire-pay-id\` input property when calling Actor tool. The Skyfire PAY token is used for billing purposes and needs to be charged with at least ${SKYFIRE_MIN_CHARGE_USD} USD.${SKYFIRE_SELLER_ID ? ` The Skyfire seller ID for Apify MCP server is "${SKYFIRE_SELLER_ID}".` : ''} When retrieving Actor output using the \`get-actor-output\` tool, you also need to provide the same Skyfire PAY token ID in the \`skyfire-pay-id\` input property.`;
6363

64-
export const SKYFIRE_ACTOR_SEARCH_INSTRUCTIONS = `To search for Actors, you need to provide valid Skyfire KYA token for identification in the \`skyfire-pay-id\` input property. You first need to create the Skyfire token by calling the \`create-kya-token\` tool from the Skyfire MCP server.${SKYFIRE_SELLER_ID ? ` The Skyfire seller ID for Apify MCP server is "${SKYFIRE_SELLER_ID}".` : ''} Alternatively you can provide PAY or KYA+PAY token instead.`;
65-
66-
export const SKYFIRE_PAY_ID_PROPERTY_DESCRIPTION = `Skyfire PAY, KYA, KYA+PAY token ID used for authentication and billing purposes.`;
64+
export const SKYFIRE_PAY_ID_PROPERTY_DESCRIPTION = `Skyfire PAY token ID used for billing purposes.`;
6765

6866
export const SKYFIRE_README_CONTENT = `The Apify MCP Server allows clients to interact with Apify Actors, storage, and documentation. Before running any Apify Actor, you need to set up a Skyfire PAY token for billing purposes. To set up the PAY token you need to use the create-pay-token tool from the Skyfire MCP server. The PAY token must be charged with a minimum of ${SKYFIRE_MIN_CHARGE_USD} USD to be valid.${SKYFIRE_SELLER_ID ? ` The Skyfire seller ID for Apify MCP server is "${SKYFIRE_SELLER_ID}".` : ''} When running an Actor using the call-actor tool, you must provide the Skyfire PAY token ID in the \`skyfire-pay-id\` input property. Similarly, when retrieving Actor output using the get-actor-output tool, you must also provide the same Skyfire PAY token ID in the \`skyfire-pay-id\` input property.`;
6967

src/mcp/server.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
HelperTools,
3131
SERVER_NAME,
3232
SERVER_VERSION,
33-
SKYFIRE_ACTOR_SEARCH_INSTRUCTIONS,
3433
SKYFIRE_PAY_ID_PROPERTY_DESCRIPTION,
3534
SKYFIRE_README_CONTENT,
3635
SKYFIRE_TOOL_INSTRUCTIONS,
@@ -273,12 +272,7 @@ export class ActorsMcpServer {
273272
|| (wrap.type === 'internal' && wrap.tool.name === HelperTools.ACTOR_CALL)
274273
|| (wrap.type === 'internal' && wrap.tool.name === HelperTools.ACTOR_OUTPUT_GET)) {
275274
// Add Skyfire instructions to description if not already present
276-
if (wrap.type === 'internal' && wrap.tool.name === HelperTools.STORE_SEARCH) {
277-
// Add description
278-
if (!wrap.tool.description.includes(SKYFIRE_ACTOR_SEARCH_INSTRUCTIONS)) {
279-
wrap.tool.description += `\n\n${SKYFIRE_ACTOR_SEARCH_INSTRUCTIONS}`;
280-
}
281-
} else if (!wrap.tool.description.includes(SKYFIRE_TOOL_INSTRUCTIONS)) {
275+
if (!wrap.tool.description.includes(SKYFIRE_TOOL_INSTRUCTIONS)) {
282276
wrap.tool.description += `\n\n${SKYFIRE_TOOL_INSTRUCTIONS}`;
283277
}
284278
// Add skyfire-pay-id property if not present

src/tools/store_collection.ts

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { z } from 'zod';
33
import zodToJsonSchema from 'zod-to-json-schema';
44

55
import { ApifyClient } from '../apify-client.js';
6-
import { ACTOR_SEARCH_ABOVE_LIMIT, HelperTools, SKYFIRE_ACTOR_SEARCH_INSTRUCTIONS } from '../const.js';
6+
import { ACTOR_SEARCH_ABOVE_LIMIT, HelperTools } from '../const.js';
77
import type { ActorPricingModel, ExtendedActorStoreList, HelperTool, ToolEntry } from '../types.js';
88
import { formatActorToActorCard } from '../utils/actor-card.js';
99
import { ajv } from '../utils/ajv.js';
@@ -13,16 +13,11 @@ export async function searchActorsByKeywords(
1313
apifyToken: string,
1414
limit: number | undefined = undefined,
1515
offset: number | undefined = undefined,
16-
skyfirePayId: string | undefined = undefined,
16+
allowsAgenticUsers: boolean | undefined = undefined,
1717
): Promise<ExtendedActorStoreList[]> {
18-
/**
19-
* Create Apify token, for Skyfire mode use `skyfire-pay-id` and for normal mode use `apifyToken`.
20-
*/
21-
const client = skyfirePayId
22-
? new ApifyClient({ skyfirePayId })
23-
: new ApifyClient({ token: apifyToken });
18+
const client = new ApifyClient({ token: apifyToken });
2419
const storeClient = client.store();
25-
if (skyfirePayId) storeClient.params = { ...storeClient.params, allowsAgenticUsers: true };
20+
if (allowsAgenticUsers !== undefined) storeClient.params = { ...storeClient.params, allowsAgenticUsers };
2621

2722
const results = await storeClient.list({ search, limit, offset });
2823
return results.items;
@@ -101,28 +96,12 @@ USAGE EXAMPLES:
10196
call: async (toolArgs) => {
10297
const { args, apifyToken, userRentedActorIds, apifyMcpServer } = toolArgs;
10398
const parsed = searchActorsArgsSchema.parse(args);
104-
105-
/**
106-
* In Skyfire mode, we check for the presence of `skyfire-pay-id`.
107-
* If it is missing, we return instructions to the LLM on how to create it and pass it to the tool.
108-
*/
109-
if (apifyMcpServer.options.skyfireMode
110-
&& args['skyfire-pay-id'] === undefined
111-
) {
112-
return {
113-
content: [{
114-
type: 'text',
115-
text: SKYFIRE_ACTOR_SEARCH_INSTRUCTIONS,
116-
}],
117-
};
118-
}
119-
12099
let actors = await searchActorsByKeywords(
121100
parsed.search,
122101
apifyToken,
123102
parsed.limit + ACTOR_SEARCH_ABOVE_LIMIT,
124103
parsed.offset,
125-
apifyMcpServer.options.skyfireMode && typeof args['skyfire-pay-id'] === 'string' ? args['skyfire-pay-id'] : undefined, // // skyfirePayId
104+
apifyMcpServer.options.skyfireMode ? true : undefined, // allowsAgenticUsers - filters Actors available for Agentic users
126105
);
127106
actors = filterRentalActors(actors || [], userRentedActorIds || []).slice(0, parsed.limit);
128107
const actorCards = actors.length === 0 ? [] : actors.map(formatActorToActorCard);

0 commit comments

Comments
 (0)