import type { ToolDef } from './types.js';
import { webSearchTool } from './search.js';
import { scrapeUrlTool } from './scrape.js';
import { calculatorTool } from './calculator.js';
import { quoteTool } from './finance.js';
import { imageSearchTool } from './media.js';

const ALL_TOOLS: ToolDef[] = [
  webSearchTool,
  scrapeUrlTool,
  calculatorTool,
  quoteTool,
  imageSearchTool,
];

export function getTools(): ToolDef[] {
  return ALL_TOOLS;
}

export function getTool(name: string): ToolDef | undefined {
  return ALL_TOOLS.find((t) => t.name === name);
}

export function getToolSchemasForLLM(): { name: string; description: string; schema: ToolDef['schema'] }[] {
  return ALL_TOOLS.map((t) => ({
    name: t.name,
    description: t.description,
    schema: t.schema,
  }));
}
