From bbfa05a699ffb222e8e70dc3fc6ba68796021d99 Mon Sep 17 00:00:00 2001 From: hzrd149 Date: Thu, 27 Mar 2025 19:08:14 +0000 Subject: [PATCH] fix mcp tool names --- src/services/mcp/tools/actions.ts | 4 ++-- src/services/mcp/tools/config.ts | 2 +- src/services/mcp/tools/database.ts | 4 ++-- src/services/mcp/tools/events.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/services/mcp/tools/actions.ts b/src/services/mcp/tools/actions.ts index 487a5d2..4bfc154 100644 --- a/src/services/mcp/tools/actions.ts +++ b/src/services/mcp/tools/actions.ts @@ -5,7 +5,7 @@ import { FollowUser, UnfollowUser } from "applesauce-actions/actions"; import { normalizeToHexPubkey } from "../../../helpers/nip19.js"; server.tool( - "Follow user", + "follow_user", "Adds another users pubkey to the owners following list", { pubkey: z.string().transform((hex) => normalizeToHexPubkey(hex, true)) }, async ({ pubkey }) => { @@ -19,7 +19,7 @@ server.tool( ); server.tool( - "Unfollow user", + "unfollow_user", "Removes another users pubkey from the owners following list", { pubkey: z.string().transform((hex) => normalizeToHexPubkey(hex, true)) }, async ({ pubkey }) => { diff --git a/src/services/mcp/tools/config.ts b/src/services/mcp/tools/config.ts index 3db5c5b..df41eb7 100644 --- a/src/services/mcp/tools/config.ts +++ b/src/services/mcp/tools/config.ts @@ -6,7 +6,7 @@ import { NostrConnectSigner } from "applesauce-signers"; import { NostrConnectAccount } from "applesauce-accounts/accounts"; server.tool( - "Set owner nostr connect URI", + "set_owner_nostr_connect_uri", "Sets the nostr connect URI that should be used to request signatures from the owners pubkey", { uri: z.string().startsWith("bunker://") }, async ({ uri }) => { diff --git a/src/services/mcp/tools/database.ts b/src/services/mcp/tools/database.ts index 594331a..e8a4b9d 100644 --- a/src/services/mcp/tools/database.ts +++ b/src/services/mcp/tools/database.ts @@ -1,12 +1,12 @@ import database from "../../database.js"; import server from "../server.js"; -server.tool("Total events", "Get the total number of events in the database", {}, async () => { +server.tool("total_events", "Get the total number of events in the database", {}, async () => { const result = database.db.prepare<[], { events: number }>(`SELECT COUNT(*) AS events FROM events`).get(); return { content: [{ type: "text", text: `Total events: ${result?.events ?? 0}` }] }; }); -server.tool("Total users", "Get the total number of users in the database", {}, async () => { +server.tool("total_users", "Get the total number of users in the database", {}, async () => { const result = database.db .prepare<[], { users: number }>(`SELECT COUNT(*) AS users FROM events GROUP BY pubkey`) .get(); diff --git a/src/services/mcp/tools/events.ts b/src/services/mcp/tools/events.ts index 10524d9..bc07e76 100644 --- a/src/services/mcp/tools/events.ts +++ b/src/services/mcp/tools/events.ts @@ -11,7 +11,7 @@ import config from "../../config.js"; import { lastValueFrom, toArray } from "rxjs"; server.tool( - "Sign draft event", + "sign_draft_event", "Signs a draft note event with the owners pubkey", { draft: z.object({ @@ -35,7 +35,7 @@ server.tool( ); server.tool( - "Publish event", + "publish_event", "Publishes an event to the owners outbox relays", { event: z.object({