mirror of
https://github.com/aljazceru/bakery.git
synced 2025-12-17 12:45:20 +01:00
fix mcp tool names
This commit is contained in:
@@ -5,7 +5,7 @@ import { FollowUser, UnfollowUser } from "applesauce-actions/actions";
|
|||||||
import { normalizeToHexPubkey } from "../../../helpers/nip19.js";
|
import { normalizeToHexPubkey } from "../../../helpers/nip19.js";
|
||||||
|
|
||||||
server.tool(
|
server.tool(
|
||||||
"Follow user",
|
"follow_user",
|
||||||
"Adds another users pubkey to the owners following list",
|
"Adds another users pubkey to the owners following list",
|
||||||
{ pubkey: z.string().transform((hex) => normalizeToHexPubkey(hex, true)) },
|
{ pubkey: z.string().transform((hex) => normalizeToHexPubkey(hex, true)) },
|
||||||
async ({ pubkey }) => {
|
async ({ pubkey }) => {
|
||||||
@@ -19,7 +19,7 @@ server.tool(
|
|||||||
);
|
);
|
||||||
|
|
||||||
server.tool(
|
server.tool(
|
||||||
"Unfollow user",
|
"unfollow_user",
|
||||||
"Removes another users pubkey from the owners following list",
|
"Removes another users pubkey from the owners following list",
|
||||||
{ pubkey: z.string().transform((hex) => normalizeToHexPubkey(hex, true)) },
|
{ pubkey: z.string().transform((hex) => normalizeToHexPubkey(hex, true)) },
|
||||||
async ({ pubkey }) => {
|
async ({ pubkey }) => {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { NostrConnectSigner } from "applesauce-signers";
|
|||||||
import { NostrConnectAccount } from "applesauce-accounts/accounts";
|
import { NostrConnectAccount } from "applesauce-accounts/accounts";
|
||||||
|
|
||||||
server.tool(
|
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",
|
"Sets the nostr connect URI that should be used to request signatures from the owners pubkey",
|
||||||
{ uri: z.string().startsWith("bunker://") },
|
{ uri: z.string().startsWith("bunker://") },
|
||||||
async ({ uri }) => {
|
async ({ uri }) => {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import database from "../../database.js";
|
import database from "../../database.js";
|
||||||
import server from "../server.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();
|
const result = database.db.prepare<[], { events: number }>(`SELECT COUNT(*) AS events FROM events`).get();
|
||||||
return { content: [{ type: "text", text: `Total events: ${result?.events ?? 0}` }] };
|
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
|
const result = database.db
|
||||||
.prepare<[], { users: number }>(`SELECT COUNT(*) AS users FROM events GROUP BY pubkey`)
|
.prepare<[], { users: number }>(`SELECT COUNT(*) AS users FROM events GROUP BY pubkey`)
|
||||||
.get();
|
.get();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import config from "../../config.js";
|
|||||||
import { lastValueFrom, toArray } from "rxjs";
|
import { lastValueFrom, toArray } from "rxjs";
|
||||||
|
|
||||||
server.tool(
|
server.tool(
|
||||||
"Sign draft event",
|
"sign_draft_event",
|
||||||
"Signs a draft note event with the owners pubkey",
|
"Signs a draft note event with the owners pubkey",
|
||||||
{
|
{
|
||||||
draft: z.object({
|
draft: z.object({
|
||||||
@@ -35,7 +35,7 @@ server.tool(
|
|||||||
);
|
);
|
||||||
|
|
||||||
server.tool(
|
server.tool(
|
||||||
"Publish event",
|
"publish_event",
|
||||||
"Publishes an event to the owners outbox relays",
|
"Publishes an event to the owners outbox relays",
|
||||||
{
|
{
|
||||||
event: z.object({
|
event: z.object({
|
||||||
|
|||||||
Reference in New Issue
Block a user