add_alibi
Record an alibi for a person in a mystery case. Optionally include time range and set status to claimed, confirmed, or false.
Instructions
특정 인물에 알리바이를 추가합니다. status: claimed(주장)/confirmed(확인됨)/false(허위). 기본 claimed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caseId | Yes | ||
| personLocalId | Yes | ||
| start | No | 시작 시각 (datetime-local) | |
| end | No | 종료 시각 (datetime-local) | |
| content | Yes | 알리바이 내용 | |
| status | No |
Implementation Reference
- src/tools.ts:231-251 (handler)Handler function for add_alibi tool. Fetches the case, finds the person by local ID, pushes a new alibi entry (with start, end, content, status) to that person's alibis array, saves the case, and returns success.
handler: async (input: { caseId: string; personLocalId: number; start?: string; end?: string; content: string; status?: 'claimed' | 'confirmed' | 'false'; }) => { const c = await fetchCase(input.caseId); const person = c.people.find((p) => p.id === input.personLocalId); if (!person) throw new Error(`인물 local id ${input.personLocalId}을(를) 찾을 수 없습니다.`); person.alibis = person.alibis ?? []; person.alibis.push({ start: input.start ?? '', end: input.end ?? '', content: input.content, status: input.status ?? 'claimed', }); await saveCase(c); return { ok: true, url: caseUrl(input.caseId) }; }, - src/tools.ts:223-230 (schema)Input schema for add_alibi tool using Zod validation. Requires caseId (UUID), personLocalId (int), content (non-empty string). Optional: start, end (datetime-local strings), status (claimed/confirmed/false).
inputSchema: z.object({ caseId: z.string().uuid(), personLocalId: z.number().int(), start: z.string().optional().describe('시작 시각 (datetime-local)'), end: z.string().optional().describe('종료 시각 (datetime-local)'), content: z.string().min(1).describe('알리바이 내용'), status: z.enum(['claimed', 'confirmed', 'false']).optional(), }), - src/tools.ts:219-252 (registration)Registration of the add_alibi tool in the tools array. Defines name, description, inputSchema, and handler for the MCP tool.
{ name: 'add_alibi', description: '특정 인물에 알리바이를 추가합니다. status: claimed(주장)/confirmed(확인됨)/false(허위). 기본 claimed.', inputSchema: z.object({ caseId: z.string().uuid(), personLocalId: z.number().int(), start: z.string().optional().describe('시작 시각 (datetime-local)'), end: z.string().optional().describe('종료 시각 (datetime-local)'), content: z.string().min(1).describe('알리바이 내용'), status: z.enum(['claimed', 'confirmed', 'false']).optional(), }), handler: async (input: { caseId: string; personLocalId: number; start?: string; end?: string; content: string; status?: 'claimed' | 'confirmed' | 'false'; }) => { const c = await fetchCase(input.caseId); const person = c.people.find((p) => p.id === input.personLocalId); if (!person) throw new Error(`인물 local id ${input.personLocalId}을(를) 찾을 수 없습니다.`); person.alibis = person.alibis ?? []; person.alibis.push({ start: input.start ?? '', end: input.end ?? '', content: input.content, status: input.status ?? 'claimed', }); await saveCase(c); return { ok: true, url: caseUrl(input.caseId) }; }, }, - src/tools.ts:46-46 (helper)AlibiData type used to represent an alibi entry with start, end, content, and status fields.
type AlibiData = { start: string; end: string; content: string; status: string };