delete_case
Permanently delete a case and all related data, including people, alibis, and records. This action is irreversible.
Instructions
사건을 영구 삭제합니다. 인물·알리바이·기록 등 자식 데이터도 함께 삭제되며 되돌릴 수 없습니다.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/tools.ts:305-308 (handler)The handler function for delete_case that calls the Supabase RPC 'mcp_delete_case' with the case ID and returns success.
handler: async ({ id }: { id: string }) => { await callRpc<null>('mcp_delete_case', { p_id: id }); return { ok: true, listUrl: listUrl() }; }, - src/tools.ts:304-304 (schema)Input schema for delete_case: requires a single 'id' field as a UUID string.
inputSchema: z.object({ id: z.string().uuid() }), - src/tools.ts:301-309 (registration)delete_case is defined as an entry in the tools array in src/tools.ts, registered with name, description, inputSchema, and handler.
{ name: 'delete_case', description: '사건을 영구 삭제합니다. 인물·알리바이·기록 등 자식 데이터도 함께 삭제되며 되돌릴 수 없습니다.', inputSchema: z.object({ id: z.string().uuid() }), handler: async ({ id }: { id: string }) => { await callRpc<null>('mcp_delete_case', { p_id: id }); return { ok: true, listUrl: listUrl() }; }, }, - src/supabase.ts:22-35 (helper)Helper function callRpc that wraps supabase.rpc calls, injecting the MCP token for authentication.
export async function callRpc<T = unknown>( fn: string, args: Record<string, unknown> = {}, ): Promise<T> { const { data, error } = await supabase.rpc(fn, { p_token: TOKEN, ...args }); if (error) { const msg = error.message || 'unknown error'; if (/invalid or revoked MCP token/i.test(msg)) { throw new Error('MCP 토큰이 유효하지 않거나 폐기되었습니다. 손수첩 설정에서 새 토큰을 발급하세요.'); } throw new Error(`Supabase RPC ${fn} 실패: ${msg}`); } return data as T; }