get_case_detail
Retrieve comprehensive details of a mystery case, including overview, people, alibis, relationships, and timeline events, using a case UUID.
Instructions
사건 한 건의 전체 내용(개요, 인물, 알리바이, 관계, 타임라인 이벤트, 기록)을 반환합니다. 결과의 url은 손수첩 웹에서 이 사건을 바로 여는 링크입니다.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | 사건의 UUID |
Implementation Reference
- src/tools.ts:90-93 (handler)The handler function for 'get_case_detail' tool. It takes an id (UUID), calls fetchCase to retrieve the full case data from the database, and returns it with a url link to the case in the web app.
handler: async ({ id }: { id: string }) => { const c = await fetchCase(id); return { ...c, url: caseUrl(c.id ?? id) }; }, - src/tools.ts:89-89 (schema)Input schema for 'get_case_detail': expects a single required parameter 'id' which is a UUID string describing the case ID.
inputSchema: z.object({ id: z.string().uuid().describe('사건의 UUID') }), - src/tools.ts:85-94 (registration)Tool definition registration for 'get_case_detail' as part of the exported 'tools' array. Includes the tool name, description, inputSchema, and handler.
{ name: 'get_case_detail', description: '사건 한 건의 전체 내용(개요, 인물, 알리바이, 관계, 타임라인 이벤트, 기록)을 반환합니다. 결과의 url은 손수첩 웹에서 이 사건을 바로 여는 링크입니다.', inputSchema: z.object({ id: z.string().uuid().describe('사건의 UUID') }), handler: async ({ id }: { id: string }) => { const c = await fetchCase(id); return { ...c, url: caseUrl(c.id ?? id) }; }, }, - src/tools.ts:50-54 (helper)The fetchCase helper function that calls the Supabase RPC 'mcp_get_case' to retrieve full case data by ID. Throws an error if the case is not found.
async function fetchCase(id: string): Promise<CaseData> { const data = await callRpc<CaseData | null>('mcp_get_case', { p_id: id }); if (!data) throw new Error(`사건을 찾을 수 없습니다: ${id}`); return data; } - src/index.ts:16-24 (registration)MCP server registration: tools are listed via ListToolsRequestSchema and dispatched via CallToolRequestSchema which finds the tool by name and invokes its handler after parsing input with the Zod schema.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: tools.map((t) => ({ name: t.name, description: t.description, inputSchema: zodToJsonSchema(t.inputSchema, { target: 'jsonSchema7' }) as Record< string, unknown >, })),