fix(registry-search): remove category filter that causes missed results
This commit is contained in:
parent
211be5d197
commit
f9c5d903a1
2 changed files with 2 additions and 22 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@tpmjs/registry-search",
|
"name": "@tpmjs/registry-search",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"description": "Search the TPMJS tool registry from any AI SDK agent",
|
"description": "Search the TPMJS tool registry from any AI SDK agent",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ const TPMJS_API_URL = process.env.TPMJS_API_URL || 'https://tpmjs.com';
|
||||||
*/
|
*/
|
||||||
type RegistrySearchInput = {
|
type RegistrySearchInput = {
|
||||||
query: string;
|
query: string;
|
||||||
category?: string;
|
|
||||||
limit?: number;
|
limit?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -29,24 +28,6 @@ export const registrySearchTool = tool({
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'Search query (keywords, tool names, descriptions)',
|
description: 'Search query (keywords, tool names, descriptions)',
|
||||||
},
|
},
|
||||||
category: {
|
|
||||||
type: 'string',
|
|
||||||
description: 'Filter by tool category (optional)',
|
|
||||||
enum: [
|
|
||||||
'web-scraping',
|
|
||||||
'data-processing',
|
|
||||||
'file-operations',
|
|
||||||
'communication',
|
|
||||||
'database',
|
|
||||||
'api-integration',
|
|
||||||
'image-processing',
|
|
||||||
'text-analysis',
|
|
||||||
'automation',
|
|
||||||
'ai-ml',
|
|
||||||
'security',
|
|
||||||
'monitoring',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
limit: {
|
limit: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
description: 'Maximum number of results (1-20, default 5)',
|
description: 'Maximum number of results (1-20, default 5)',
|
||||||
|
|
@ -57,12 +38,11 @@ export const registrySearchTool = tool({
|
||||||
required: ['query'],
|
required: ['query'],
|
||||||
additionalProperties: false,
|
additionalProperties: false,
|
||||||
}),
|
}),
|
||||||
async execute({ query, category, limit = 5 }) {
|
async execute({ query, limit = 5 }) {
|
||||||
try {
|
try {
|
||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
q: query,
|
q: query,
|
||||||
limit: String(limit),
|
limit: String(limit),
|
||||||
...(category && { category }),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const url = `${TPMJS_API_URL}/api/tools/search?${params}`;
|
const url = `${TPMJS_API_URL}/api/tools/search?${params}`;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue