diff --git a/src/index.ts b/src/index.ts index 110abc8..2a62179 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,7 +8,6 @@ import { registerSourceTools } from "./tools/sources.js"; import { registerUserTools } from "./tools/user.js"; import { registerModerationTools } from "./tools/moderation.js"; import { registerTicketTools } from "./tools/tickets.js"; -import { registerLegalTools } from "./tools/legal.js"; import { registerBlogTools } from "./tools/blog.js"; import { registerApiKeyTools } from "./tools/api-keys.js"; import { registerSessionTools } from "./tools/sessions.js"; @@ -37,7 +36,6 @@ registerSourceTools(server, client); registerUserTools(server, client); registerModerationTools(server, client); registerTicketTools(server, client); -registerLegalTools(server, client); registerBlogTools(server, client); registerApiKeyTools(server, client); registerSessionTools(server, client); diff --git a/src/tools/legal.ts b/src/tools/legal.ts deleted file mode 100644 index 09d5864..0000000 --- a/src/tools/legal.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; -import { z } from "zod"; -import type { BetterNewsClient } from "../client.js"; -import { handleTool } from "../utils.js"; - -export function registerLegalTools(server: McpServer, client: BetterNewsClient) { - server.tool( - "get_terms_of_service", - "Get the current published Terms of Service document.", - {}, - handleTool(async () => { - const data = await client.get("/api/legal/current/terms_of_service"); - return JSON.stringify(data, null, 2); - }), - ); - - server.tool( - "get_privacy_policy", - "Get the current published Privacy Policy document.", - {}, - handleTool(async () => { - const data = await client.get("/api/legal/current/privacy_policy"); - return JSON.stringify(data, null, 2); - }), - ); - - server.tool( - "list_legal_documents", - "List legal documents. Public sees published only; Mod/Admin see all.", - { - type: z.enum(["terms_of_service", "privacy_policy"]).optional().describe("Filter by document type"), - status: z.enum(["draft", "published", "archived"]).optional().describe("Filter by status (Mod/Admin only)"), - page: z.number().int().positive().optional().describe("Page number (default 1)"), - limit: z.number().int().min(1).max(50).optional().describe("Items per page (default 20)"), - }, - handleTool(async (args) => { - const data = await client.get("/api/legal", args); - return JSON.stringify(data, null, 2); - }), - ); - - server.tool( - "accept_legal_documents", - "Accept the current legal documents (Terms of Service and Privacy Policy). Clears the legalAcceptanceRequired flag.", - {}, - handleTool(async () => { - const data = await client.post("/api/legal/accept"); - return JSON.stringify(data, null, 2); - }), - ); -}