Skip to content

Commit 6768391

Browse files
committed
feat: Improve search tool description
1 parent e5aea96 commit 6768391

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

src/tools/get-actor-details.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const getActorDetailsTool: ToolEntry = {
2222
description: `Get detailed information about an Actor by its ID or full name.\n`
2323
+ `This tool returns title, description, URL, README (Actor's documentation), input schema, and usage statistics. \n`
2424
+ `The Actor name is always composed of "username/name", for example, "apify/rag-web-browser".\n`
25-
+ `Returns Actor information which must be displayed in the same format.\n`
25+
+ `Present Actor information in user-friendly format as an Actor card.\n`
2626
+ `USAGE:\n`
2727
+ `- Use when user asks about an Actor its details, description, input schema, etc.\n`
2828
+ `EXAMPLES:\n`
@@ -59,7 +59,7 @@ export const getActorDetailsTool: ToolEntry = {
5959

6060
return {
6161
content: [
62-
{ type: 'text', text: actorCard },
62+
{ type: 'text', text: `**Actor card**:\n${actorCard}` },
6363
{ type: 'text', text: `**README:**\n${buildInfo.actorDefinition.readme || 'No README provided.'}` },
6464
{ type: 'text', text: `**Input Schema:**\n${JSON.stringify(inputSchema, null, 0)}` },
6565
],

src/tools/store_collection.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,21 @@ export const searchActors: ToolEntry = {
7272
type: 'internal',
7373
tool: {
7474
name: HelperTools.STORE_SEARCH,
75-
description: `Discover available Actors or MCP servers (which are also considered Actors in the context of Apify) in the Apify Store.\n`
76-
+ 'This tool uses full-text search, so you MUST use simple space-separated keywords, such as "web scraping", '
77-
+ '"data extraction", or "playwright browser mcp".\n'
78-
+ 'This tool returns a list of Actors with basic information, including descriptions, pricing models, usage statistics, and user ratings.\n'
79-
+ 'Prefer Actors with more users, stars, and runs.\n'
80-
+ 'You may need to use this tool several times to find the right Actor.\n'
81-
+ 'Limit the number of results returned, but ensure that relevant results are included.\n'
82-
+ 'This is not a general search tool; it is designed specifically to search for Actors in the Apify Store.',
75+
description: `Search for Actors or Model Context Protocol (MCP) servers in the Apify Store using keywords.\n`
76+
+ `This tool returns a list of Actors with title, description, pricing model, usage statistics, and user ratings.\n`
77+
+ `Use simple space-separated keywords for best results, such as "web scraping", "data extraction", or "playwright browser mcp".\n`
78+
+ `You may need to use this tool several times to find the right Actor.\n`
79+
+ `Limit the number of results returned, but ensure that relevant results are included.\n`
80+
+ `Always present the results in a user-friendly format as an Actor cards.\n`
81+
+ `USAGE:\n`
82+
+ `- Use when user wants to find Actors for a specific task or technology\n`
83+
+ `- Use when user asks about available Actors in the Apify Store\n`
84+
+ `- Use when user needs to discover MCP servers or automation tools\n`
85+
+ `EXAMPLES:\n`
86+
+ `- user_input: Find Actors for web scraping\n`
87+
+ `- user_input: Search for MCP servers\n`
88+
+ `- user_input: What Actors are available for data extraction\n`
89+
+ `- user_input: Show me Actors that use Playwright`,
8390
inputSchema: zodToJsonSchema(searchActorsArgsSchema),
8491
ajvValidate: ajv.compile(zodToJsonSchema(searchActorsArgsSchema)),
8592
call: async (toolArgs) => {
@@ -97,7 +104,7 @@ export const searchActors: ToolEntry = {
97104
content: [
98105
{ type: 'text', text: `**Search query:** ${parsed.search}` },
99106
{ type: 'text', text: `**Number of Actors found:** ${actorCards.length}` },
100-
{ type: 'text', text: actorCards.join('\n\n') },
107+
{ type: 'text', text: `**Actor cards:**\n${actorCards.join('\n\n')}` },
101108
],
102109
};
103110
},

0 commit comments

Comments
 (0)