feat: remove 4 legal document MCP tools
Delete tools/legal.ts (get_terms_of_service, get_privacy_policy, list_legal_documents, accept_legal_documents) and remove the registerLegalTools call from index.ts. Tool count: 89 → 85. Legal documents are now static; no API endpoints back them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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<unknown>("/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<unknown>("/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<unknown>("/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<unknown>("/api/legal/accept");
|
||||
return JSON.stringify(data, null, 2);
|
||||
}),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user