Skip to content

refactor: Normalize tool file and export names to match tool names #977

Description

@jirispilka

Problem

Three vocabularies exist for the same tool. Examples:

  • File dataset_collection.ts exports getUserDatasetsList, which is tool get-dataset-list (enum key DATASET_LIST_GET).
  • run_collection.tsgetUserRunsListget-actor-run-list.
  • Export naming is inconsistent: addTool, getDataset, fetchApifyDocsTool, searchActorsWidgetTool — sometimes a Tool suffix, sometimes bare.

Proposed solution

One rule, derived from the wire-level tool name (the only name users see):

  • File = tool name in snake_case: get-dataset-listget_dataset_list.ts. Renames: dataset_collection.ts, key_value_store_collection.ts, run_collection.ts (paths per the domain layout from refactor: Regroup src/tools by domain (actors/runs/storage/docs/widgets) #978, e.g. storage/get_dataset_list.ts).
  • Export = camelCase tool name, no Tool suffix: getDatasetList, getKeyValueStoreList, getActorRunList, addActor, fetchApifyDocs, searchApifyDocs, searchActorsWidget, etc.
  • Keep HelperTools enum values untouched (wire contract). Enum key reorder to match (DATASET_LIST_GETGET_DATASET_LIST) is optional and must be coordinated with apify-mcp-server-internal, which imports HelperTools — suggest leaving keys out of scope here.
  • index_internals.ts re-exports addTool — keep an alias or coordinate the rename with internal.

Renames only, no logic changes. Use git mv. Depends on #975, #978 (runs after the domain regroup so files move once). Optionally folds into the #978 PR if reviewers prefer one pass.

Plan

  • Rename *_collection.ts files to tool names
  • Normalize all ToolEntry export names
  • Check index_internals.ts surface; alias addTool if internal isn't updated in lockstep
  • Fix imports, run type-check/lint/unit tests

Metadata

Metadata

Assignees

Labels

t-aiIssues owned by the AI team.

Type

No type

Fields

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