Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language query in Traditional Chinese or English, e.g. "慢性病連續處方箋天數上限"
categoryNoOptional category filter — narrows search to one of 9 NHI categories
limitNoMax results (1-10, default 5)

Implementation Reference

  • 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;
    }
  • 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;
  • TypeScript interface for the tool's input arguments.
    export interface SearchNhiWikiArgs {
      query: string;
      category?: string;
      limit?: number;
    }
  • 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,
      ],
    }));
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses the search type (semantic+full-text), source, curation by OPDSTAR, and number of chunks. However, it does not address read-only behavior, permissions, or any potential side effects, which is acceptable for a search tool but leaves minor gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense sentence that packs key information (search type, source, categories, chunk count, curator) without waste. It is front-loaded with the main action. However, it could be slightly more structured (e.g., bullet points) for readability, but it remains efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (semantic search across categories with a curated corpus), the description covers essential context: search type, source, categories, data volume, and curator. No output schema is needed since it's a search tool; the description is thorough enough for an agent to understand what to expect.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds value by specifying the natural language query style and language support (Traditional Chinese or English) and listing the 9 categories from the enum, but this is not substantial beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it performs 'Semantic + full-text search' across a specific resource (Taiwan's official NHI Wiki) and lists 9 categories, making the verb and resource explicit. It distinguishes itself from siblings which are lookup tools for indicators, procedures, and rejection codes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus sibling tools or when not to use it. The description implies it's for searching the NHI Wiki but does not provide exclusions or alternatives, leaving the agent to infer usage without comparative context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tatsuju/opdstar-nhi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server