// =============================================================================
// web_search tool registration. Logic lives in ./search-api.ts.
// =============================================================================

import { registerTool } from './registry';
import * as api from './search-api';

registerTool({
    name: 'web_search',
    description: 'Search the web for current information. Use this to research competitors, market trends, pricing models, existing solutions, technology choices, or any topic the user mentions that would benefit from real-world context. Returns a summary of top search results.',
    parameters: {
        type: 'object',
        properties: {
            query: {
                type: 'string',
                description: 'The search query. Be specific — e.g. "SaaS project management tools pricing 2024" rather than just "project management".'
            }
        },
        required: ['query']
    },
    async handler(args) {
        return api.webSearch(String(args.query));
    }
});
