@@ -26,8 +26,10 @@ import log from '@apify/log';
26
26
27
27
import { ApifyClient } from '../apify-client.js' ;
28
28
import {
29
+ HelperTools ,
29
30
SERVER_NAME ,
30
31
SERVER_VERSION ,
32
+ SKYFIRE_PAY_ID_PROPERTY_DESCRIPTION ,
31
33
SKYFIRE_README_CONTENT ,
32
34
SKYFIRE_TOOL_INSTRUCTIONS ,
33
35
} from '../const.js' ;
@@ -261,28 +263,28 @@ export class ActorsMcpServer {
261
263
this . tools . set ( wrap . tool . name , wrap ) ;
262
264
}
263
265
// Handle Skyfire mode modifications once per tool upsert
264
- // if (this.options.skyfireMode) {
265
- // for (const wrap of tools) {
266
- // if (wrap.type === 'actor'
267
- // || (wrap.type === 'internal' && wrap.tool.name === HelperTools.ACTOR_CALL)
268
- // || (wrap.type === 'internal' && wrap.tool.name === HelperTools.ACTOR_OUTPUT_GET)) {
269
- // // Add Skyfire instructions to description if not already present
270
- // if (!wrap.tool.description.includes(SKYFIRE_TOOL_INSTRUCTIONS)) {
271
- // wrap.tool.description += `\n\n${SKYFIRE_TOOL_INSTRUCTIONS}`;
272
- // }
273
- // // Add skyfire-pay-id property if not present
274
- // if (wrap.tool.inputSchema && 'properties' in wrap.tool.inputSchema) {
275
- // const props = wrap.tool.inputSchema.properties as Record<string, unknown>;
276
- // if (!props['skyfire-pay-id']) {
277
- // props['skyfire-pay-id'] = {
278
- // type: 'string',
279
- // description: SKYFIRE_PAY_ID_PROPERTY_DESCRIPTION,
280
- // };
281
- // }
282
- // }
283
- // }
284
- // }
285
- // }
266
+ if ( this . options . skyfireMode ) {
267
+ for ( const wrap of tools ) {
268
+ if ( wrap . type === 'actor'
269
+ || ( wrap . type === 'internal' && wrap . tool . name === HelperTools . ACTOR_CALL )
270
+ || ( wrap . type === 'internal' && wrap . tool . name === HelperTools . ACTOR_OUTPUT_GET ) ) {
271
+ // Add Skyfire instructions to description if not already present
272
+ if ( ! wrap . tool . description . includes ( SKYFIRE_TOOL_INSTRUCTIONS ) ) {
273
+ wrap . tool . description += `\n\n${ SKYFIRE_TOOL_INSTRUCTIONS } ` ;
274
+ }
275
+ // Add skyfire-pay-id property if not present
276
+ if ( wrap . tool . inputSchema && 'properties' in wrap . tool . inputSchema ) {
277
+ const props = wrap . tool . inputSchema . properties as Record < string , unknown > ;
278
+ if ( ! props [ 'skyfire-pay-id' ] ) {
279
+ props [ 'skyfire-pay-id' ] = {
280
+ type : 'string' ,
281
+ description : SKYFIRE_PAY_ID_PROPERTY_DESCRIPTION ,
282
+ } ;
283
+ }
284
+ }
285
+ }
286
+ }
287
+ }
286
288
if ( shouldNotifyToolsChangedHandler ) this . notifyToolsChangedHandler ( ) ;
287
289
return tools ;
288
290
}
0 commit comments