Skip to main content
Glama
selvinchen97-lab

selvin-search-mcp

selvin-search-mcp

Selvin Search MCP 是一个面向 Codex 的本地联网搜索 MCP。它支持三种搜索链路:

模式

配置

搜索是谁做的

Sources 从哪里来

并行搜索模式

SELVIN_SEARCH_MODE=parallel

智谱 Web Search API + 支持联网能力的模型同时搜索

两条链路返回的来源合并去重

API 搜索模式

SELVIN_SEARCH_MODE=api

智谱 Web Search API

智谱 /web_search 返回的 search_result

模型联网模式

SELVIN_SEARCH_MODE=model_online

支持联网能力的模型自己搜索

模型回答中的 ## Sources 链接,由 MCP 解析

默认推荐 parallel 模式:MCP 会同时启动 API 搜索链路和模型内置联网链路;如果模型内置联网先返回有效内容,MCP 会取消尚未完成的 API 搜索。随后 MCP 会抓取模型内置联网返回的来源页面,解析正文并交给模型做最终整理。api 模式更可控,model_online 模式更依赖模型/平台自己的联网能力。

敏感配置

项目不在代码里保存 API Key,也不在代码里写死具体模型名。运行前创建本地 .env

cd selvin-search-mcp
cp .env.example .env

.env 已被 .gitignore 忽略,不应提交。仓库只保留 .env.example 作为模板。

配置优先级:

  1. 系统环境变量

  2. 项目根目录 .env

  3. 代码内非敏感默认值,例如 provider、search mode 和搜索参数

SELVIN_MODEL 是必填项;不配置模型名时 MCP 会返回配置错误。

Related MCP server: websearch-deepseek

模式 A:并行搜索模式

这个模式同时启动两条搜索路线,但模型内置联网链路优先:

用户问题
  -> 路线 1:智谱 Web Search API /web_search
  -> 路线 2:支持联网的模型 /chat/completions
  -> 如果路线 2 先返回有效内容,MCP 取消尚未完成的路线 1
  -> 如果路线 1 已经完成并有内容,MCP 同时保留两边结果
  -> MCP 要求模型联网回答返回 JSON:answer + sources[{title,url}]
  -> 如果路线 2 没有返回精确 URL,MCP 拒绝该路线的联网结果
  -> MCP 解析 JSON sources 中的 URL
  -> MCP 抓取这些来源页面,抽取正文并归档
  -> MCP 合并 API 来源、模型来源和归档正文
  -> 用户配置的模型基于归档内容和两边结果做最终整理
  -> MCP web_search 返回最终 answer + session_id
  -> MCP get_sources 返回合并后的来源列表和抓取状态

.env 示例:

SELVIN_PROVIDER=zhipu
SELVIN_SEARCH_MODE=parallel
SELVIN_API_URL=https://open.bigmodel.cn/api/paas/v4

SELVIN_API_KEY=<your-api-key>
# 或:
# ZHIPU_API_KEY=<your-api-key>

SELVIN_MODEL=<your-model-name>

ZHIPU_SEARCH_ENGINE=search_pro
ZHIPU_SEARCH_COUNT=5
ZHIPU_CONTENT_SIZE=high
ZHIPU_SEARCH_RECENCY_FILTER=noLimit
SELVIN_MAX_TOKENS=2600

SELVIN_API_CANCEL_GRACE_SECONDS=0.5
SELVIN_FETCH_ONLINE_SOURCES=true
SELVIN_FETCH_ONLINE_SOURCE_COUNT=5
SELVIN_FETCH_ONLINE_SOURCE_CHARS=3000
SELVIN_ONLINE_USE_SEARCH_TOOL=true

如果模型内置联网链路使用的是另一个 OpenAI-compatible 平台,可以单独覆盖:

SELVIN_ONLINE_API_URL=<openai-compatible-api-base-url>
SELVIN_ONLINE_API_KEY=<your-online-model-api-key>
SELVIN_ONLINE_MODEL=<online-capable-model-name>

判断是否真的联网:

  • API 路线:来源来自智谱 /web_searchsearch_result

  • 模型内置路线:智谱/BigModel 默认通过 chat/completionstools.web_search 触发搜索;其他 OpenAI-compatible 平台默认不传该工具,除非显式设置 SELVIN_ONLINE_USE_SEARCH_TOOL=true

  • 模型内置路线必须返回 JSON,格式为 {"answer":"...","sources":[{"title":"...","url":"https://..."}],"error":""}

  • 如果模型内置路线没有返回精确 URL,MCP 会把它标记为失败,不进入网页抓取和归档

  • 模型内置路线返回的 URL 会被 MCP 再访问一次,成功时会写入 archive_status=fetchedarchive_content

  • get_sources(session_id) 返回的是两边来源合并去重后的列表

模式 B:API 搜索模式

这个模式先调用智谱 /web_search,拿到真实 search_result,再把搜索结果交给你配置的模型总结。

用户问题
  -> 智谱 Web Search API /web_search
  -> search_result 真实搜索结果
  -> 用户配置的模型总结
  -> MCP web_search 返回 answer + session_id
  -> MCP get_sources 返回 search_result 来源列表

.env 示例:

SELVIN_PROVIDER=zhipu
SELVIN_SEARCH_MODE=api
SELVIN_API_URL=https://open.bigmodel.cn/api/paas/v4

SELVIN_API_KEY=<your-api-key>
# 或:
# ZHIPU_API_KEY=<your-api-key>

SELVIN_MODEL=<your-model-name>

ZHIPU_SEARCH_ENGINE=search_pro
ZHIPU_SEARCH_COUNT=5
ZHIPU_CONTENT_SIZE=high
ZHIPU_SEARCH_RECENCY_FILTER=noLimit
SELVIN_MAX_TOKENS=2600

判断是否真的联网:

  • web_search.sources_count > 0

  • get_sources(session_id).sources_countweb_search.sources_count 一致

  • 每条来源来自智谱 /web_searchsearch_result

模式 C:模型联网模式

这个模式不先调用搜索 API,而是直接调用一个支持联网能力的聊天模型。模型需要返回结构化 JSON,MCP 从 JSON 的 sources[].url 中读取来源链接。

用户问题
  -> 支持联网的模型 /chat/completions
  -> 模型自己搜索并返回 JSON:answer + sources[{title,url}]
  -> MCP 从 JSON 中解析 URL
  -> MCP 抓取 URL 页面并抽取正文
  -> MCP get_sources 返回解析后的来源列表

.env 示例:

SELVIN_PROVIDER=custom
SELVIN_SEARCH_MODE=model_online
SELVIN_API_URL=<openai-compatible-api-base-url>
SELVIN_API_KEY=<your-api-key>
SELVIN_MODEL=<online-capable-model-name>
SELVIN_MAX_TOKENS=2600

注意:

  • 这个模式要求你配置的模型/平台真的支持联网搜索。

  • 如果模型没有联网能力,它可能只能回答“无法访问实时网络”,或凭记忆回答。

  • 如果模型没有按 JSON 返回精确 URL,MCP 会拒绝该路线的结果。

  • MCP 会抓取模型返回的 URL 并尝试归档正文,但网页是否允许读取取决于目标网站。

当前已知问题

403 Forbidden

403 Forbidden 表示 MCP 已经访问到目标网站,但网站服务器拒绝返回页面内容。常见原因包括:

  • 网站禁止脚本或爬虫访问

  • 网站要求完整浏览器环境、Cookie、登录状态或 JavaScript 校验

  • 网站限制 User-Agent、IP、地区或访问频率

  • URL 指向的页面不存在公开内容,但服务器统一返回 403

当前 MCP 的网页读取方式是普通 HTTP 请求:

httpx GET URL
  -> 获取 HTML 或文本
  -> 去掉脚本、样式和标签
  -> 抽取正文

这种方式遇到 OpenAI、Cloudflare、防爬页面或需要 JS 渲染的页面时,可能只能得到 archive_status=failedarchive_error=403 Forbidden,无法写入 archive_content

后续可增强方向:

  • 增加更完整的浏览器请求头,例如 Accept-LanguageReferer、压缩支持等

  • 增加备用网页读取服务,例如网页转 Markdown 的 reader/proxy

  • 增加 Playwright/Chrome 渲染读取,处理需要 JavaScript 或 Cookie 的页面

  • 对官方文档类来源增加专门读取器或官方 API 读取器

archive_status=failed 时,最终回答应明确标记“来源 URL 存在,但页面正文未归档验证”,不能把模型摘要当作已完全验证的网页事实。

本地运行

uv run --project . selvin-search

Codex 配置模板

当前 README 只提供模板,不会自动修改你的 Codex 项目配置。测试通过后,可以把下面配置加入项目级 Codex 配置:

[mcp_servers.selvin-search]
command = "uv"
args = [
  "run",
  "--project",
  ".",
  "selvin-search"
]

如果你希望 Codex 不依赖 .env 文件,也可以把环境变量写入 Codex 配置,但不要把真实配置提交到公开仓库:

[mcp_servers.selvin-search.env]
SELVIN_PROVIDER = "zhipu"
SELVIN_SEARCH_MODE = "parallel"
SELVIN_API_URL = "https://open.bigmodel.cn/api/paas/v4"
SELVIN_API_KEY = "<your-api-key>"
SELVIN_MODEL = "<your-model-name>"
ZHIPU_SEARCH_ENGINE = "search_pro"
ZHIPU_SEARCH_COUNT = "5"
ZHIPU_CONTENT_SIZE = "high"
ZHIPU_SEARCH_RECENCY_FILTER = "noLimit"
SELVIN_MAX_TOKENS = "2600"

MCP 工具

根据 SELVIN_SEARCH_MODE 执行联网搜索。

常用参数:

参数

说明

query

要搜索的问题

platform

可选,追加到搜索词中用于聚焦平台或来源

model

可选,单次请求覆盖 SELVIN_MODEL

plan_session_id

可选,配合规划工具使用;留空表示直接搜索

返回字段:

字段

说明

session_id

后续传给 get_sources

content

基于搜索结果或模型联网搜索生成的回答

sources_count

MCP 解析出的来源数量

cached

是否命中本进程缓存

get_sources

使用 web_search 返回的 session_id 获取来源列表。

get_config_info

返回当前配置,并做一次连通性测试:

  • parallel 模式:同时请求 {SELVIN_API_URL}/web_search 和在线模型接口的 /models

  • api 模式:请求 {SELVIN_API_URL}/web_search

  • model_online 模式:请求 {SELVIN_API_URL}/models

API Key 会被遮罩显示。

switch_model

持久化切换总结模型。更推荐通过 .env 管理模型名;只有需要运行时临时切换时才使用这个工具。

文件与缓存位置

类型

路径

项目目录

当前仓库根目录

Python 包

src/selvin_search

本地环境变量

.env

环境变量模板

.env.example

配置文件

~/.config/selvin-search/config.json

日志目录

~/.config/selvin-search/logs

规划会话

~/.config/selvin-search/sessions

快速验证

编译检查:

uv run --project . python -m py_compile \
  src/selvin_search/config.py \
  src/selvin_search/server.py \
  src/selvin_search/providers/zhipu.py \
  src/selvin_search/providers/model_online.py

配置读取检查:

uv run --project . python -c \
'from selvin_search.config import config; print(config.provider); print(config.search_mode); print(config.api_url); print(config.model)'

预期输出应显示:

<your-provider>
<parallel|api|model_online>
<your-api-url>
<your-model-name>

如果 .env 未配置 API Key 或模型名,会看到明确的配置错误。

注意事项

  • parallel 模式会合并 API 搜索和模型内置搜索的来源,最终回答由模型再次整理。

  • api 模式的 sources 更可控,因为它们来自搜索接口的结构化结果。

  • model_online 模式依赖模型和平台自己的联网能力。

  • 如果中文查询召回为 0,可以换成中英混合查询。

  • sources_count = 0 时,表示本次没有独立联网来源,不应把回答当作已验证结论。

Available Tools

10 tools
get_config_infoA
Returns current Selvin Search MCP server configuration and tests the configured upstream connectivity.

**Key Features:**
    - **Configuration Check:** Verifies environment variables and current settings.
    - **Connection Test:** Sends request to /web_search in api mode, /models in model_online mode, or both in parallel mode.

**Edge Cases & Best Practices:**
    - Use this tool first when debugging connection or configuration issues.
    - API keys are automatically masked for security in the response.
    - Connection test timeout is 10 seconds; network issues may cause delays.
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.6/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden. It discloses configuration retrieval, connection testing, API key masking, and a 10-second timeout. However, it does not describe failure modes or response structure in detail.

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

Conciseness5/5

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

The description is concise, well-structured with bullet points, and front-loaded with the main purpose. Every sentence adds value without redundancy.

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?

Given no parameters, output schema, or annotations, the description covers the tool's main functions and security. It could be more informative about error handling or response format, but it is largely complete for its purpose.

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?

There are no parameters, and schema coverage is 100%. The description adds value by explaining what the tool does beyond the empty schema, contextualizing its purpose and behavior.

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?

The description clearly states the tool returns the current server configuration and tests upstream connectivity, using specific verbs and resources. It distinguishes itself from sibling tools like web_search or get_sources by focusing on diagnostics.

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

Usage Guidelines5/5

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

Explicit guidance: 'Use this tool first when debugging connection or configuration issues.' This tells the agent exactly when to invoke it, along with edge cases and best practices.

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

get_sourcesB
When you feel confused or curious about the search response content, use the session_id returned by web_search to invoke the this tool to obtain the corresponding list of information sources.
Retrieve all cached sources for a previous web_search call.
Provide the session_id returned by web_search to get the full source list.
ParametersJSON Schema
NameRequiredDescriptionDefault
session_idYesSession ID from previous web_search call.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It conveys this is a read-only retrieval of cached sources, which is inherently safe, and hints that data persists ('cached'). It does not mention what happens for invalid/expired session_ids, auth requirements, or pagination, but for a simple retrieval tool the basic safety profile is adequately conveyed.

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

Conciseness2/5

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

The description is highly repetitive — three sentences effectively say the same thing: use the web_search session_id to get the source list. It also contains a typo ('invoke the this tool'). A single crisp sentence ('Retrieve all cached sources for a prior web_search call using its session_id.') would carry the full meaning. The redundant first sentence should be cut.

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?

An output schema exists, so the return format is covered externally. For a low-complexity tool with a single required parameter, the description adequately covers when to use it (after web_search) and what it returns (the full source list). The main gaps — error behavior for invalid sessions and any filtering/ordering — are minor given the tool's simplicity.

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

Parameters3/5

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

Schema coverage is 100% — the schema already documents session_id as 'Session ID from previous web_search call.' The description reinforces that the ID must come from web_search, adding marginal provenance context, but it does not add meaningful syntax or format details beyond what the schema provides. Baseline 3 is appropriate.

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

Purpose4/5

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

The core purpose is clear: 'Retrieve all cached sources for a previous web_search call' states a specific verb and resource, and ties the tool to the web_search sibling via session_id. However, the opening sentence uses odd emotional framing ('When you feel confused or curious...') which muddies the definition rather than clarifying it. The purpose is distinguishable from siblings like web_fetch and web_map because it targets cached search sources.

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

Usage Guidelines3/5

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

The description gives useful context: the tool is invoked with a session_id returned by a prior web_search call, so it is clearly a follow-up to web_search. However, it never states when NOT to use it or names alternatives (e.g., web_fetch for fetching actual page content). The 'confused or curious' trigger is too vague to be actionable guidance.

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

plan_complexityA

Phase 2: Assess search complexity (1-3). Controls required phases: Level 1 = phases 1-3; Level 2 = phases 1-5; Level 3 = all 6.

ParametersJSON Schema
NameRequiredDescriptionDefault
levelYesComplexity 1-3
thoughtYesReasoning for complexity assessment
confidenceNoConfidence 0.0-1.0
session_idYesSession ID from plan_intent
is_revisionNoTrue to overwrite
justificationYesWhy this complexity level
estimated_tool_callsYesExpected total tool calls
estimated_sub_queriesYesExpected number of sub-queries

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses a key behavioral trait: the level controls which phases run. However, it does not mention side effects like storing plan state, requiring a session_id from plan_intent, or the ability to overwrite via is_revision. These gaps prevent a higher score.

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

Conciseness5/5

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

Two short sentences with zero waste. The phase identification is front-loaded, and the level-to-phase mapping is stated concisely. Every word earns its place.

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

Completeness3/5

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

Given 8 parameters, no outputs schema, and no annotations, the description is incomplete. It explains the level's impact but does not describe the tool's return value, the requirement for a prior plan_intent session, or how downstream tools use this output. The phase mapping is useful but not sufficient for full contextual understanding.

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 coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by explaining the level parameter's effect on phases (Level 1 = phases 1-3, etc.). This is valuable semantic content not present in the schema's simple 'Complexity 1-3'. Other parameters remain adequately documented by the schema.

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?

The description clearly states the verb 'Assess' and resource 'search complexity' with an explicit range (1-3). It also identifies itself as 'Phase 2', which differentiates it from sibling tools like plan_intent (Phase 1) and plan_execution (later phase). The mapping of levels to phases adds specificity.

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 description provides clear context by labeling this as 'Phase 2' and explaining that the level 'Controls required phases', implying when it should be called (after plan_intent) and its consequence. However, it does not explicitly mention when not to use it or name alternatives, so it falls short of a 5.

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

plan_executionC

Phase 6: Define execution order. parallel_groups: semicolon-separated groups of comma-separated IDs (e.g., 'sq1,sq2;sq3').

ParametersJSON Schema
NameRequiredDescriptionDefault
thoughtYesReasoning for execution order
confidenceNoConfidence 0.0-1.0
sequentialYesComma-separated IDs that must run in order
session_idYesSession ID from plan_intent
is_revisionNoTrue to overwrite
parallel_groupsYesParallel batches: 'sq1,sq2;sq3,sq4' (semicolon=groups, comma=IDs)
estimated_roundsYesEstimated execution rounds

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of disclosing behavioral traits. It explains the input format for parallel_groups but does not disclose side effects (e.g., whether this overwrites a previous plan when is_revision is true), requirements like authentication, or what the tool does after defining the order. The description is purely about the input syntax, not the behavior.

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

Conciseness5/5

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

The description is a single sentence with zero wasted words. It leads with the purpose ('Phase 6: Define execution order') and immediately provides the critical formatting detail for parallel_groups. The example is compact and directly relevant. This is an appropriately sized, front-loaded description.

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

Completeness2/5

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

