mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
fix(mcp): add missing tool safety annotations (#1383)
This commit is contained in:
parent
ff40a82d69
commit
a7161c7132
5 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue