Skip to content

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

Draft
jirispilka wants to merge 3 commits into
masterfrom
claude/issue-977-2bjt5t
Draft

refactor: Normalize tool file and export names to match tool names#1024
jirispilka wants to merge 3 commits into
masterfrom
claude/issue-977-2bjt5t

Conversation

@jirispilka

@jirispilka jirispilka commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

What we're solving

Each tool carried three vocabularies — file name, export const, and the wire tool name (the only name users see). E.g. dataset_collection.ts exported getUserDatasetsList for the tool get-dataset-list, and export suffixes were inconsistent (...Tool sometimes, bare otherwise). This collapses all three to one vocabulary derived from the wire name. Closes #977.

How

Pure rename, no behavior change. File = snake_case of the wire name; export = camelCase of the wire name with no Tool suffix. HelperTools enum values (the wire contract) are untouched.

  • git mv the three *_collection.ts files → get_dataset_list.ts, get_key_value_store_list.ts, get_actor_run_list.ts (+ matching test files).
  • Normalize the ToolEntry exports: addTooladdActor, getUser*Listget*List, drop Tool/default/apps prefixes on single-variant exports, and name the two-variant call-actor pair callActorDefault/callActorApps.
  • index_internals.ts exports addActor (canonical) and re-exports it as a deprecated addTool alias, so apify-mcp-server-internal keeps building against its pinned published version. The alias decouples the two repos' merges and is removed once internal migrates off addTool (companion PR updates its integration suite).

Rebased onto master; the domain regroup (#1019) is already merged, so this diff is the rename only.

Alternatives considered

  • Lockstep rename with no alias. Would force apify-mcp-server-internal to bump the package version and switch imports in the same release window. Chose the deprecated addTool alias instead so the two repos merge independently and internal migrates on its own schedule.
  • Rename getActorRunLog/get_actor_run_log.ts. Left as-is: its wire name is the frozen, out-of-scope enum value get-actor-log, so applying the rule strictly would produce getActorLog — a name the issue never listed and that reads worse. Flagged separately.
  • Rename private zod schema consts (getUserDatasetsListArgs, addToolArgsSchema, etc.). Out of scope: the issue covers ToolEntry export names and file names only.

Verification

pnpm run type-check, lint, test:unit (968 pass), check:agents, format all green after rebasing onto master. Wire names are untouched — an earlier mcpc probe of both stdio sessions confirmed all tool names unchanged and no behavior change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YEYUpGUBagZi4m14YbyJua


Generated by Claude Code

@jirispilka jirispilka marked this pull request as draft June 24, 2026 15:34
@jirispilka jirispilka force-pushed the claude/nifty-dijkstra-074iz2 branch 2 times, most recently from d099543 to 8ea4493 Compare June 25, 2026 22:23
Base automatically changed from claude/nifty-dijkstra-074iz2 to master June 25, 2026 22:40
claude added 3 commits June 26, 2026 20:17
Each tool carried three vocabularies: file name, export const, and the
wire tool name. Collapse to one derived from the wire name — file =
snake_case of the wire name, export = camelCase of the wire name with no
`Tool` suffix. Wire contract (HelperTools enum values) is untouched, so
this is renames only with no behavior change.

Renames the three `*_collection.ts` files to their tool names and
normalizes the ToolEntry exports (`addTool`→`addActor`, `getUser*List`→
`get*List`, dropped `Tool`/`default`/`apps` prefixes, call-actor pair →
`callActorDefault`/`callActorApps`). `index_internals.ts` re-exports
`addActor` directly; coordinated in lockstep with apify-mcp-server-internal.

`getActorRunLog` is left as-is: its wire name is the frozen, out-of-scope
enum value `get-actor-log`, so applying the rule would produce a name the
issue never listed. Private zod schema consts are out of scope (export and
file names only).

Closes #977.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YEYUpGUBagZi4m14YbyJua
The internals export was renamed addTool -> addActor. apify-mcp-server-internal
still imports addTool from a pinned published version, so re-export addActor as
addTool to keep that consumer building. Decouples the two repos' merges; remove
the alias once internal migrates off addTool.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YEYUpGUBagZi4m14YbyJua
Rebase onto master picked up tools.add_actor.test.ts and three new cases in
tools.get_actor_run.response.test.ts that still referenced the old export
names. Update them to addActor / getActorRun.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YEYUpGUBagZi4m14YbyJua
@jirispilka jirispilka force-pushed the claude/issue-977-2bjt5t branch from 0314831 to d8f222c Compare June 26, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants