| ツール | 機能 |
|---|---|
optimize_prompt | Optimize a prompt with deterministic, verified transforms (duplicates, filler, optional sections). Every candidate is checked to preserve all sentences, requirements, code, and variables; the original is kept if nothing is better. Returns the selected prompt, token savings, quality score, and what changed. |
optimize_prompt_pipeline | Run the optimization pipeline and return per-stage results plus token and estimated cost metrics, in the result shape used by the PromptFlow VS Code extension. |
compress_prompt | Remove exact duplicate sentences and extra whitespace without rewriting any wording. |
validate_prompt | Check a prompt for missing objective or output format, ambiguity, conflicting instructions, duplicates, prompt-injection patterns, secrets, and undelimited variables. isValid is false only when a critical issue exists. |
estimate_tokens | Count tokens and estimate input cost for a model. "exact" is true only for OpenAI models with a loaded tokenizer; other providers are approximate. Costs are estimates from a reference price table. |
analyze_prompt | Detect intent, task type, technical domain, requested output, requirements, and entities (languages, frameworks, file paths, identifiers). |
extract_entities | Extract languages, frameworks, libraries, cloud platforms, services, technologies, file paths, identifiers, URLs, and commands. |
summarize_context | Extractive summary: the first N unique, non-empty sentences of a context block, in order. Does not rank or rewrite. |
score_prompt | Score prompt quality 0-100: 100 minus a penalty per issue (critical 30, warning 10, info 3; capped at 50 with any critical issue), with per-dimension scores and suggestions. |
evaluate_prompt | Full quality report: overall score, grade, eight quality dimensions with the checks that failed, and every finding with why it matters and how to fix it. |
compare_prompts | Compare two prompts: token and estimated cost delta, quality delta per dimension, and which findings were resolved or introduced. |
scan_prompt_security | Prompt-injection risk (0-100, signature-based, with threat ids), sensitive-data counts by category, undelimited template variables, and destructive operations. Never returns detected secret values. |
scan_sensitive_data | Scan text for credentials, cloud secrets, and PII with local deterministic detectors. Returns offsets and per-category counts, never the sensitive values. |
sanitize_prompt | Replace detected sensitive data with placeholders such as [REDACTED_API_KEY]. Returns the sanitized text and counts, never the original values. Use before sending a prompt to an external model. |
restructure_prompt | Turn a loosely written request into a sectioned engineering prompt: Role, Objective, Context, Requirements, Constraints, Edge cases, Testing, Acceptance criteria, Expected output. Only sections with content appear. The author's clauses are kept and reordered; for software tasks, fixed engineering guidance chosen by intent and topic is added, and every line is labeled "prompt" or "engine" so additions can be reviewed. Set scaffold=false to reorganize without adding guidance. |
convert_structured_payload | Convert a JSON payload to TOON (Token-Oriented Object Notation) and say whether to use it. Returns token counts for pretty JSON, compact JSON and TOON, a round-trip check (the TOON must decode back to the same value), and the recommendation: "toon" only when it round-trips and saves at least 5 % over compact JSON, otherwise "json". Lossless or it keeps JSON. |
simulate_cost | Simulate what a prompt costs across models at a request volume, from catalog list prices (labelled simulated, never a bill). Optionally optimizes the prompt first and reports hypothetical savings. Flags models whose context window is too small. |
analyze_context_budget | Measure the context sources you intend to send with a prompt: tokens and share per source, context-window usage with an output reserve, sensitive data (categories and counts only), instruction-like text in retrieved sources, and duplicates. Reads only the text passed in; never reads files. |
run_prompt_tests | Run a regression suite against a prompt. Assertions check the prompt (contains, not_contains, matches, max_tokens, min_quality, no_finding, max_severity, has_variables, max_injection_risk, no_sensitive_data, output_format) and, when a case carries a recorded model response, the response (response_valid_json, response_has_keys, response_contains, response_max_chars). With baseline_prompt, also runs the suite on the baseline and lists cases that regressed. No model is called. |
エージェント連携
プロンプト分析のための MCP サーバー
PromptFlowEngine を AI エージェントや MCP 対応ワークフローと接続します。アシスタントは自分の作業の一ステップとして、プロンプトを分析、再構成、最適化、sanitize できます。
- stdio トランスポート
- 読み取り専用ツール
- ソースからビルド
できること
Model Context Protocol は、AI アプリケーションが外部ツールを呼び出すための標準的な方法です。PromptFlowEngine にはエンジンをツールとして公開する MCP サーバーが付属しているため、GitHub Copilot、Claude Desktop、Claude Code、Cursor、あるいは独自のクライアントのエージェントから、専用の連携コードなしで使えます。
サーバーはクライアントの子プロセスとしてマシン上で動作し、stdio 経由の JSON-RPC で通信します。受け取った引数だけを読み、ネットワーク呼び出しは行わず、ファイルやシェルのツールも持ちません。すべてのツールに、読み取り専用かつ冪等であるというアノテーションが付いています。
ホストされたエンドポイントも、設定すべき認証もありません。npm パッケージはまだ公開していないため、リポジトリからサーバーをビルドし、クライアントにビルドしたファイルを指定します。リモートから使う場合は HTTP API を呼び出してください。
実例
エージェントが使えるツール
この一覧は、ページのビルド時にサーバー自身のツールレジストリから生成しているため、クライアントが接続後に見る内容と一致します。 エンジンの検出結果と生成されたプロンプトは、エンジンと API が返すとおり英語で表示されます。
{
"servers": {
"promptflow": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/checkout/packages/mcp-server/dist/bin.js"]
}
}
}Use promptflow to restructure this before you start:
"fix login issue and make google login work and don't break anything"ツールは 19 個で、すべて読み取り専用です。他のクライアントでも、mcpServers キーの下に同じコマンドを記述します。
主なメリット
ひとつの設定で多数のクライアント
同じサーバー設定が、stdio の MCP サーバーに対応したどのクライアントでも使えます。
エージェントに渡しても安全
ファイル、シェル、ネットワークへのアクセスがないため、プロンプトインジェクションを受けたエージェントでも、これを使ってどこかに到達することはできません。
決定論的な結果
同じ引数でツールを 2 回呼び出せば、同じ答えが返ります。
エージェントが対処できるエラー
不正な引数には理由付きのツールエラーを返すので、エージェントは修正して再試行できます。
機能
プロンプトツール
分析、検証、最適化、再構成、比較、トークン見積もり、スキャン、sanitize。
リソース
ルールカタログとモデルカタログを MCP リソースとして読み取れます。
レビュー用プロンプト
組み込みの MCP プロンプトが、データとして渡されたプロンプトの評価と最適化をアシスタントに依頼します。
サイズ制限
引数ごとに受け付ける文字数の上限を設定できます。
内容を残さないログ
デバッグログに記録するのはツール名、入力サイズ、結果、所要時間だけで、テキストは記録しません。
VS Code に同梱
VS Code 拡張機能が、有効化時にサーバーを自動で登録します。
対象ユーザー
- コーディングエージェントを使う開発者ファイルの編集を始める前に、エージェントに曖昧なタスクを仕様へと再構成させられます。
- エージェントを構築する人サブエージェントや他のモデル向けに書いたプロンプトを、エージェントが決定論的にチェック・sanitize できるようにします。
- MCP で標準化を進めるチームサーバー設定をひとつ追加するだけで、すべての MCP クライアントにプロンプト品質チェックと秘密情報検出を加えられます。
活用例
- 01
コーディングの前に仕様を固める
まず promptflow でタスクを再構成し、その受け入れ基準に沿って実装するようエージェントに依頼します。
- 02
委任する前に sanitize する
オーケストレーターのエージェントに、他のモデルやツールへ渡す前のコンテキストを sanitize させます。
- 03
生成されたプロンプトをチェックする
エージェントがサブタスク用のプロンプトを書いたら、それを検証し、重大な検出結果を自動で修正します。
- 04
トークンを予算化する
どれだけのコンテキストを含めるか決める前に、下書きのトークン数をエージェントに見積もらせます。
よくある質問
MCP サーバーとは何ですか?
MCP サーバーは、Model Context Protocol を通じて AI アプリケーションにツール、リソース、プロンプトを提供するプログラムです。クライアントと呼ばれる AI アプリケーションが、それらをいつ呼び出すかを判断します。
どの MCP クライアントで使えますか?
ローカルの stdio サーバーを起動できるクライアントなら、どれでも使えます。VS Code の GitHub Copilot エージェントモード、Claude Desktop、Claude Code、Cursor などです。
ホストされた MCP エンドポイントやリモートのエンドポイントはありますか?
いいえ。トランスポートは stdio のみで、サーバーはあなたのマシン上で動作します。リモートからアクセスする場合は HTTP API を使ってください。
サーバーは自分のファイルを読めますか?
いいえ。ファイル、シェル、ネットワークのツールはありません。処理するのは、ツールに引数として渡されたテキストだけです。
PromptFlowEngine の関連機能
すべての製品が同じエンジンで動くので、組み合わせても予想外の違いは生じません。
背景にある手法を学ぶ
この製品が応用している考え方を解説した、プロンプトエンジニアリング ナレッジセンターのガイドです。