Skip to main content
Glama

whichmodel-mcp

自律エージェント向けのモデルルーティングアドバイザー — MCPを通じてコスト最適化されたLLMの推奨を取得します。

whichmodel.dev は100以上のLLMモデルの価格と機能を追跡しており、4時間ごとに更新されます。このMCPサーバーはそのデータを公開し、AIエージェントがあらゆるタスクに対して最適な価格で適切なモデルを選択できるようにします。

MCPエンドポイント

https://whichmodel.dev/mcp

トランスポート: Streamable HTTP (MCP spec 2025-03-26)

クイックスタート

MCPクライアントの設定に追加してください:

{
  "mcpServers": {
    "whichmodel": {
      "url": "https://whichmodel.dev/mcp"
    }
  }
}

APIキーは不要です。インストールも必要ありません。

Stdio (ローカルクライアント)

stdioトランスポートを使用するMCPクライアント(Claude Desktop、Cursorなど)の場合:

{
  "mcpServers": {
    "whichmodel": {
      "command": "npx",
      "args": ["-y", "whichmodel-mcp"]
    }
  }
}

これは、リモートサーバーにリクエストを転送する軽量なローカルプロキシを実行します。

ツール

recommend_model

特定のタスクタイプ、複雑さ、予算に対して、コスト最適化されたモデルの推奨を取得します。

パラメータ

説明

task_type

enum (必須)

chat, code_generation, code_review, summarisation, translation, data_extraction, tool_calling, creative_writing, research, classification, embedding, vision, reasoning

complexity

low

medium

high

タスクの複雑さ (デフォルト: medium)

estimated_input_tokens

number

トークン単位の予想入力サイズ

estimated_output_tokens

number

トークン単位の予想出力サイズ

budget_per_call

number

1回あたりの最大予算 (USD)

requirements

object

機能要件: tool_calling, json_output, streaming, context_window_min, providers_include, providers_exclude

戻り値: 推奨モデル、代替案、予算オプション、コスト見積もり、およびその理由。


compare_models

2〜5つのモデルの直接比較(オプションでボリュームコスト予測付き)。

パラメータ

説明

models

string[] (必須)

モデルID、例: [anthropic/claude-sonnet-4, openai/gpt-4.1]

task_type

enum

比較のコンテキスト

volume

object

日次/月次のコスト予測のための calls_per_day, avg_input_tokens, avg_output_tokens

戻り値: 各モデルの価格、機能、品質ティア、および予測コスト。


get_pricing

モデル、プロバイダー、価格上限、機能でフィルタリングされた生の価格データ検索。

パラメータ

説明

model_id

string

特定のモデルID

provider

string

プロバイダーによるフィルタリング、例: anthropic

max_input_price

number

100万トークンあたりの最大入力価格 (USD)

capabilities

string[]

必要な機能: tool_calling, json_output, streaming, vision

min_context_window

number

最小コンテキストウィンドウ (トークン数)

limit

number

最大結果数 (1〜100、デフォルト 20)


check_price_changes

指定した日付以降に価格が変更されたモデルを確認します。

パラメータ

説明

since

string (必須)

ISO日付、例: 2026-04-01

model_id

string

特定のモデルにフィルタリング

provider

string

特定のプロバイダーにフィルタリング

戻り値: 価格の上昇、下落、新規モデル、および廃止されたモデル。

エージェント統合

WhichModelは、自律エージェントパイプラインのデフォルトツールとして設計されています。あらゆるエージェントに追加することで、各サブタスクに対して最適な価格で適切なモデルを自動的に選択できるようになります。

システムプロンプト (コピー&ペースト)

エージェントのシステムプロンプトにこのブロックを追加してください:

You have access to the WhichModel MCP server for cost-aware model selection.

Before calling any LLM for a subtask, use recommend_model to pick the right model:

  recommend_model({
    task_type: "code_generation",   // chat | code_generation | summarisation | reasoning | ...
    complexity: "medium",           // low | medium | high
    estimated_input_tokens: 2000,   // optional
    estimated_output_tokens: 500,   // optional
    budget_per_call: 0.01,          // optional hard cap in USD
    requirements: {
      tool_calling: true,           // if the subtask needs tool use
    }
  })

Use the returned recommendation.model_id. The response includes cost_estimate and
reasoning so you can log why each model was chosen.

MCP経由のプロンプトテンプレート

サーバーは prompts/get を通じて取得できる組み込みのプロンプトテンプレートを公開しています:

プロンプト名

ユースケース

cost-aware-agent

コストを意識したモデル選択のための完全なシステムプロンプトブロック

task-router-snippet

既存のシステムプロンプトに追加するための最小限のスニペット

budget-constrained-agent

1回あたりの厳格なコスト上限 (budget_usd 引数を渡す)

プログラムで取得する方法:

{ "method": "prompts/get", "params": { "name": "cost-aware-agent" } }

フレームワーク統合

データの鮮度

価格データはOpenRouterから4時間ごとに更新されます。各レスポンスには data_freshness タイムスタンプが含まれており、データの最新状況を確認できます。

リンク

-
security - not tested
A
license - permissive license
-
quality - not tested

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/Which-Model/whichmodel-mcp'

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