Given the tool has no output schema and no annotations, the description leaves out essential context: what the tool returns, prerequisites (like the session_id provenance), and how this fits into the broader planning flow. It only explains the input format, which is insufficient for an agent to safely and correctly call it without additional assumptions.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all seven parameters. The description adds a slightly different example ('sq1,sq2;sq3' vs the schema's 'sq1,sq2;sq3,sq4') and restates the semicolon/comma rule, but this is marginal added information. Since the baseline with full coverage is 3, the description meets it but does not elevate beyond the schema.

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

Purpose4/5

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

The description states a clear verb and resource: 'Define execution order' and identifies it as 'Phase 6' of a planning process. It provides a concrete format example for parallel_groups, which makes the purpose unambiguous. However, it does not explicitly differentiate from sibling tools like plan_tool_mapping or plan_sub_query; the distinction is only implied by the 'Phase 6' context.

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

Usage Guidelines2/5

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

The description gives no explicit guidance on when to use this tool versus alternatives. It does not state preconditions (e.g., 'requires a session_id from plan_intent') or any exclusions. The 'Phase 6' label implies a sequential step, but there is no mention of when this should be invoked or what situations call for a revision.

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

plan_intentA
Phase 1 of search planning: Analyze user intent. Call this FIRST to create a session.
Returns session_id for subsequent phases. Required flow:
plan_intent → plan_complexity → plan_sub_query(×N) → plan_search_term(×N) → plan_tool_mapping(×N) → plan_execution

Required phases depend on complexity: Level 1 = phases 1-3; Level 2 = phases 1-5; Level 3 = all 6.
ParametersJSON Schema
NameRequiredDescriptionDefault
domainNoSpecific domain if identifiable
thoughtYesReasoning for this phase
confidenceNoConfidence 0.0-1.0
query_typeYesfactual | comparative | exploratory | analytical
session_idNoEmpty for new session, or existing ID to revise
ambiguitiesNoComma-separated unresolved ambiguities
is_revisionNoTrue to overwrite existing intent
core_questionYesDistilled core question in one sentence
premise_validNoFalse if the question contains a flawed assumption
time_sensitivityYesrealtime | recent | historical | irrelevant
unverified_termsNoComma-separated external terms to verify

TDQS

A4.2/5.0
Behavior3/5

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

Annotations are absent, so the description must carry the burden. It states it creates a session and returns session_id, but does not disclose side effects such as overwriting existing intent (though the is_revision parameter exists in the schema). The description doesn't mention idempotency, revision behavior, or any destructive implications. It's adequate but not fully transparent.

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

Conciseness5/5

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

The description is compact yet information-dense. It front-loads the purpose in the first sentence, then presents the pipeline flow and complexity rules in a clear, scannable format. There is zero redundancy; every sentence contributes necessary context.

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?

Given the tool's role in a multi-phase pipeline, the description covers the essential context: it is the entry point, it returns session_id, and it specifies the full flow and complexity-based phase requirements. It does not address the revision use case (session_id revision) that the schema supports, but the schema covers that. Overall it is complete for the typical agent workflow.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description does not add any parameter-specific meaning beyond what the schema already documents. It doesn't mention any of the input fields (thought, core_question, query_type, etc.) or their roles. Thus it adds no extra value over the schema.

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?

The description states the exact purpose: 'Phase 1 of search planning: Analyze user intent' and that it creates a session and returns session_id. It clearly differentiates from sibling tools by being explicitly 'FIRST' in the required flow, which is listed. This is specific and unambiguous.

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

Usage Guidelines5/5

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

It explicitly says 'Call this FIRST to create a session' and provides the full required flow (plan_intent → plan_complexity → ...). It also gives conditional guidance based on complexity levels (Level 1, 2, 3), which tells the agent when to expect which subsequent phases. This is clear usage guidance with no ambiguity.

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

plan_search_termA

Phase 4: Submit ALL search terms in ONE call (batch).

terms_json: JSON array, each element shape: {"term":"react server components 2025","purpose":"sq1","round":1}

Strict rules (enforced):

  • term MUST be ≤8 words (engine rejects otherwise)

  • purpose MUST reference a declared sub-query id

  • one term per (purpose, round); add multiple rounds for follow-up refinement

approach (broad_first | narrow_first | targeted) and fallback_plan are strategy-level; pass them as top-level params, not inside terms.

ParametersJSON Schema
NameRequiredDescriptionDefault
thoughtYesReasoning for the full strategy
approachNobroad_first | narrow_first | targetedtargeted
confidenceNoConfidence 0.0-1.0
session_idYesSession ID from plan_intent
terms_jsonYesJSON array of search-term objects (see description)
is_revisionNoTrue to replace prior strategy
fallback_planNoFallback if primary searches fail

TDQS

A3.7/5.0
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses key behavioral constraints (term length, purpose reference, one term per purpose/round) and clarifies that approach and fallback_plan are strategy-level. Some behaviors like error handling or side effects are absent, but the description is sufficiently transparent given the complexity.

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

Conciseness4/5

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

The description is concise: a one-line summary followed by structured bullets. It front-loads the main purpose and delivers key rules efficiently. No unnecessary words or repetition.

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

Completeness3/5

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

The description thoroughly covers the core parameter (terms_json) but does not explain the purpose of other parameters like thought, confidence, or is_revision beyond what the schema provides. Given the tool's role in a workflow, some of these may be self-explanatory, but the description could add more context.

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 coverage is 100%, so baseline is 3. The description adds value by specifying the exact shape of terms_json (object with term, purpose, round) and rules. It also clarifies that approach and fallback_plan are top-level params, not inside terms.

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

Purpose4/5

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

The description clearly states the tool's purpose: submit all search terms in one batch call (Phase 4). It uses specific verbs and resources, but does not explicitly differentiate from sibling tools like plan_sub_query or plan_intent.

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

Usage Guidelines3/5

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

The description gives implicit usage context (Phase 4, batch submission) and provides rules for terms (≤8 words, purpose must reference sub-query id). However, it lacks explicit guidance on when not to use the tool or when alternatives are preferred.

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

plan_sub_queryA

Phase 3: Submit ALL sub-queries in ONE call (batch).

items_json: JSON array, each element shape: {"id":"sq1","goal":"...","expected_output":"...","boundary":"...", "depends_on":["sq0"],"tool_hint":"web_search"}

Validation enforced by the engine:

  • ids must be unique

  • depends_on must reference declared ids

  • no cycles in depends_on graph

  • duplicate id → error returned, batch rejected

Set is_revision=true to replace any previously submitted decomposition.

ParametersJSON Schema
NameRequiredDescriptionDefault
thoughtYesReasoning for the full decomposition
confidenceNoConfidence 0.0-1.0
items_jsonYesJSON array of sub-query objects (see description for shape)
session_idYesSession ID from plan_intent
is_revisionNoTrue to replace prior decomposition

TDQS

A3.6/5.0
Behavior3/5

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

No annotations exist, so description carries full burden. It discloses batch submission, validation rules (unique ids, no cycles), error on duplicate, and is_revision effect. However, missing details on result behavior (e.g., return value, idempotency).

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

Conciseness4/5

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

Description is well-structured with bullet points and a JSON example. Front-loaded with purpose. Could be slightly more concise by omitting standard validation details, but overall efficient.

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

Completeness3/5

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

No output schema exists; description does not explain return values or error responses. Prerequisites are implied by required session_id from plan_intent. Missing post-submission context (e.g., success indication, session state changes).

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 already covers 100% of parameters. Description adds significant value for items_json by specifying exact JSON shape, validation constraints, and the purpose of is_revision. Other parameters (session_id, thought, confidence) are not enhanced beyond schema, but the critical parameter is well-explained.

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?

Clearly states the tool submits ALL sub-queries in one call (batch). Verb 'submit' and resource 'ALL sub-queries in ONE call' are specific. Mention of 'Phase 3' distinguishes it from earlier planning phases.

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

Usage Guidelines2/5

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

Only implies phase context ('Phase 3'), but no explicit when-to-use or when-not-to-use. No comparison to sibling tools like plan_intent or plan_execution. No guidance on choosing is_revision vs not.

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

plan_tool_mappingA

Phase 5: Submit ALL sub-query → tool mappings in ONE call (batch).

mappings_json: JSON array, each element shape: {"sub_query_id":"sq1","tool":"web_search","reason":"...", "params":{"platform":"GitHub"}}

tool must be: web_search.

ParametersJSON Schema
NameRequiredDescriptionDefault
thoughtYesReasoning for the full mapping
confidenceNoConfidence 0.0-1.0
session_idYesSession ID from plan_intent
is_revisionNoTrue to replace prior mappings
mappings_jsonYesJSON array of mapping objects (see description)

TDQS

A3.9/5.0
Behavior2/5

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

No annotations provided, and the description does not disclose behavioral traits like side effects, authorization needs, or rate limits. The minimal description lacks transparency beyond the basic purpose.

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

Conciseness5/5

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

The description is extremely concise with two sentences. The first sentence states the purpose clearly, and the second provides the exact JSON template. No wasted words.

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

Completeness3/5

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

Given 5 parameters, no output schema, and no annotations, the description covers the core element (mappings_json format) but lacks information on response behavior, validation, or error handling. It is adequate but not comprehensive.

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 coverage is 100%, but the description adds value by providing the exact JSON structure for mappings_json, which goes beyond the schema's generic description. This helps the agent format the parameter correctly.

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?

The description clearly states the verb 'Submit' and the resource 'all sub-query → tool mappings in one call (batch)'. It distinguishes from sibling tools like plan_sub_query and plan_execution by specifying it's a batch mapping submission.

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 description explicitly says 'Phase 5' and 'Submit ALL sub-query → tool mappings in ONE call', indicating when to use it. However, it does not explicitly state when not to use it or provide alternatives, though sibling tools give context.

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

switch_modelA
Switches the GLM-compatible model used for search summarization, persisting the setting.

**Key Features:**
    - **Model Selection:** Change the AI model for web search and content fetching.
    - **Persistent Storage:** Model preference saved to ~/.config/selvin-search/config.json.
    - **Immediate Effect:** New model used for all subsequent operations.

**Edge Cases & Best Practices:**
    - Use get_config_info to verify available models before switching.
    - Invalid model IDs may cause API errors in subsequent requests.
    - Model changes persist across sessions until explicitly changed again.
ParametersJSON Schema
NameRequiredDescriptionDefault
modelYesModel ID to switch to.

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavior: the change takes immediate effect, persists to ~/.config/selvin-search/config.json, and invalid model IDs may cause API errors in subsequent requests. This is complete transparency for a mutation tool.

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

Conciseness4/5

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

The description is well-structured with 'Key Features' and 'Edge Cases' sections, front-loading the core purpose. It is slightly verbose with some redundancy (e.g., 'Model Selection' and 'Immediate Effect'), but every sentence adds value.

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

Completeness5/5

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

For a simple one-parameter tool with no output schema, the description covers all necessary context: what the tool does, how it persists, prerequisites (model ID from get_config_info), and consequences of invalid input. It is self-sufficient.

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 coverage is 100% with a clear description for the 'model' parameter. The description adds value by linking to get_config_info for valid IDs and explaining the context (search summarization), going beyond the schema alone.

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?

The description clearly states the tool's purpose: switching the GLM-compatible model used for search summarization and persisting the setting. It differentiates from siblings by specifying the domain (search summarization) and persistent configuration, distinguishing it from informational tools like get_config_info.

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

Usage Guidelines5/5

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

Explicit best practices are provided: use get_config_info to verify available models before switching, warning about invalid model IDs causing subsequent errors, and noting persistence across sessions. This gives clear guidance on when and how to use the tool.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 10 tool updatesv0.1.0
    • First observedget_config_info
    • First observedget_sources
    • First observedplan_complexity
    • First observedplan_execution
    • First observedplan_intent
    • First observedplan_search_term
    • First observedplan_sub_query
    • First observedplan_tool_mapping
    • First observedswitch_model
    • First observedweb_search

TDQS

A3.9/5.0

Scored across 10 tools

Disambiguation5/5

Each tool has a distinct purpose. Planning tools follow a clear phase sequence (1-6), while configuration and search tools are separate. No two tools have overlapping functionality.

Naming Consistency4/5

Most tools use a consistent verb_noun pattern in snake_case. However, 'web_search' is noun_verb, which is a minor deviation from the otherwise uniform naming convention.

Tool Count5/5

With 10 tools, the set is well-scoped for a search server with planning capabilities. It covers all necessary phases without being too large or too small.

Completeness5/5

The tool surface covers the entire search workflow: configuration, planning (all six phases), web search execution, and source retrieval. No obvious gaps exist for the server's stated purpose.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers