Problem
src/tools/utils.ts (~440 lines) is a grab-bag of two unrelated concerns kept top-level by #978 (which explicitly left the split out of scope):
- Tool-name helpers —
actorNameToToolName, legacyToolNameToNew, getToolSchemaID, isActorInfoMcpServer, isActorBlockedUnderPaymentProvider.
- Actor input-schema transformation (the bulk) —
buildActorInputSchema, transformActorInputSchemaProperties, filterSchemaProperties, markInputPropertiesAsRequired, shortenProperties, pruneSchemaPropertiesByWhitelist, encode/decodeDotPropertyNames, the AJV/enum helpers, etc.
The filename says nothing about either, so consumers import a vague tools/utils.js for very different things.
Proposed solution
Split into two intention-revealing modules (names TBD, e.g. tools/tool_naming.ts and tools/actor_input_schema.ts), update imports, keep behavior identical. Pure structural move like #978.
Coordinate with #954 (Actor input-schema transformation alignment), which touches the same schema-transformation code.
Notes
Deferred from #978; part of the #979 cleanup. Confirm no impact on apify-mcp-server-internal before landing.
Problem
src/tools/utils.ts(~440 lines) is a grab-bag of two unrelated concerns kept top-level by #978 (which explicitly left the split out of scope):actorNameToToolName,legacyToolNameToNew,getToolSchemaID,isActorInfoMcpServer,isActorBlockedUnderPaymentProvider.buildActorInputSchema,transformActorInputSchemaProperties,filterSchemaProperties,markInputPropertiesAsRequired,shortenProperties,pruneSchemaPropertiesByWhitelist,encode/decodeDotPropertyNames, the AJV/enum helpers, etc.The filename says nothing about either, so consumers import a vague
tools/utils.jsfor very different things.Proposed solution
Split into two intention-revealing modules (names TBD, e.g.
tools/tool_naming.tsandtools/actor_input_schema.ts), update imports, keep behavior identical. Pure structural move like #978.Coordinate with #954 (Actor input-schema transformation alignment), which touches the same schema-transformation code.
Notes
Deferred from #978; part of the #979 cleanup. Confirm no impact on
apify-mcp-server-internalbefore landing.