fix(mcp): add missing tool safety annotations (#1383)

This commit is contained in:
Dhravya Shah 2026-07-30 21:10:42 -07:00 committed by GitHub
parent ff40a82d69
commit a7161c7132
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 0 deletions

View file

@ -12,3 +12,11 @@ export const MEMORY_TOOL_ANNOTATIONS = {
idempotentHint: false,
openWorldHint: false,
} as const
/** Non-destructive account/session mutations, e.g. switching the active space. */
export const SETTINGS_TOOL_ANNOTATIONS = {
readOnlyHint: false,
destructiveHint: false,
idempotentHint: true,
openWorldHint: false,
} as const

View file

@ -2,6 +2,7 @@ import { z } from "zod"
import type { ViewMessage } from "../../shared/types"
import { appResultMeta, appToolMeta } from "../app-metadata"
import { effectiveContainerTagAccess } from "../auth/rbac"
import { READ_ONLY_TOOL_ANNOTATIONS } from "./annotations"
import type { ToolDeps } from "./types"
export function register(deps: ToolDeps) {
@ -14,6 +15,7 @@ export function register(deps: ToolDeps) {
prefill: z.string().optional().describe("Optional content to prefill"),
}),
_meta: appToolMeta(),
annotations: READ_ONLY_TOOL_ANNOTATIONS,
},
async (args) => {
try {

View file

@ -2,6 +2,7 @@ import { z } from "zod"
import type { ViewMessage } from "../../shared/types"
import { appResultMeta, appToolMeta } from "../app-metadata"
import { effectiveContainerTagAccess } from "../auth/rbac"
import { READ_ONLY_TOOL_ANNOTATIONS } from "./annotations"
import type { ToolDeps } from "./types"
export function register(deps: ToolDeps) {
@ -13,6 +14,7 @@ export function register(deps: ToolDeps) {
"Choose the active Supermemory space. Shows available spaces as interactive cards.",
inputSchema: z.object({}),
_meta: appToolMeta(),
annotations: READ_ONLY_TOOL_ANNOTATIONS,
},
async () => {
try {

View file

@ -2,6 +2,7 @@ import { z } from "zod"
import type { ViewMessage } from "../../shared/types"
import { appResultMeta, appToolMeta } from "../app-metadata"
import { containerTagSchema } from "../container-tag"
import { SETTINGS_TOOL_ANNOTATIONS } from "./annotations"
import type { ToolDeps } from "./types"
export function register(deps: ToolDeps) {
@ -14,6 +15,7 @@ export function register(deps: ToolDeps) {
viewId: z.string().uuid().optional(),
}),
_meta: appToolMeta(["app"]),
annotations: SETTINGS_TOOL_ANNOTATIONS,
},
async (args) => {
const { containerTag } = args

View file

@ -2,6 +2,7 @@ import { z } from "zod"
import type { ViewMessage } from "../../shared/types"
import { appResultMeta, appToolMeta } from "../app-metadata"
import { effectiveContainerTagAccess } from "../auth/rbac"
import { READ_ONLY_TOOL_ANNOTATIONS } from "./annotations"
import type { ToolDeps } from "./types"
export function register(deps: ToolDeps) {
@ -12,6 +13,7 @@ export function register(deps: ToolDeps) {
description: "Upload a file (PDF, text, image, video) to memory.",
inputSchema: z.object({}),
_meta: appToolMeta(),
annotations: READ_ONLY_TOOL_ANNOTATIONS,
},
async () => {
try {