import { ToolRegistry } from '../tools/ToolRegistry';
import type { AsyncRequestHandler } from '../types/http';

export class ToolsController {
  constructor(private readonly registry = new ToolRegistry()) {}

  list: AsyncRequestHandler = async (_req, res) => {
    const tools = this.registry.list().map((tool) => ({
      name: tool.name,
      description: tool.description,
      parameters: tool.parametersDescription,
    }));

    res.json({
      total: tools.length,
      data: tools,
    });
  };
}
