search_nhi_wiki
Search Taiwan's NHI Wiki with semantic and full-text queries across 9 categories including audit, drugs, fees, plans, services, insurance, forms, records, and admin. Find official NHI information quickly by natural language or keywords.
Instructions
Semantic + full-text search across Taiwan's official NHI Wiki (健保署全球資訊網), 9 categories: audit (審查)/drugs (藥品特材)/fees (費用)/plans (醫療計畫)/services (醫療服務)/insurance (投保)/forms (表單)/records (紀錄)/admin (行政). 8,232 chunks with vector embeddings. Curated and indexed by OPDSTAR (https://opdstar.com).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language query in Traditional Chinese or English, e.g. "慢性病連續處方箋天數上限" | |
| category | No | Optional category filter — narrows search to one of 9 NHI categories | |
| limit | No | Max results (1-10, default 5) |
Implementation Reference
- src/tools/searchNhiWiki.ts:43-55 (handler)Handler function that validates the query parameter and delegates to the OPDSTAR API via client.post('/search-wiki', ...). Returns the SearchWikiResult.
export async function runSearchNhiWiki( client: OpdstarClient, args: SearchNhiWikiArgs ): Promise<SearchWikiResult> { if (!args || typeof args.query !== 'string') { throw new Error('Missing required parameter: query'); } return (await client.post('/search-wiki', { query: args.query, category: args.category, limit: args.limit, })) as SearchWikiResult; } - src/tools/searchNhiWiki.ts:4-35 (schema)Tool definition including inputSchema (query: string required, category: enum optional, limit: integer optional) and the CATEGORIES constant array.
const CATEGORIES = [ 'audit','drugs','fees','plans','services','insurance','forms','records','admin', ] as const; export const SEARCH_NHI_WIKI_DEF = { name: 'search_nhi_wiki', description: "Semantic + full-text search across Taiwan's official NHI Wiki (健保署全球資訊網), 9 categories: audit (審查)/drugs (藥品特材)/fees (費用)/plans (醫療計畫)/services (醫療服務)/insurance (投保)/forms (表單)/records (紀錄)/admin (行政). 8,232 chunks with vector embeddings. Curated and indexed by OPDSTAR (https://opdstar.com).", inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Natural language query in Traditional Chinese or English, e.g. "慢性病連續處方箋天數上限"', }, category: { type: 'string', description: 'Optional category filter — narrows search to one of 9 NHI categories', enum: [...CATEGORIES], }, limit: { type: 'integer', description: 'Max results (1-10, default 5)', minimum: 1, maximum: 10, default: 5, }, }, required: ['query'], }, } as const; - src/tools/searchNhiWiki.ts:37-41 (schema)TypeScript interface for the tool's input arguments.
export interface SearchNhiWikiArgs { query: string; category?: string; limit?: number; } - src/types.ts:53-68 (schema)TypeScript interfaces for the response types: SearchWikiResult (query, category, count, results) and WikiHit (title, content, chunk_type, specialty, similarity, source URLs).
export interface WikiHit { title: string | null; content: string; chunk_type: string; specialty: string | null; similarity: number; source_url_nhi: string | null; source_url_opdstar: string; } export interface SearchWikiResult { query: string; category: string | null; count: number; results: WikiHit[]; } - src/index.ts:47-54 (registration)Registration of the tool in the ListTools handler; SEARCH_NHI_WIKI_DEF is included in the tools array.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ LOOKUP_REJECTION_CODE_DEF, GET_PROCEDURES_FOR_ICD_DEF, GET_INDICATOR_DEF, SEARCH_NHI_WIKI_DEF, ], }));