Skip to content

Commit 45ffae6

Browse files
authored
fix: rename tools (#99)
rename tools
1 parent 1f738a3 commit 45ffae6

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

src/const.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export const SERVER_VERSION = '1.0.0';
2222
export const USER_AGENT_ORIGIN = 'Origin/mcp-server';
2323

2424
export enum HelperTools {
25-
SEARCH_ACTOR = 'search-actor',
26-
ADD_TOOL = 'add-tool',
27-
REMOVE_TOOL = 'remove-tool',
28-
GET_TOOL_DETAILS = 'get-tool-details',
25+
SEARCH_ACTORS = 'search-actors',
26+
ADD_ACTOR = 'add-actor',
27+
REMOVE_ACTOR = 'remove-actor',
28+
GET_ACTOR_DETAILS = 'get-actor-details',
2929
}
3030

3131
export const defaults = {

src/tools/build.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ const GetActorDefinitionArgsSchema = z.object({
116116
export const actorDefinitionTool: ToolWrap = {
117117
type: 'internal',
118118
tool: {
119-
name: HelperTools.GET_TOOL_DETAILS,
120-
actorFullName: HelperTools.GET_TOOL_DETAILS,
119+
name: HelperTools.GET_ACTOR_DETAILS,
120+
// TODO: remove actorFullName from internal tools
121+
actorFullName: HelperTools.GET_ACTOR_DETAILS,
121122
description: 'Get documentation, readme, input schema and other details about an Actor. '
122123
+ 'For example, when user says, I need to know more about web crawler Actor.'
123124
+ 'Get details for an Actor with with Actor ID or Actor full name, i.e. username/name.'

src/tools/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const AddToolArgsSchema = z.object({
1616
export const addTool: ToolWrap = {
1717
type: 'internal',
1818
tool: {
19-
name: HelperTools.ADD_TOOL,
19+
name: HelperTools.ADD_ACTOR,
2020
description: 'Add a tool, Actor or MCP-Server to available tools by Actor ID or Actor name. '
2121
+ 'A tool is an Actor or MCP-Server that can be called by the user'
2222
+ 'Do not execute the tool, only add it and list it in available tools. '
@@ -48,7 +48,7 @@ export const RemoveToolArgsSchema = z.object({
4848
export const removeTool: ToolWrap = {
4949
type: 'internal',
5050
tool: {
51-
name: HelperTools.REMOVE_TOOL,
51+
name: HelperTools.REMOVE_ACTOR,
5252
description: 'Remove a tool, an Actor or MCP-Server by name from available tools. '
5353
+ 'For example, when user says, I do not need a tool username/name anymore',
5454
inputSchema: zodToJsonSchema(RemoveToolArgsSchema),

src/tools/store_collection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ export const SearchToolArgsSchema = z.object({
7070
export const searchActorTool: ToolWrap = {
7171
type: 'internal',
7272
tool: {
73-
name: HelperTools.SEARCH_ACTOR,
74-
actorFullName: HelperTools.SEARCH_ACTOR,
73+
name: HelperTools.SEARCH_ACTORS,
74+
actorFullName: HelperTools.SEARCH_ACTORS,
7575
description: `Discover available Actors or MCP-Servers in Apify Store using full text search using keywords.`
7676
+ `Users try to discover Actors using free form query in this case search query must be converted to full text search. `
7777
+ `Returns a list of Actors with name, description, run statistics, pricing, starts, and URL. `

tests/actor-server-test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ describe('ApifyMcpServer initialization', () => {
5959

6060
const toolNames = server.getToolNames();
6161
expect(toolNames).toEqual([
62-
HelperTools.SEARCH_ACTOR,
63-
HelperTools.GET_TOOL_DETAILS,
64-
HelperTools.ADD_TOOL,
65-
HelperTools.REMOVE_TOOL,
62+
HelperTools.SEARCH_ACTORS,
63+
HelperTools.GET_ACTOR_DETAILS,
64+
HelperTools.ADD_ACTOR,
65+
HelperTools.REMOVE_ACTOR,
6666
]);
6767
});
6868
});

0 commit comments

Comments
 (0)