Skip to main content
Glama

semantic_search_tools

Matches a plain-language query to the relevant J-Link tools using vector embeddings, so AI models call only what they need and use fewer tokens.

Instructions

Semantic Search Tools - Recommend relevant tools based on natural language query / 语义搜索工具 - 根据自然语言查询推荐相关工具.

Uses vector embedding technology to intelligently match user queries with available tools. 使用向量嵌入技术,智能匹配用户查询与可用工具。

This can significantly reduce AI model token consumption (expected 95-99% savings). 可以大幅减少 AI 模型的 Token 消耗(预期节省 95-99%)。

Examples / 示例: - "如何读取寄存器?" (How to read registers?) → Returns read_registers, read_register_with_fields - "如何烧录固件?" (How to flash firmware?) → Returns erase_flash, program_flash, verify_flash - "如何查看实时日志?" (How to view real-time logs?) → Returns rtt_start, rtt_read - "read memory" → Returns read_memory, read_registers - "connect to device" → Returns connect_device, list_jlink_devices

Args: query: User query in natural language (Chinese or English) / 用户自然语言查询(中文或英文) top_k: Number of tools to return (default: 3, range: 1-10) / 返回工具数量(默认:3,范围:1-10) threshold: Similarity threshold (default: 0.5, range: 0-1) / 相似度阈值(默认:0.5,范围:0-1)

Returns: Search results containing relevant tools with scores / 包含相关工具及分数的搜索结果

Notes: - This tool requires OpenAI API key to be configured / 此工具需要配置 OpenAI API Key - First search will generate embeddings for all tools (may take 1-2 seconds) / 首次搜索将为所有工具生成嵌入(可能需要 1-2 秒) - Subsequent searches will be fast (<50ms) due to caching / 后续搜索将很快(<50ms),因为缓存 - Supports both Chinese and English queries / 支持中文和英文查询

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "semantic_search_tools"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYes
top_kNo
thresholdNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description does carry real behavioral weight: it discloses the OpenAI API key prerequisite, a 1-2s cold-start embedding cost and sub-50ms cached latency, plus CN/EN query support. It does not say what happens when the key is absent (error vs. fallback), nor what is returned when no tool clears the threshold, which are the remaining failure modes an agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and the examples are the most useful part, but every sentence is duplicated in Chinese and English, and the "Returns" block restates what the existing output schema already declares. The core content would survive at roughly half the length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool-discovery search with an output schema present, the definition covers prerequisites, cold-start latency, parameter ranges, multilingual support and worked examples. The one meaningful omission is the empty/low-confidence result case, which matters for an agent deciding whether to trust a search outcome.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does: query is explained as natural-language Chinese or English, top_k as count with range 1-10, threshold as similarity with range 0-1. The value added is the ranges and the intent behind each parameter; the only gap is that threshold is not explained operationally (e.g. lower it to get more candidates).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Recommend relevant tools based on natural language query" states a specific verb and resource, and no sibling does this — the rest are concrete hardware/debug operations. The examples make the meta-tool role unmistakable, so an agent can tell instantly it is a tool-discovery entry point rather than a device action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The examples give concrete trigger utterances ("如何读取寄存器?", "read memory") and the token-savings note implies the alternative of loading the full catalog. What is missing is an explicit exclusion, e.g. "if you already know the exact tool name, call it directly rather than searching".

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.