You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/search.ts
+88-12Lines changed: 88 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,8 @@ export class Search extends Asset {
92
92
this.server.registerTool(
93
93
'search',
94
94
{
95
-
description: 'Search for repositories',
95
+
description:
96
+
'Search for repositories. It sorts results by best match if no sort criteria is provided.',
96
97
inputSchema: {
97
98
query: z.string().describe('The query to search for'),
98
99
badges: z
@@ -129,12 +130,14 @@ export class Search extends Asset {
129
130
sort: z
130
131
.enum(['pull_count','updated_at'])
131
132
.optional()
133
+
.nullable()
132
134
.describe(
133
-
'The criteria to sort the search results by. If the `sort` field is not set, pull count is used by default. When search extensions, documents are sort alphabetically if none is provided.'
135
+
'The criteria to sort the search results by. If the `sort` field is not set, the best match is used by default. When search extensions, documents are sort alphabetically if none is provided. Do not use it unless user explicitly asks for it.'
134
136
),
135
137
order: z
136
138
.enum(['asc','desc'])
137
139
.optional()
140
+
.nullable()
138
141
.describe('The order to sort the search results by'),
139
142
images: z
140
143
.array(z.string())
@@ -161,11 +164,11 @@ export class Search extends Asset {
161
164
extension_reviewed?: boolean;
162
165
from?: number;
163
166
size?: number;
164
-
sort?: 'pull_count'|'updated_at';
165
-
order?: 'asc'|'desc';
167
+
sort?: 'pull_count'|'updated_at'|null;
168
+
order?: 'asc'|'desc'|null;
166
169
images?: string[];
167
170
}): Promise<CallToolResult>{
168
-
logger.info(`Searching for repositories with query: ${request.query}`);
171
+
logger.info(`Searching for repositories with request: ${JSON.stringify(request)}`);
0 commit comments