refactor: Split tools/utils.ts into tool-naming and input-schema modules · Issue #1021 · apify/apify-mcp-server · GitHub
Skip to content

refactor: Split tools/utils.ts into tool-naming and input-schema modules #1021

Description

@jirispilka

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):

  1. Tool-name helpersactorNameToToolName, legacyToolNameToNew, getToolSchemaID, isActorInfoMcpServer, isActorBlockedUnderPaymentProvider.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-aiIssues owned by the AI team.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions