summaryrefslogtreecommitdiff
path: root/src/ollama_web/static/tools.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ollama_web/static/tools.js')
-rw-r--r--src/ollama_web/static/tools.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ollama_web/static/tools.js b/src/ollama_web/static/tools.js
index b15587e..59d5c02 100644
--- a/src/ollama_web/static/tools.js
+++ b/src/ollama_web/static/tools.js
@@ -6,3 +6,14 @@ window.TOOLS = [
{ name: "search_and_fetch", label: "ファイル検索・取得" },
{ name: "pdf_to_text", label: "PDFテキスト変換" },
];
+
+window.toolLabel = function toolLabel(name) {
+ const builtin = window.TOOLS.find((t) => t.name === name);
+ if (builtin) return builtin.label;
+
+ const mcpMatch = /^mcp__([^_]+)__(.+)$/.exec(name);
+ if (mcpMatch) {
+ return `${mcpMatch[2]} (${mcpMatch[1]})`;
+ }
+ return name;
+};