🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
fix(mcp): Remove `deleteScore` tool (#13877)
Ben Bachem5a5b3d787631
diff --git a/web/src/__tests__/server/mcp-public-api-tools.servertest.ts b/web/src/__tests__/server/mcp-public-api-tools.servertest.tsindex 2668693878..fa033b0bb3 100644--- a/web/src/__tests__/server/mcp-public-api-tools.servertest.ts+++ b/web/src/__tests__/server/mcp-public-api-tools.servertest.ts@@ -223,7 +223,6 @@ describe("MCP public API tools", () => {"deleteDatasetItem","deleteDatasetRun","deleteModel",- "deleteScore","deleteScoreConfig","updateAnnotationQueueItem","updatePromptLabels",diff --git a/web/src/__tests__/server/mcp-tools-read.servertest.ts b/web/src/__tests__/server/mcp-tools-read.servertest.tsindex 13be9df827..3d57e9100d 100644--- a/web/src/__tests__/server/mcp-tools-read.servertest.ts+++ b/web/src/__tests__/server/mcp-tools-read.servertest.ts@@ -10,12 +10,6 @@ vi.mock("@langfuse/shared/src/server", async () => {disconnect: vi.fn(),}),},- ScoreDeleteQueue: {- getInstance: () => ({- add: vi.fn().mockResolvedValue(undefined),- disconnect: vi.fn(),- }),- },};});@@ -95,10 +89,6 @@ import {createScoreTool,handleCreateScore,} from "@/src/features/mcp/features/scores/tools/createScore";-import {- deleteScoreTool,- handleDeleteScore,-} from "@/src/features/mcp/features/scores/tools/deleteScore";import {deleteScoreConfigTool,handleDeleteScoreConfig,@@ -1593,32 +1583,6 @@ describe("MCP Read Tools", () => {});});- describe("deleteScore tool", () => {- it("should have destructiveHint annotation", () => {- verifyToolAnnotations(deleteScoreTool, { destructiveHint: true });- });-- it("should queue score deletion using v1 route semantics", async () => {- const { context, projectId, apiKeyId } = await createMcpTestSetup();- const scoreId = randomUUID();-- const result = await handleDeleteScore({ scoreId }, context);-- expect(result).toEqual({- message: "Score deletion queued successfully",- });- await expect(- verifyAuditLog({- projectId,- resourceType: "score",- resourceId: scoreId,- action: "delete",- apiKeyId,- }),- ).resolves.toMatchObject({ action: "delete" });- });- });-describe("listScoreConfigs tool", () => {it("should have readOnlyHint annotation", () => {verifyToolAnnotations(listScoreConfigsTool, { readOnlyHint: true });diff --git a/web/src/features/mcp/features/scores/index.ts b/web/src/features/mcp/features/scores/index.tsindex 721b378725..f8e639e773 100644--- a/web/src/features/mcp/features/scores/index.ts+++ b/web/src/features/mcp/features/scores/index.ts@@ -14,7 +14,6 @@ import {handleCreateScoreConfig,} from "./tools/createScoreConfig";import { createScoreTool, handleCreateScore } from "./tools/createScore";-import { deleteScoreTool, handleDeleteScore } from "./tools/deleteScore";import {deleteScoreConfigTool,handleDeleteScoreConfig,@@ -43,10 +42,6 @@ export const scoresFeature: McpFeatureModule = {definition: createScoreTool,handler: handleCreateScore,},- {- definition: deleteScoreTool,- handler: handleDeleteScore,- },{definition: listScoreConfigsTool,handler: handleListScoreConfigs,diff --git a/web/src/features/mcp/features/scores/tools/deleteScore.ts b/web/src/features/mcp/features/scores/tools/deleteScore.tsdeleted file mode 100644index 6a1fef2e33..0000000000--- a/web/src/features/mcp/features/scores/tools/deleteScore.ts+++ /dev/null@@ -1,31 +0,0 @@-import { DeleteScoreQueryV1, DeleteScoreResponseV1 } from "@langfuse/shared";-import { ScoresApiService } from "@/src/features/public-api/server/scores-api-service";-import { defineTool } from "../../../core/define-tool";-import { runMcpTool } from "../../../core/run-mcp-tool";--export const [deleteScoreTool, handleDeleteScore] = defineTool({- name: "deleteScore",- description:- "Delete one score from the current Langfuse project using the v1 /api/public/scores/{scoreId} route semantics. This is the v1 fallback because score deletion has no v2 public route.",- baseSchema: DeleteScoreQueryV1,- inputSchema: DeleteScoreQueryV1,- handler: async (input, context) => {- return await runMcpTool({- spanName: "mcp.scores.delete",- context,- attributes: { "mcp.score_id": input.scoreId },- fn: async () => {- const scoresApiService = new ScoresApiService("v2");- const result = await scoresApiService.deleteScore({- scoreId: input.scoreId,- projectId: context.projectId,- orgId: context.orgId,- apiKeyId: context.apiKeyId,- });-- return DeleteScoreResponseV1.parse(result);- },- });- },- destructiveHint: true,-});