mcpField
D
drug-labels-search

drug-labels-search

github.com/yorkeccak生産性64134 回インストール3 週間前に更新
リポジトリ

drug-labels-search について

drug-labels-searchは、自然言語でFDAの医薬品ラベルを検索するコマンドラインスキルです。Valyuのセマンティック検索で、用量、警告、副作用を含むラベル情報を取得できます。

主な機能

  1. 01自然言語によるセマンティック検索
  2. 02FDAラベル情報の全文取得
  3. 03用量と警告の詳細
  4. 04利用可能な場合の画像リンク
  5. 05CLIからのJSON出力

活用シーン

  1. 01公式の適応症の確認
  2. 02禁忌と警告の確認
  3. 03用量ガイダンスの検索
  4. 04薬物相互作用の調査

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/yorkeccak/scientific-skills --skill drug-labels-search

インストール後、Claude Code で/drug-labels-searchを入力して読み込まれたか確認します。

同梱ファイルscripts/searchscripts/search.mjs

詳細

医薬品ラベル検索

Valyu のセマンティック検索 API を利用した自然言語クエリで、処方情報、警告、公式ラベルを含む FDA 医薬品ラベルデータベース全体を検索します。

このスキルが強力な理由

  • API パラメーターの解析が不要:自然言語のクエリをそのまま渡すだけです。複雑な検索パラメーターを組み立てる必要はありません
  • セマンティック検索:キーワードの一致だけでなく、クエリの意味を理解します
  • 全文にアクセス:適応症、用量、警告、副作用を含む医薬品ラベル情報全体を取得します
  • 画像リンク:利用可能な場合はラベル画像も含まれます
  • 幅広い網羅性:すべての FDA 医薬品ラベルデータにアクセスできます

要件

  1. Node.js 18 以降(組み込みの fetch を使用)
  2. Valyu API キー(https://platform.valyu.ai で取得できます。10 ドル分の無料クレジット付き)

重要:スクリプトパスの解決

このドキュメントに記載されている scripts/search コマンドは、このスキルのインストールディレクトリからの相対パスです。

コマンドを実行する前に、次の方法でスクリプトの場所を確認してください。

DRUG_LABELS_SCRIPT=$(find ~/.claude/plugins/cache -name "search" -path "*/drug-labels-search/*/scripts/*" -type f 2>/dev/null | head -1)

次に、すべてのコマンドでフルパスを使用します。

$DRUG_LABELS_SCRIPT "ibuprofen warnings" 15

API キーの設定手順

検索を実行して "setup_required": true が返された場合は、次の手順に従ってください。

  1. ユーザーに API キーを求めます: 「FDA 医薬品ラベルを検索するには、Valyu API キーが必要です。https://platform.valyu.ai で無料の API キーを取得してください(10 ドル分のクレジット付き)。」

  2. ユーザーからキーが提供されたら、次を実行します:

    scripts/search setup <api-key>
    
  3. 元の検索を再試行します。

このスキルを使用する場面

  • FDA 公式の医薬品情報と適応症
  • 禁忌と警告
  • 用法・用量に関するガイダンス
  • 臨床薬理データ
  • 薬物相互作用に関する情報
  • 副作用と安全性モニタリング

出力形式

{
  "success": true,
  "type": "drug_labels_search",
  "query": "ibuprofen warnings",
  "result_count": 10,
  "results": [
    {
      "title": "Drug Label Title",
      "url": "https://fda.gov/...",
      "content": "Label content, warnings, dosing...",
      "source": "drug-labels",
      "relevance_score": 0.95,
      "images": ["https://example.com/label.jpg"]
    }
  ],
  "cost": 0.025
}

結果の処理

jq を使用する場合
# Get drug names
scripts/search "query" 10 | jq -r '.results[].title'

# Get URLs
scripts/search "query" 10 | jq -r '.results[].url'

# Extract full content
scripts/search "query" 10 | jq -r '.results[].content'

よくあるユースケース

安全性情報
# Find safety data
scripts/search "anticoagulant bleeding risk warnings" 50
処方に関するガイダンス
# Search for dosing
scripts/search "pediatric dosing guidelines for antibiotics" 20
薬物相互作用
# Find interaction data
scripts/search "CYP450 drug interaction warnings" 15
規制情報
# Search for approval data
scripts/search "accelerated approval indications oncology" 25

エラー処理

すべてのコマンドは success フィールドを含む JSON を返します。

{
  "success": false,
  "error": "Error message"
}

終了コード:

  • 0 - 成功
  • 1 - エラー(詳細は JSON を確認してください)

API エンドポイント

  • ベース URL:https://api.valyu.ai/v1
  • エンドポイント:/search
  • 認証:X-API-Key ヘッダー

アーキテクチャ

scripts/
├── search          # Bash wrapper
└── search.mjs      # Node.js CLI

Node.js に組み込まれた fetch() を使って API を直接呼び出します。外部依存関係はありません。

プロジェクトへの追加

AI プロジェクトを構築していて、Drug Labels Search をアプリケーションに直接統合する場合は、Valyu SDK を使用してください。

Python との統合
from valyu import Valyu

client = Valyu(api_key="your-api-key")

response = client.search(
    query="your search query here",
    included_sources=["valyu/valyu-drug-labels"],
    max_results=20
)

for result in response["results"]:
    print(f"Title: {result['title']}")
    print(f"URL: {result['url']}")
    print(f"Content: {result['content'][:500]}...")
TypeScript との統合
import { Valyu } from "valyu-js";

const client = new Valyu("your-api-key");

const response = await client.search({
  query: "your search query here",
  includedSources: ["valyu/valyu-drug-labels"],
  maxResults: 20
});

response.results.forEach((result) => {
  console.log(`Title: ${result.title}`);
  console.log(`URL: ${result.url}`);
  console.log(`Content: ${result.content.substring(0, 500)}...`);
});

統合例と SDK リファレンスについては、Valyu のドキュメントをご覧ください。

コメント