diff --git a/src/services/mcp/tools/actions.ts b/src/services/mcp/tools/actions.ts index 195e64a..487a5d2 100644 --- a/src/services/mcp/tools/actions.ts +++ b/src/services/mcp/tools/actions.ts @@ -2,11 +2,12 @@ import z from "zod"; import server from "../server.js"; import { ownerActions, ownerPublish } from "../../owner.js"; import { FollowUser, UnfollowUser } from "applesauce-actions/actions"; +import { normalizeToHexPubkey } from "../../../helpers/nip19.js"; server.tool( "Follow user", "Adds another users pubkey to the owners following list", - { pubkey: z.string() }, + { pubkey: z.string().transform((hex) => normalizeToHexPubkey(hex, true)) }, async ({ pubkey }) => { try { await ownerActions.exec(FollowUser, pubkey).forEach(ownerPublish); @@ -20,7 +21,7 @@ server.tool( server.tool( "Unfollow user", "Removes another users pubkey from the owners following list", - { pubkey: z.string() }, + { pubkey: z.string().transform((hex) => normalizeToHexPubkey(hex, true)) }, async ({ pubkey }) => { try { await ownerActions.exec(UnfollowUser, pubkey).forEach(ownerPublish);