import { z } from "zod";
import { apiGet } from "../client.js";
export const name = "search_coins";
export const description =
"Search for cryptocurrencies by name or symbol. Returns matching coins with their " +
"symbol, name, market cap rank, and current price. Use this when you need to find " +
"the correct symbol for a coin before calling get_coin_profile.";
export const schema = z.object({
q: z.string().describe("Search query — coin name or symbol (e.g., 'bitcoin', 'eth', 'solana')"),
});
export async function handler(args: z.infer<typeof schema>) {
return apiGet("/api/v1/coins/search", { q: args.q });
}