import { z } from "zod";
import { fetchPublicProfile } from "../services/gamma.js";
const schema = z.object({
address: z.string().describe("Ethereum address (0x...)"),
});
export const getPublicProfileTool = {
name: "get_public_profile",
description:
"Get a user's public profile by Ethereum address. Unknown address may return 404. Example: address=0xabc....",
parameters: schema,
execute: async (args: z.infer<typeof schema>) => {
try {
const data = await fetchPublicProfile(args.address);
return JSON.stringify(data, null, 2);
} catch (error) {
return JSON.stringify({ error: error instanceof Error ? error.message : String(error) });
}
},
};