You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cardea-tidb/cardea-tidb-mcp-server/src/tidb.rs
+39-2Lines changed: 39 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,42 @@ use rmcp::{
11
11
use std::{result::Result, sync::OnceLock};
12
12
use tracing::{error, info};
13
13
14
+
constPROMPT_SEARCH_TOOL:&str = r#"
15
+
You are a multilingual AI assistant. Your task is to (1) extract the most relevant and concise keywords or key phrases from the given user query, and (2) return a tool call that invokes the `search` tool with the extracted keywords.
16
+
17
+
### Requirements for keyword extraction
18
+
Follow these requirements strictly:
19
+
- Detect the language of the query automatically.
20
+
- Return 3 to 7 keywords or keyphrases that best represent the query's core intent.
21
+
- Keep the extracted keywords in the **original language** (do not translate).
22
+
- Include **multi-word expressions** if they convey meaningful concepts.
23
+
- **Avoid all types of stop words, question words, filler words, or overly generic terms**, such as:
24
+
- English: what, how, why, is, the, of, and, etc.
25
+
- Chinese: 什么、怎么、如何、是、的、了、吗、啊 等。
26
+
- Do **not** include punctuation or meaningless words.
27
+
- Only return the final keywords, separated by a **single space**.
28
+
29
+
Examples:
30
+
- Input: "What is the impact of artificial intelligence on education?"
31
+
Output: artificial intelligence education impact
32
+
- Input: "什么是人工智能对教育的影响?"
33
+
Output: 人工智能 教育 影响
34
+
35
+
### Requirements for tool call
36
+
- Return a tool call that invokes the `search` tool with the extracted keywords.
37
+
- For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
0 commit comments